:root {
  /* Cores padrão (tema escuro) - Serão sobrescritas pelo theme.js */
  --bg: #0A0F1E;
  --bg-secondary: #0F1420;
  --panel: #131A2B;
  --panel-hover: #1A2137;
  --text: #F1F5F9;
  --text-secondary: #CBD5E1;
  --muted: #94A3B8;
  --border: #1E293B;
  --border-light: #334155;
  --shadow: rgba(0, 0, 0, 0.6);
  --shadow-lg: rgba(0, 0, 0, 0.8);
  --input-bg: #1A2137;
  --input-border: #334155;
  --input-focus: #60A5FA;
  --hover-overlay: rgba(96, 165, 250, 0.12);
  --active-overlay: rgba(96, 165, 250, 0.18);
  --primary: #60A5FA;
  --primary-hover: #3B82F6;
  --primary-dark: #2563EB;
  --success: #34D399;
  --success-hover: #10B981;
  --warning: #FBBF24;
  --warning-hover: #F59E0B;
  --danger: #F87171;
  --danger-hover: #EF4444;
}

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

html {
  height: 100%;
  width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  width: 100%;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(96, 165, 250, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(52, 211, 153, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(251, 191, 36, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 60% 60%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
  animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.8;
  }
}

body>* {
  position: relative;
  z-index: 1;
}

/* Animação de entrada suave */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.topbar {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  background: var(--panel);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 24px var(--shadow-lg);
  transition: all 0.3s ease;
}

.topbar::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.3), transparent);
}

.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1400px;
  padding: 18px 32px;
  box-sizing: border-box;
}

.brand {
  font-weight: 800;
  letter-spacing: -0.8px;
  font-size: 24px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand::before {
  content: '◆';
  color: var(--primary);
  font-size: 16px;
}

/* Header Logos */
.header-logos {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-right: 24px;
}

.logo-system,
.logo-clinic {
  display: flex;
  align-items: center;
}

.logo-hedah {
  height: 40px;
  width: auto;
  max-width: 150px;
  transition: opacity 0.3s ease;
}

.logo-clinic-img {
  height: 36px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
}

.logo-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
  opacity: 0.5;
}

@media (max-width: 768px) {
  .header-logos {
    gap: 8px;
    margin-right: 12px;
  }

  .logo-hedah {
    height: 32px;
    max-width: 100px;
  }

  .logo-clinic-img {
    height: 28px;
    max-width: 80px;
  }

  .logo-divider {
    height: 24px;
  }
}

.nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav li {
  margin: 0;
  padding: 0;
}

.nav a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 8px;
  display: inline-block;
  font-weight: 500;
  font-size: 13px;
  transition: all 0.2s ease;
  position: relative;
}

.nav a:hover {
  background: rgba(96, 165, 250, 0.08);
  color: var(--text);
}

.nav a.active {
  background: rgba(96, 165, 250, 0.12);
  color: var(--primary);
  font-weight: 600;
}

/* Menu Dropdown */
.nav li.dropdown {
  position: relative;
}

.nav li.dropdown>a {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav li.dropdown>a::after {
  content: '▼';
  font-size: 9px;
  transition: transform 0.2s ease;
  opacity: 0.7;
}

.nav li.dropdown:hover>a::after,
.nav li.dropdown.active>a::after {
  transform: rotate(180deg);
}

.nav .dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: rgba(15, 20, 32, 0.98);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 8px;
  margin-top: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 1000;
}

.nav li.dropdown:hover .dropdown-menu,
.nav li.dropdown.active .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav .dropdown-menu li {
  margin: 0;
}

.nav .dropdown-menu a {
  display: block;
  padding: 10px 14px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-size: 13px;
  font-weight: 500;
}

.nav .dropdown-menu a:hover {
  background: rgba(96, 165, 250, 0.1);
  color: var(--text);
  padding-left: 18px;
}

.nav .dropdown-menu a.active {
  background: rgba(96, 165, 250, 0.15);
  color: var(--primary);
  font-weight: 600;
}

.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 32px;
  flex: 1;
  box-sizing: border-box;
  overflow-x: hidden;
  animation: fadeInUp 0.6s ease-out;
}

.panel {
  background: rgba(15, 20, 32, 0.5);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border: 1px solid rgba(96, 165, 250, 0.1);
  border-radius: 24px;
  padding: 32px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 0 0 1px rgba(96, 165, 250, 0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.2), transparent);
  opacity: 0.5;
}

.panel:hover {
  transform: translateY(-2px);
  box-shadow:
    0 12px 48px rgba(0, 0, 0, 0.5),
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 0 0 1px rgba(96, 165, 250, 0.15);
  border-color: rgba(96, 165, 250, 0.2);
}

.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.btn {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: white;
  border: 0;
  padding: 12px 24px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:
    0 4px 16px rgba(96, 165, 250, 0.25),
    0 1px 0 rgba(255, 255, 255, 0.2) inset;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.3px;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    0 8px 24px rgba(96, 165, 250, 0.4),
    0 1px 0 rgba(255, 255, 255, 0.3) inset;
  background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary-dark) 100%);
}

.btn:hover::before {
  opacity: 1;
}

.btn:active {
  transform: translateY(0) scale(0.98);
  box-shadow:
    0 2px 8px rgba(96, 165, 250, 0.3),
    0 1px 0 rgba(255, 255, 255, 0.2) inset;
}

.btn.secondary {
  background: var(--panel-hover);
  color: var(--text);
  box-shadow: 0 2px 8px var(--shadow);
}

.btn.secondary:hover {
  background: var(--border-light);
  box-shadow: 0 4px 12px var(--shadow);
}

.btn.warning {
  background: var(--warning);
  color: white;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.btn.warning:hover {
  background: var(--warning-hover);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
}

.btn.danger {
  background: var(--danger);
  color: white;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.btn.danger:hover {
  background: var(--danger-hover);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.input,
.select,
.textarea {
  width: 100%;
  background: var(--input-bg);
  color: var(--text);
  border: 2px solid var(--input-border);
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 14px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  box-shadow: 0 2px 8px var(--shadow);
}

.select {
  appearance: none;
  -webkit-appearance: none;
  -moz-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='%2394a3b8' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 12px !important;
  padding-right: 36px;
  cursor: pointer;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px var(--active-overlay), 0 4px 16px var(--shadow);
  transform: translateY(-1px);
}

.input:focus,
.textarea:focus {
  background: var(--input-bg);
}

.select:focus {
  background-color: var(--input-bg);
  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='%2394a3b8' d='M6 9L1 4h10z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 12px !important;
}

.input::placeholder {
  color: var(--muted);
}

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

.grid {
  display: grid;
  gap: 20px;
}

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

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 768px) {

  .grid.cols-2,
  .grid.cols-3 {
    grid-template-columns: 1fr;
  }
}

/* Responsive cards grid */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 10px;
  overflow: hidden;
}

th,
td {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

th {
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.5px;
  background: var(--bg-secondary);
}

tbody tr {
  transition: background 0.2s ease;
}

tbody tr:hover {
  background: var(--hover-overlay);
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

.spacer {
  height: 20px;
}

.footer {
  background: var(--panel);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 48px;
}

.card {
  background: var(--panel);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.3),
    0 1px 0 rgba(255, 255, 255, 0.05) inset;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.4), rgba(52, 211, 153, 0.4), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(96, 165, 250, 0.08), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.card:hover {
  border-color: var(--primary);
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 12px 40px var(--shadow-lg), 0 0 0 1px var(--primary);
  background: var(--panel-hover);
}

.card:hover::before,
.card:hover::after {
  opacity: 1;
}

.card .title {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.card .value {
  font-size: 32px;
  font-weight: 700;
  margin-top: 8px;
  color: var(--text);
  position: relative;
  z-index: 1;
  /*text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);*/
}

.card.stat {
  border-left: 4px solid var(--primary);
  background: var(--panel);
  position: relative;
  overflow: hidden;
}

.card.stat::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(96, 165, 250, 0.15) 0%, transparent 70%);
}

/* Animation removed */
/*
@keyframes statGlow { ... }
*/

.tag {
  display: inline-block;
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 24px;
  border: 1px dashed var(--border);
  border-radius: 10px;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.header-row::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 80px;
  height: 2px;
  background: var(--primary);
}

.header-row h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
  position: relative;
}

.header-row h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.3;
  font-weight: 600;
  color: var(--text);
}

.recent-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.recent-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

/* Calendar */
.calendar-head,
.calendar-body {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.calendar-cell {
  min-height: 84px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  background: #0b1220;
}

.calendar-cell.head {
  min-height: auto;
  background: transparent;
  border: 0;
  color: var(--muted);
  text-align: center;
  font-weight: 600;
}

.calendar-cell.empty {
  background: transparent;
  border: 0;
}

.calendar-cell.day {
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.calendar-cell.day:hover {
  outline: 2px solid var(--primary);
  background: var(--hover);
  transform: scale(1.02);
}

.calendar-cell.day:hover::after {
  content: '+ Novo agendamento';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--primary);
  font-weight: 600;
  white-space: nowrap;
  opacity: 0.7;
}

.event-pill {
  background: var(--primary);
  color: var(--text);
}

.day-number {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.event-pill {
  font-size: 12px;
  background: #1f2937;
  color: var(--text);
  border-radius: 6px;
  padding: 2px 6px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.time-slot {
  font-size: 12px;
  color: var(--muted);
  padding: 2px 6px;
  border-radius: 6px;
  cursor: pointer;
}

.time-slot:hover {
  background: #1f2937;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-content {
  background: linear-gradient(135deg, rgba(15, 20, 32, 0.95) 0%, rgba(20, 25, 40, 0.95) 100%);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  padding: 36px;
  border-radius: 24px;
  width: 90%;
  max-width: 550px;
  border: 1px solid rgba(96, 165, 250, 0.2);
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(96, 165, 250, 0.1),
    0 1px 0 rgba(255, 255, 255, 0.08) inset;
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.modal-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.6), rgba(52, 211, 153, 0.6), transparent);
}

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

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-content h2 {
  margin-bottom: 24px;
  font-size: 24px;
  font-weight: 700;
}

/* Alert Messages */
.error,
.success {
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 20px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideDown 0.3s ease;
}

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

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.error {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.3);
  border: 2px solid var(--danger);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.success {
  color: #bbf7d0;
  background: rgba(20, 83, 45, 0.3);
  border: 2px solid var(--success);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 16px;
}

.tab-content {
  padding: 16px;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}

.image-item {
  position: relative;
}

.image-item img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.image-item .btn.danger.small {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 8px;
  font-size: 12px;
}

/* Dashboard specifics */
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 16px;
}

@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.list li {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.when {
  min-width: 110px;
  color: var(--muted);
  font-size: 12px;
}

.who {
  font-weight: 600;
}

.what {
  color: var(--muted);
}

.chip {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--panel-hover) 0%, rgba(26, 31, 46, 0.8) 100%);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(96, 165, 250, 0.15);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.chip.today {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.chip.tomorrow {
  background: linear-gradient(135deg, var(--warning) 0%, var(--warning-hover) 100%);
  color: white;
  border-color: var(--warning);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

@keyframes chipPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

/* Chart */
.chart-panel .toolbar {
  justify-content: flex-end;
}

.chart-wrap {
  width: 100%;
  overflow: hidden;
  position: relative;
}

.chart-canvas {
  width: 100%;
  height: 280px;
  display: block;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0b1220;
}

.chart-legend {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.chart-legend .dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--primary);
  display: inline-block;
}

.filter-inline {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  background: rgba(15, 20, 32, 0.3);
  padding: 8px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.filter-inline label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin: 0;
}

.filter-inline .input,
.filter-inline .select,
.filter-inline .btn {
  width: auto;
  min-width: 120px;
  margin: 0;
}

/* Tooltip for chart */
.chart-tip {
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(8px, -8px);
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  white-space: nowrap;
  display: none;
  z-index: 5;
}

/* Upgrade Link Discreto */
.nav a.upgrade-link {
  color: var(--warning);
  background: transparent;
}

.nav a.upgrade-link:hover {
  background: rgba(251, 191, 36, 0.1);
  color: var(--warning-hover);
}

/* Botão Flutuante de Upgrade (FAB) */
.upgrade-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #1a1f3a;
  border: none;
  border-radius: 50px;
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(251, 191, 36, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: upgrade-pulse 2s ease-in-out infinite;
  white-space: nowrap;
}

.upgrade-fab:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 12px 32px rgba(251, 191, 36, 0.5), 0 8px 16px rgba(0, 0, 0, 0.4);
  background: linear-gradient(135deg, #fcd34d 0%, #fbbf24 100%);
  animation: none;
}

.upgrade-fab:active {
  transform: translateY(-2px) scale(1.02);
}

.upgrade-fab-icon {
  font-size: 20px;
  display: inline-block;
  animation: upgrade-star-rotate 3s linear infinite;
}

.upgrade-fab-text {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

/* Animação de pulso suave */
@keyframes upgrade-pulse {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 8px 24px rgba(251, 191, 36, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3);
  }

  50% {
    transform: scale(1.03);
    box-shadow: 0 12px 32px rgba(251, 191, 36, 0.5), 0 6px 16px rgba(0, 0, 0, 0.35);
  }
}

/* Animação de rotação da estrela */
@keyframes upgrade-star-rotate {

  0%,
  100% {
    transform: rotate(0deg);
  }

  25% {
    transform: rotate(-10deg);
  }

  75% {
    transform: rotate(10deg);
  }
}

/* Responsivo */
@media (max-width: 768px) {
  .upgrade-fab {
    bottom: 16px;
    right: 16px;
    padding: 12px 20px;
    font-size: 14px;
  }

  .upgrade-fab-icon {
    font-size: 18px;
  }

  .upgrade-fab-text {
    font-size: 14px;
  }
}

/* Modal de Upgrade */
#upgrade-modal {
  display: none;
}

#upgrade-modal.active {
  display: flex;
}

.upgrade-content {
  max-width: 650px;
}

.upgrade-header {
  text-align: center;
  margin-bottom: 32px;
}

.upgrade-header h2 {
  font-size: 28px;
  margin-bottom: 12px;
  color: var(--text);
  font-weight: 700;
}

.upgrade-features {
  display: grid;
  gap: 16px;
  margin-bottom: 32px;
}

.upgrade-feature {
  background: rgba(15, 20, 32, 0.6);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
  display: flex;
  align-items: start;
  gap: 16px;
  transition: all 0.2s ease;
}

.upgrade-feature:hover {
  border-color: var(--border-light);
  transform: translateX(4px);
}

.upgrade-feature-icon {
  font-size: 24px;
  min-width: 40px;
  height: 40px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.2) 0%, rgba(245, 158, 11, 0.2) 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upgrade-feature-content h3 {
  margin-bottom: 12px;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
}

.upgrade-feature-content p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.badge-soon {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(251, 191, 36, 0.15);
  color: var(--warning);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.upgrade-notify {
  text-align: center;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.upgrade-notify p {
  font-size: 15px;
  margin-bottom: 0;
}

.upgrade-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
}

.btn.premium {
  background: var(--primary);
  color: white;
  font-weight: 600;
  padding: 12px 28px;
  font-size: 14px;
}

.btn.premium:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

/* ========================================
   RESPONSIVIDADE MOBILE E TABLET
   ======================================== */

/* Menu Mobile Hamburguer */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 10px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-weight: 400;
  min-width: 44px;
  min-height: 44px;
}

.mobile-menu-toggle:hover {
  background: rgba(96, 165, 250, 0.1);
  color: var(--primary);
}

.mobile-menu-toggle:active {
  transform: scale(0.95);
  background: rgba(96, 165, 250, 0.15);
}

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
  .container {
    padding: 32px 24px;
  }

  .panel {
    padding: 24px;
  }

  .topbar-inner {
    padding: 16px 24px;
  }

  .header-row h1 {
    font-size: 24px;
  }

  .header-row h2 {
    font-size: 20px;
  }

  /* Melhor espaçamento para cards em tablet */
  .cards {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }

  /* Tabelas com scroll horizontal em tablet */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table-responsive table {
    min-width: 600px;
  }
}

/* Mobile (até 768px) */
@media (max-width: 768px) {

  /* Prevenir overflow horizontal */
  * {
    max-width: 100%;
  }

  /* Container e espaçamento */
  .container {
    padding: 20px 16px;
    max-width: 100%;
    width: 100%;
    overflow-x: hidden;
  }

  .panel {
    padding: 20px;
    border-radius: 16px;
    max-width: 100%;
    overflow-x: hidden;
  }

  /* Header mobile */
  .topbar {
    width: 100%;
    max-width: 100%;
  }

  .topbar-inner {
    padding: 12px 16px;
    gap: 12px;
    width: 100%;
    max-width: 100%;
  }

  .brand {
    font-size: 18px;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Mostrar botão hamburguer */
  .mobile-menu-toggle {
    display: flex;
    flex-shrink: 0;
  }

  /* Menu mobile */
  .nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: #0f1420;
    border-left: 1px solid var(--border);
    padding: 80px 20px 20px 20px;
    transition: right 0.3s ease;
    z-index: 10000;
    overflow-y: auto;
    box-shadow: -4px 0 20px var(--shadow-lg);
    pointer-events: auto;
  }

  .nav.active {
    right: 0;
  }

  .nav * {
    pointer-events: auto;
  }

  .nav ul {
    flex-direction: column;
    gap: 4px;
    align-items: stretch;
  }

  .nav a {
    display: block;
    padding: 12px 16px;
    font-size: 14px;
  }

  /* Dropdown em mobile */
  .nav .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    margin: 4px 0 4px 16px;
    box-shadow: none;
    border: none;
    background: rgba(10, 15, 30, 0.5);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 8px;
  }

  .nav li.dropdown.active .dropdown-menu {
    max-height: 300px;
    padding: 8px;
  }

  .nav li.dropdown>a::after {
    margin-left: auto;
  }

  /* Overlay quando menu mobile está aberto */
  .mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 280px;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 9999;
    pointer-events: auto;
  }

  .mobile-menu-overlay.active {
    display: block;
  }

  /* Botão de fechar no menu mobile */
  .nav-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text);
    font-size: 28px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s ease;
  }

  .nav-close:hover {
    background: rgba(96, 165, 250, 0.1);
  }

  /* Headers */
  .header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .header-row h1 {
    font-size: 22px;
  }

  .header-row h2 {
    font-size: 18px;
  }

  .header-row .toolbar {
    width: 100%;
  }

  /* Botões */
  .btn {
    padding: 10px 18px;
    font-size: 14px;
    width: 100%;
    justify-content: center;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar .btn {
    width: 100%;
  }

  /* Cards */
  .card {
    padding: 20px;
  }

  .card .value {
    font-size: 28px;
  }

  .cards {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Dashboard grid mobile */
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* Formulários */
  .input,
  .select,
  .textarea {
    font-size: 16px;
    /* Previne zoom automático no iOS */
    padding: 14px 16px;
  }

  label {
    font-size: 14px;
    margin-bottom: 6px;
  }

  /* Ajustes específicos para forms */
  .row {
    margin-bottom: 16px;
  }

  /* Botões de ação em tabelas */
  .procedure-actions,
  td.procedure-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .procedure-actions .btn {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
  }

  /* Modal mobile */
  .modal-content {
    width: 95%;
    padding: 24px;
    margin: 16px;
  }

  .modal-content h2 {
    font-size: 20px;
  }

  /* Tabelas - Card layout em mobile */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
  }

  table {
    min-width: 600px;
  }

  th,
  td {
    padding: 12px;
    font-size: 13px;
  }

  /* Calendário mobile */
  .calendar-cell {
    min-height: 70px;
    padding: 4px;
  }

  .day-number {
    font-size: 11px;
  }

  .event-pill {
    font-size: 10px;
    padding: 2px 4px;
  }

  /* Chart mobile */
  .chart-canvas {
    height: 220px;
  }

  .filter-inline {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    gap: 8px;
  }

  .filter-inline label {
    font-size: 12px;
  }

  .filter-inline .input,
  .filter-inline .select,
  .filter-inline .btn {
    width: 100%;
    min-width: auto;
  }

  /* Lista de próximos atendimentos mobile */
  .list li {
    flex-direction: column;
    gap: 8px;
    padding: 12px;
  }

  .when {
    min-width: auto;
  }

  /* Tabelas responsivas */
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }

  table th,
  table td {
    white-space: nowrap;
    padding: 8px;
    font-size: 13px;
  }

  /* Botões e toolbar mobile */
  .toolbar {
    flex-wrap: wrap;
    gap: 8px;
  }

  .toolbar .btn {
    flex: 1;
    min-width: 120px;
  }

  .header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .header-row h1 {
    font-size: 24px;
  }

  .header-row h2 {
    font-size: 20px;
  }

  /* Cards mobile */
  .card {
    padding: 16px;
    max-width: 100%;
  }

  .cards,
  .stat-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Dashboard grid mobile */
  .dashboard-grid {
    grid-template-columns: 1fr !important;
  }

  /* Calendar mobile */
  .calendar-body {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .calendar-cell {
    min-width: 50px;
    min-height: 60px;
    font-size: 12px;
  }

  .day-number {
    font-size: 14px;
  }

  .event-pill {
    font-size: 11px;
    padding: 2px 6px;
  }

  /* Upgrade modal mobile */
  .upgrade-content {
    max-width: 100%;
  }

  .upgrade-header h2 {
    font-size: 22px;
  }

  .upgrade-feature {
    flex-direction: column;
    text-align: center;
  }

  .upgrade-actions {
    flex-direction: column;
  }

  .upgrade-actions .btn {
    width: 100%;
  }

  /* Footer mobile */
  .footer {
    padding: 20px 16px;
    font-size: 13px;
  }

  /* Espaçamento geral mobile */
  .spacer {
    height: 16px;
  }
}

/* Mobile pequeno (até 480px) */
@media (max-width: 480px) {
  .container {
    padding: 16px 12px;
  }

  .panel {
    padding: 16px;
  }

  .brand {
    font-size: 18px;
  }

  .brand::before {
    font-size: 14px;
  }

  .header-row h1 {
    font-size: 20px;
  }

  .card .value {
    font-size: 24px;
  }

  .btn {
    padding: 10px 16px;
    font-size: 13px;
  }

  .modal-content {
    padding: 20px;
  }

  /* Ajustes para textos longos */
  h1,
  h2,
  h3 {
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  /* Prevenir overflow horizontal */
  body {
    overflow-x: hidden;
  }

  .container,
  .panel,
  .card {
    max-width: 100%;
    overflow-x: hidden;
  }

  /* Calendário muito pequeno - mostrar menos informações */
  .calendar-cell {
    min-height: 60px;
  }

  .event-pill {
    font-size: 9px;
    padding: 1px 3px;
  }

  /* Chart muito pequeno */
  .chart-canvas {
    height: 180px;
  }
}

/* Melhorias de UX para touch devices */
@media (hover: none) and (pointer: coarse) {

  /* Aumentar área de toque para elementos clicáveis */
  .btn,
  .nav a,
  .mobile-menu-toggle,
  .nav-close {
    min-height: 44px;
  }

  /* Remover efeitos hover em dispositivos touch */
  .card:hover {
    transform: none;
  }

  .btn:hover {
    transform: none;
  }

  /* Feedback visual para toque */
  .btn:active,
  .nav a:active {
    opacity: 0.7;
  }
}

/* Landscape mobile (orientação horizontal) */
@media (max-width: 900px) and (orientation: landscape) {
  .nav {
    width: 320px;
  }

  .modal-content {
    max-height: 90vh;
    overflow-y: auto;
  }

  .calendar-cell {
    min-height: 50px;
  }
}

/* Print styles (ocultar elementos desnecessários na impressão) */
@media print {

  .topbar,
  .nav,
  .toolbar,
  .btn,
  .footer,
  .mobile-menu-toggle {
    display: none !important;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

  .panel {
    border: none;
    box-shadow: none;
    page-break-inside: avoid;
  }
}

/* Acessibilidade - Melhorar contraste em modo de alto contraste */
@media (prefers-contrast: high) {
  .btn {
    border: 2px solid currentColor;
  }

  .panel,
  .card {
    border-width: 2px;
  }
}

/* Preferência de movimento reduzido */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========================================
   ESTILOS ESPECÍFICOS PARA TEMA CLARO
   ======================================== */

body.theme-light {
  background: var(--bg);
}

body.theme-light::before {
  display: none;
}

/* Topbar no tema claro */
body.theme-light .topbar {
  background: #FFFFFF;
  border-bottom: 1px solid var(--border);
  backdrop-filter: none;
}

body.theme-light .brand {
  color: var(--text);
}

body.theme-light .brand::before {
  color: var(--primary);
}

/* Cards no tema claro */
body.theme-light .card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  backdrop-filter: none;
}

body.theme-light .card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

body.theme-light .card.stat {
  border-left: 3px solid var(--primary);
  background: #FFFFFF;
}

/* Panel no tema claro */
body.theme-light .panel {
  background: #FFFFFF;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  backdrop-filter: none;
}

/* Nav menu no tema claro */
body.theme-light .nav a {
  color: var(--text-secondary);
}

body.theme-light .nav a:hover {
  background: rgba(59, 130, 246, 0.08);
  color: var(--text);
}

body.theme-light .nav a.active {
  background: rgba(59, 130, 246, 0.12);
  color: var(--primary);
  font-weight: 600;
}

/* Dropdown menu no tema claro */
body.theme-light .nav .dropdown-menu {
  background: #FFFFFF;
  border: 1px solid var(--border);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
  backdrop-filter: none;
}

body.theme-light .nav .dropdown-menu a:hover {
  background: rgba(59, 130, 246, 0.08);
}

body.theme-light .nav .dropdown-menu a.active {
  background: rgba(59, 130, 246, 0.12);
  color: var(--primary);
}

/* Tabelas no tema claro */
body.theme-light th {
  background: #f8f9fa;
  color: var(--text-secondary);
  font-weight: 600;
}

body.theme-light tbody tr {
  transition: background 0.2s ease;
}

body.theme-light tbody tr:hover {
  background: rgba(96, 165, 250, 0.04);
}

/* Inputs no tema claro */
body.theme-light .input,
body.theme-light .select,
body.theme-light .textarea {
  background: #FFFFFF;
  border: 1px solid var(--border);
  color: var(--text);
  transition: all 0.2s ease;
}

body.theme-light .input:hover,
body.theme-light .select:hover,
body.theme-light .textarea:hover {
  border-color: var(--input-border);
}

body.theme-light .input:focus,
body.theme-light .select:focus,
body.theme-light .textarea:focus {
  border-color: var(--primary);
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

/* Botões no tema claro */
body.theme-light .btn {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  font-weight: 600;
}

body.theme-light .btn:hover {
  box-shadow: 0 4px 12px rgba(96, 165, 250, 0.3);
  transform: translateY(-1px);
}

body.theme-light .btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

body.theme-light .btn.secondary {
  background: #FFFFFF;
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

body.theme-light .btn.secondary:hover {
  background: var(--bg-secondary);
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Chips/Tags no tema claro */
body.theme-light .chip {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-weight: 500;
}

body.theme-light .chip.today {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 1px 3px rgba(96, 165, 250, 0.3);
}

body.theme-light .chip.tomorrow {
  background: var(--warning);
  color: white;
  border-color: var(--warning);
  box-shadow: 0 1px 3px rgba(245, 158, 11, 0.3);
}

/* Modal no tema claro */
body.theme-light .modal-content {
  background: #FFFFFF;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  backdrop-filter: none;
}

body.theme-light .modal-content h2 {
  color: var(--text);
}

/* Calendar no tema claro */
body.theme-light .calendar-cell {
  background: #FFFFFF;
  border: 1px solid var(--border);
}

body.theme-light .calendar-cell.head {
  background: transparent;
  color: var(--text-secondary);
}

body.theme-light .calendar-cell.day:hover {
  outline: 2px solid var(--primary);
  background: var(--hover);
  transform: scale(1.02);
}

body.theme-light .calendar-cell.day:hover::after {
  content: '+ Novo agendamento';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--primary);
  font-weight: 600;
  white-space: nowrap;
  opacity: 0.8;
}

body.theme-light .event-pill {
  background: rgba(96, 165, 250, 0.1);
  color: var(--text);
  border: 1px solid rgba(96, 165, 250, 0.2);
}

/* Footer no tema claro */
body.theme-light .footer {
  background: #FFFFFF;
  border-top: 1px solid var(--border);
  color: var(--muted);
  backdrop-filter: none;
}

/* Mensagens de erro/sucesso no tema claro */
body.theme-light .error {
  color: #c81e1e;
  background: rgba(252, 165, 165, 0.3);
  border: 2px solid #fb7185;
}

body.theme-light .success {
  color: #166534;
  background: rgba(187, 247, 208, 0.3);
  border: 2px solid #34d399;
}

/* Empty state no tema claro */
body.theme-light .empty {
  border: 1px dashed var(--border);
  color: var(--muted);
}

/* Chart no tema claro */
body.theme-light .chart-canvas {
  background: var(--panel);
  border: 1px solid var(--border);
}

/* Upgrade modal no tema claro */
body.theme-light .upgrade-feature {
  background: #f8f9fa;
  border: 1px solid var(--border);
}

body.theme-light .upgrade-feature-icon {
  background: rgba(251, 191, 36, 0.1);
}

/* Menu mobile no tema claro */
@media (max-width: 768px) {
  body.theme-light .nav {
    background: #FFFFFF;
    border-left: 1px solid var(--border);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    pointer-events: auto;
  }

  body.theme-light .nav * {
    pointer-events: auto;
  }

  body.theme-light .nav .dropdown-menu {
    background: var(--bg-secondary);
  }

  body.theme-light .mobile-menu-toggle {
    color: var(--text);
  }

  body.theme-light .mobile-menu-toggle:hover {
    background: rgba(59, 130, 246, 0.08);
    color: var(--primary);
  }

  body.theme-light .mobile-menu-overlay {
    background: rgba(0, 0, 0, 0.5);
    right: 280px;
    pointer-events: auto;
  }
}

/* Melhorias adicionais para tema claro */
body.theme-light .topbar {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Tags e badges no tema claro */
body.theme-light .tag {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  font-weight: 500;
}

/* Lista de itens no tema claro */
body.theme-light .list {
  border: none;
}

body.theme-light .list li {
  background: #FFFFFF;
  border: 1px solid var(--border);
  margin-bottom: 8px;
  border-radius: 12px;
  transition: all 0.2s ease;
}

body.theme-light .list li:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.12);
  transform: translateY(-1px);
}

/* Quando (tempo) no tema claro */
body.theme-light .when {
  color: var(--text-secondary);
}

body.theme-light .who {
  color: var(--text);
}

body.theme-light .what {
  color: var(--muted);
}

/* Dashboard grid no tema claro */
body.theme-light .dashboard-grid {
  gap: 24px;
}

/* Stat cards no tema claro */
body.theme-light .stat .title {
  color: var(--text-secondary);
  font-weight: 500;
}

body.theme-light .stat .value {
  color: var(--text);
  font-weight: 700;
}

/* Chart legend no tema claro */
body.theme-light .chart-legend {
  color: var(--text-secondary);
}

body.theme-light .chart-legend .dot {
  background: var(--primary);
}

/* Toolbar no tema claro */
body.theme-light .toolbar {
  gap: 12px;
}

/* Select no tema claro */
body.theme-light .select {
  background-color: #FFFFFF;
  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='%234B5563' d='M6 9L1 4h10z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 12px !important;
}

body.theme-light .select:hover {
  border-color: var(--primary);
  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='%234B5563' d='M6 9L1 4h10z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 12px !important;
}

body.theme-light .select:focus {
  background-color: #FFFFFF;
  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='%234B5563' d='M6 9L1 4h10z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 12px !important;
}

/* Muted text no tema claro */
body.theme-light .muted {
  color: var(--muted);
}

/* Settings menu no tema claro */
body.theme-light .settings-menu {
  background: #FFFFFF;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

body.theme-light .settings-menu-item:hover {
  background: var(--bg-secondary);
}

body.theme-light .settings-menu-item.active {
  background: var(--primary);
  color: white;
}

/* Gradientes de texto no tema claro */
body.theme-light h1,
body.theme-light h2,
body.theme-light h3 {
  color: var(--text);
}

/* Imagens e grid no tema claro */
body.theme-light .image-grid .image-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #FFFFFF;
}

/* Melhor contraste para bordas no tema claro */
body.theme-light hr {
  border-color: var(--border);
  opacity: 1;
}

/* Scrollbar customizada - Tema Escuro */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 6px;
  border: 2px solid var(--bg-secondary);
}

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

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border) var(--bg-secondary);
}

/* Scrollbar customizada - Tema Claro */
body.theme-light ::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

body.theme-light ::-webkit-scrollbar-track {
  background: #F5F7FA;
}

body.theme-light ::-webkit-scrollbar-thumb {
  background: #D1D5DB;
  border-radius: 6px;
  border: 2px solid #F5F7FA;
}

body.theme-light ::-webkit-scrollbar-thumb:hover {
  background: #9CA3AF;
}

body.theme-light * {
  scrollbar-width: thin;
  scrollbar-color: #D1D5DB #F5F7FA;
}

/* Filter inline no tema claro */
body.theme-light .filter-inline {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
}

body.theme-light .filter-inline label {
  color: var(--text-secondary);
}

/* Chart panel no tema claro */
body.theme-light .chart-panel {
  background: #FFFFFF;
}

body.theme-light .chart-canvas {
  background: #FAFBFC;
  border: 1px solid var(--border);
}

/* ================================================
   SUBSCRIPTION PAGE STYLES
   ================================================ */

/* Subscription Active Container */
.subscription-active-container {
  margin-top: 24px;
}

.subscription-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  border-radius: 16px;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 32px;
  animation: fadeInUp 0.6s ease;
}

.subscription-status-active {
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.2) 0%, rgba(16, 185, 129, 0.2) 100%);
  color: var(--success);
  border: 2px solid rgba(52, 211, 153, 0.4);
  box-shadow: 0 8px 24px rgba(52, 211, 153, 0.15);
}

.subscription-status-active svg {
  flex-shrink: 0;
}

/* Subscription Details Grid */
.subscription-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.subscription-info-card {
  background: linear-gradient(135deg, rgba(15, 20, 32, 0.6) 0%, rgba(20, 25, 40, 0.4) 100%);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(96, 165, 250, 0.15);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.3s ease;
}

.subscription-info-card:hover {
  transform: translateY(-4px);
  border-color: rgba(96, 165, 250, 0.3);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.info-card-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.info-card-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.info-card-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.subscription-actions {
  display: flex;
  justify-content: center;
  margin-top: 32px;
}

.subscription-actions .btn {
  font-size: 16px;
  padding: 14px 32px;
}

/* Trial Banner Large */
.trial-banner-large {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.15) 0%, rgba(245, 158, 11, 0.15) 100%);
  border: 2px solid rgba(251, 191, 36, 0.3);
  border-radius: 20px;
  padding: 32px;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 24px;
  box-shadow: 0 8px 24px rgba(251, 191, 36, 0.1);
  animation: fadeInUp 0.6s ease;
}

.trial-banner-icon {
  width: 72px;
  height: 72px;
  background: rgba(251, 191, 36, 0.2);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--warning);
  flex-shrink: 0;
}

.trial-banner-content h3 {
  font-size: 24px;
  font-weight: 700;
  color: var(--warning);
  margin-bottom: 8px;
}

.trial-banner-content p {
  font-size: 16px;
  color: var(--text);
  margin: 0;
  line-height: 1.6;
}

.trial-banner-content strong {
  color: var(--warning);
  font-weight: 700;
}

/* Pricing Container */
.pricing-container {
  max-width: 600px;
  margin: 0 auto 48px auto;
}

.pricing-card {
  background: linear-gradient(135deg, rgba(15, 20, 32, 0.8) 0%, rgba(20, 25, 40, 0.6) 100%);
  backdrop-filter: blur(24px);
  border: 2px solid rgba(96, 165, 250, 0.2);
  border-radius: 24px;
  padding: 40px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
  transition: all 0.4s ease;
}

.pricing-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.6), rgba(52, 211, 153, 0.6), transparent);
}

.pricing-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: rgba(96, 165, 250, 0.4);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(96, 165, 250, 0.3);
}

.pricing-card-featured {
  border-color: var(--primary);
}

.pricing-badge {
  position: absolute;
  top: 24px;
  right: 24px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: white;
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 16px rgba(96, 165, 250, 0.4);
}

.pricing-header {
  text-align: center;
  margin-bottom: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(96, 165, 250, 0.15);
}

.pricing-header h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
}

.pricing-price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  margin-bottom: 16px;
}

.pricing-currency {
  font-size: 24px;
  font-weight: 600;
  color: var(--muted);
}

.pricing-amount {
  font-size: 56px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.pricing-period {
  font-size: 18px;
  font-weight: 500;
  color: var(--muted);
}

.pricing-description {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.pricing-features {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
}

.pricing-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  color: var(--text);
  transition: all 0.2s ease;
  padding: 4px 0;
}

.pricing-feature:hover {
  transform: translateX(4px);
  color: var(--primary);
}

.pricing-feature svg {
  flex-shrink: 0;
  color: var(--success);
}

.pricing-action {
  text-align: center;
}

.btn-large {
  font-size: 18px !important;
  padding: 16px 40px !important;
  width: 100%;
  justify-content: center;
}

.pricing-guarantee {
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
}

/* FAQ Section */
.subscription-faq {
  max-width: 900px;
  margin: 48px auto 0 auto;
  padding-top: 48px;
  border-top: 1px solid rgba(96, 165, 250, 0.15);
}

.subscription-faq h3 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 32px;
  text-align: center;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.faq-item {
  background: linear-gradient(135deg, rgba(15, 20, 32, 0.5) 0%, rgba(20, 25, 40, 0.3) 100%);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(96, 165, 250, 0.1);
  border-radius: 16px;
  padding: 24px;
  transition: all 0.3s ease;
}

.faq-item:hover {
  transform: translateY(-4px);
  border-color: rgba(96, 165, 250, 0.3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.faq-item h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.faq-item p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .subscription-status-badge {
    font-size: 16px;
    padding: 14px 20px;
  }

  .subscription-details-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .trial-banner-large {
    flex-direction: column;
    text-align: center;
    padding: 24px;
  }

  .trial-banner-icon {
    width: 64px;
    height: 64px;
  }

  .trial-banner-content h3 {
    font-size: 20px;
  }

  .trial-banner-content p {
    font-size: 15px;
  }

  .pricing-card {
    padding: 28px;
  }

  .pricing-header h2 {
    font-size: 24px;
  }

  .pricing-amount {
    font-size: 48px;
  }

  .pricing-badge {
    top: 16px;
    right: 16px;
    font-size: 11px;
    padding: 6px 12px;
  }

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

  .subscription-faq h3 {
    font-size: 24px;
  }
}

/* Theme Light */
body.theme-light .subscription-status-active {
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.3);
}

body.theme-light .subscription-info-card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

body.theme-light .trial-banner-large {
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.2);
}

body.theme-light .pricing-card {
  background: #FFFFFF;
  border: 2px solid var(--primary);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

body.theme-light .faq-item {
  background: #F8F9FA;
  border: 1px solid var(--border);
}

/* ================================================
   UI ENHANCEMENTS - Loading, Toast, Validação
   ================================================ */

/* 1. LOADING STATES */

/* Global loading overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-content {
  text-align: center;
  color: white;
}

.loading-message {
  margin-top: 16px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
}

/* Spinners */
.spinner,
.spinner-small,
.spinner-medium,
.spinner-large {
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

.spinner,
.spinner-medium {
  width: 40px;
  height: 40px;
}

.spinner-small {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

.spinner-large {
  width: 60px;
  height: 60px;
  border-width: 4px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.loading-state {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

/* 2. TOAST NOTIFICATIONS */

.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
}

.toast {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 32px var(--shadow-lg);
  min-width: 300px;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.toast-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: bold;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}

.toast-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.toast-close:hover {
  background: var(--hover);
  color: var(--text);
}

/* Toast types */
.toast-success {
  border-left: 4px solid var(--success);
}

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

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

.toast-error .toast-icon {
  background: var(--danger);
  color: white;
}

.toast-warning {
  border-left: 4px solid var(--warning);
}

.toast-warning .toast-icon {
  background: var(--warning);
  color: #1f2937;
}

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

.toast-info .toast-icon {
  background: var(--primary);
  color: white;
}

/* Toast animations */
.toast-enter {
  transform: translateX(400px);
  opacity: 0;
}

.toast-exit {
  transform: translateX(400px);
  opacity: 0;
}

/* 3. FORM VALIDATION */

.input-valid {
  border-color: var(--success) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2334d399' viewBox='0 0 16 16'%3E%3Cpath d='M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

.input-error {
  border-color: var(--danger) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23f87171' viewBox='0 0 16 16'%3E%3Cpath d='M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z'/%3E%3Cpath d='M7.002 11a1 1 0 1 1 2 0 1 1 0 0 1-2 0zM7.1 4.995a.905.905 0 1 1 1.8 0l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 4.995z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

.field-error {
  color: var(--danger);
  font-size: 12px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  animation: shake 0.3s ease;
}

.field-error::before {
  content: '⚠';
  font-size: 14px;
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-4px);
  }

  75% {
    transform: translateX(4px);
  }
}

/* 4. ANIMATED COUNTERS */

[data-counter] {
  font-variant-numeric: tabular-nums;
  transition: color 0.3s ease;
}

[data-counter]:not([data-counted]) {
  opacity: 0.5;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .toast-container {
    right: 12px;
    left: 12px;
    max-width: none;
  }

  .toast {
    min-width: auto;
  }

  .loading-overlay .spinner-large {
    width: 48px;
    height: 48px;
  }
}

/* Event Pills Colors */
.event-pill {
  font-size: 11px;
  padding: 3px 6px;
  border-radius: 4px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff !important;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
}

.event-pill:hover {
  transform: scale(1.05);
  z-index: 10;
}

.event-color-1 {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border: 1px solid #1d4ed8;
}

/* Blue */
.event-color-2 {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: 1px solid #047857;
}

/* Green */
.event-color-3 {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border: 1px solid #b45309;
}

/* Amber */
.event-color-4 {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  border: 1px solid #6d28d9;
}

/* Purple */
.event-color-5 {
  background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
  border: 1px solid #be185d;
}

/* Pink */
/* ==========================================
   MELHORIAS GERAIS DE RESPONSIVIDADE MOBILE
   ========================================== */

@media (max-width: 768px) {
  /* Ajuste de padding geral */
  .container {
    padding: 16px 12px !important;
  }

  /* Ajuste de cabealhos */
  .header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .header-row h1 {
    font-size: 22px !important;
  }
  
  .header-row .toolbar {
    width: 100%;
    display: flex;
    justify-content: flex-start;
  }
  
  .header-row .toolbar .btn {
    width: 100%;
    justify-content: center;
  }

  /* Ajuste de cards de estatsticas */
  .stat-grid {
    grid-template-columns: 1fr 1fr !important; /* 2 colunas em vez de 1 para aproveitar espao */
    gap: 12px !important;
  }
  
  .card.stat {
    padding: 16px !important;
  }
  
  .card.stat .value {
    font-size: 24px !important;
  }

  /* Ajuste de acesso rpido */
  .quick-actions-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
  
  .quick-action-card {
    padding: 16px !important;
  }

  /* Modais em tela cheia */
  .modal-content {
    width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    border-radius: 0 !important;
    display: flex;
    flex-direction: column;
    padding: 20px !important;
  }
  
  .modal-header {
    flex-shrink: 0;
  }
  
  /* Ajuste de inputs */
  .input, .select, .textarea {
    font-size: 16px !important; /* Evita zoom no iOS */
    padding: 12px !important;
  }
}

@media (max-width: 480px) {
  /* Em telas muito pequenas, volta para 1 coluna */
  .stat-grid, .quick-actions-grid {
    grid-template-columns: 1fr !important;
  }
}


@media (max-width: 768px) {
  .topbar-inner {
    flex-wrap: wrap;
    gap: 12px;
  }
}


/* Mobile Toolbar Improvements */
@media (max-width: 768px) {
  .header-row {
    flex-direction: column;
    align-items: center; /* Center title */
    gap: 12px;
  }
  
  .header-row h1 {
    width: 100%;
    text-align: center;
    font-size: 1.25rem;
  }

  .header-row .toolbar {
    width: 100%;
    display: flex;
    flex-wrap: nowrap; /* Try to keep on one line if possible, or wrap if needed */
    justify-content: center;
    gap: 8px;
    overflow-x: auto; /* Allow scroll if very tight */
  }

  .header-row .toolbar .btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    min-width: 44px; /* Touch target size */
    height: 44px;
  }
  
  /* Adjust specific buttons if needed */
  .header-row .toolbar .btn.secondary {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
  }
}

