/* ============================================
   CRM Limpa Nome — Design System
   Dark theme, modern, professional
   ============================================ */

/* === CSS Variables === */
:root {
  /* Colors */
  --bg-primary: #0f1117;
  --bg-secondary: #1a1d27;
  --bg-card: #21242f;
  --bg-hover: #2a2d3a;
  --bg-input: #181b24;
  --border: #2e3142;
  --border-focus: #6366f1;

  /* Text */
  --text-primary: #e8eaf0;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --text-heading: #f1f3f9;

  /* Accent Colors */
  --accent-primary: #6366f1;
  --accent-primary-hover: #818cf8;
  --accent-success: #10b981;
  --accent-success-hover: #34d399;
  --accent-warning: #f59e0b;
  --accent-warning-hover: #fbbf24;
  --accent-danger: #ef4444;
  --accent-danger-hover: #f87171;
  --accent-info: #3b82f6;
  --accent-info-hover: #60a5fa;
  --accent-secondary-color: #8b5cf6;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);

  /* Sizing */
  --sidebar-width: 260px;
  --sidebar-collapsed: 70px;
  --header-height: 60px;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);

  /* Transitions */
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-left: var(--sidebar-width);
  transition: var(--transition-slow);
  min-width: 0;
}

/* === Sidebar === */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: var(--transition-slow);
  z-index: 100;
  overflow: hidden;
}

.sidebar--collapsed {
  width: var(--sidebar-collapsed);
}

.sidebar--collapsed ~ .main {
  margin-left: var(--sidebar-collapsed);
}

.sidebar__header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar__logo {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.logo-icon {
  font-size: 1.8rem;
  min-width: 30px;
  text-align: center;
}

.logo-text {
  font-size: 1.1rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar__nav {
  flex: 1;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
  font-weight: 500;
  position: relative;
}

.sidebar__link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar__link.active {
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
}

.sidebar__link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 24px;
  background: var(--gradient-primary);
  border-radius: 0 4px 4px 0;
}

.sidebar__icon {
  font-size: 1.2rem;
  min-width: 24px;
  text-align: center;
}

.sidebar__footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.sidebar__version {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* === Header === */
.header {
  height: var(--header-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
}

.header__toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.header__toggle:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.header__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-heading);
}

.header__spacer {
  flex: 1;
}

/* === Content === */
.content {
  flex: 1;
  padding: 28px;
  animation: fadeIn 0.3s ease;
}

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

/* === Page Header === */
.page-header {
  margin-bottom: 28px;
}

.page-title {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 4px;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* === Page Toolbar === */
.page-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.toolbar-search {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  flex: 1;
  max-width: 500px;
}

.toolbar-filters {
  max-width: 700px;
}

.search-input {
  padding-left: 12px !important;
  min-width: 250px;
}

.search-icon {
  position: absolute;
  right: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

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

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}
.btn-primary:hover {
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.5);
  transform: translateY(-1px);
}

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

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

.btn-danger {
  color: var(--accent-danger);
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 6px 8px;
}
.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

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

/* === Forms === */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.required {
  color: var(--accent-danger);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  transition: var(--transition);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

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

.form-select {
  cursor: pointer;
  appearance: auto;
}

.form-select--sm {
  width: auto;
  min-width: 160px;
}

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

.form-row {
  margin-bottom: 16px;
}

.form-row--2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* === Data Tables === */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.data-table thead {
  background: var(--bg-secondary);
}

.data-table th:first-child {
  border-top-left-radius: var(--radius);
}

.data-table th:last-child {
  border-top-right-radius: var(--radius);
}

.data-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: var(--radius);
}

.data-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: var(--radius);
}

.data-table th {
  padding: 14px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  vertical-align: middle;
}

.data-table tbody tr {
  transition: var(--transition);
}

.data-table tbody tr:hover {
  background: var(--bg-hover);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table--compact td,
.data-table--compact th {
  padding: 8px 12px;
  font-size: 0.82rem;
}

.text-right { text-align: right; }
.text-mono { font-family: 'SF Mono', Monaco, monospace; font-size: 0.83rem; }
.text-success { color: var(--accent-success) !important; }
.text-warning { color: var(--accent-warning) !important; }
.text-primary { color: var(--accent-primary) !important; }
.text-danger { color: var(--accent-danger) !important; }
.text-muted { color: var(--text-muted); }
.text-truncate { max-width: 200px; display: inline-block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.actions-cell {
  display: flex;
  gap: 4px;
  align-items: center;
}

.action-group {
  position: relative;
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.totals-row {
  background: var(--bg-secondary) !important;
}

.row-success {
  background: rgba(16, 185, 129, 0.05);
}
.row-danger {
  background: rgba(239, 68, 68, 0.05);
}

/* === Badges === */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.badge-primary { background: rgba(99,102,241,0.15); color: var(--accent-primary); }
.badge-success { background: rgba(16,185,129,0.15); color: var(--accent-success); }
.badge-warning { background: rgba(245,158,11,0.15); color: var(--accent-warning); }
.badge-danger { background: rgba(239,68,68,0.15); color: var(--accent-danger); }
.badge-info { background: rgba(59,130,246,0.15); color: var(--accent-info); }
.badge-secondary { background: rgba(139,92,246,0.15); color: var(--accent-secondary-color); }
.badge-default { background: var(--bg-hover); color: var(--text-secondary); }

/* === Dashboard Cards === */
.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.summary-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--border);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.summary-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
}

.summary-card--blue::before { background: var(--gradient-primary); }
.summary-card--green::before { background: var(--gradient-success); }
.summary-card--yellow::before { background: var(--gradient-warning); }
.summary-card--purple::before { background: linear-gradient(135deg, #8b5cf6, #a78bfa); }

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

.summary-card__icon {
  font-size: 2.2rem;
  min-width: 48px;
  text-align: center;
}

.summary-card__content {
  display: flex;
  flex-direction: column;
}

.summary-card__value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1.2;
}

.summary-card__title {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* === Charts (Status Bars) === */
.dashboard-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 20px;
}

.chart-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
}

.chart-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text-heading);
}

.status-bars {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.status-bar-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-bar-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 140px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-bar-track {
  flex: 1;
  height: 8px;
  background: var(--bg-input);
  border-radius: 4px;
  overflow: hidden;
}

.status-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 2px;
}

.status-bar-count {
  font-size: 0.85rem;
  font-weight: 700;
  min-width: 30px;
  text-align: right;
  color: var(--text-primary);
}

/* === Modal === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
}

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

.modal-container {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.2s ease;
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-heading);
}

.modal-close {
  font-size: 1.2rem;
}

.modal-body {
  padding: 24px;
}

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

/* === Status Dropdown === */
.dropdown-status {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  z-index: 150;
  padding: 4px;
  animation: fadeIn 0.15s ease;
}

.dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 14px;
  background: none;
  border: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.dropdown-item:hover {
  background: var(--bg-hover);
}

.dropdown-item.active {
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-primary);
  font-weight: 600;
}

/* === Historico === */
.historico-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.historico-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.historico-date {
  color: var(--text-muted);
  font-size: 0.78rem;
  min-width: 130px;
}

.historico-change {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* === Detail Grid === */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.detail-value {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-heading);
}

/* === Section === */
.section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 14px;
}

/* === Config Section === */
.config-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 24px;
}

.config-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 24px;
}

.config-section__title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-heading);
}

.config-add-form {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.config-add-form .form-input {
  flex: 1;
}

.config-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.config-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.config-item:hover {
  background: var(--bg-hover);
}

.config-item__name {
  font-weight: 500;
}

/* === Filter Panel (Reports) === */
.filters-panel {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 24px;
  margin-bottom: 24px;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.filters-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* === Relatorio Summary === */
.relatorio-summary {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.relatorio-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.relatorio-stat .label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.relatorio-stat .value {
  font-size: 1.1rem;
  font-weight: 700;
}

.table-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  justify-content: flex-end;
}

/* === Pagination === */
.pagination {
  display: flex;
  gap: 4px;
  justify-content: center;
  padding: 16px 0;
}

.pagination__btn {
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.pagination__btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.pagination__btn.active {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

/* === Loading / Spinner === */
.loading-state {
  text-align: center;
  padding: 48px;
  color: var(--text-muted);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

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

/* === Toast === */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--accent-success);
  color: white;
  padding: 14px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: var(--shadow-lg);
  z-index: 300;
  animation: slideUp 0.3s ease;
}

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

/* === Alert === */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-size: 0.88rem;
  font-weight: 500;
}

.alert-error {
  background: rgba(239, 68, 68, 0.12);
  color: var(--accent-danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-success {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

/* === HTMX indicator === */
.htmx-request .spinner,
.htmx-request.spinner {
  display: inline-block;
}

.htmx-indicator {
  display: none;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  display: inline-block;
}

/* === Print === */
@media print {
  .sidebar, .header, .page-toolbar, .filters-panel, .modal-overlay, .toast, .btn, .table-actions {
    display: none !important;
  }
  .main {
    margin-left: 0 !important;
  }
  .content {
    padding: 0 !important;
  }
  .data-table {
    box-shadow: none;
    border: 1px solid #ddd;
  }
  body {
    background: white;
    color: black;
  }
  .data-table th, .data-table td {
    border: 1px solid #ddd;
    color: black;
  }
}

/* === Responsive === */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width);
  }

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

  .main {
    margin-left: 0 !important;
  }

  .content {
    padding: 16px;
  }

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

  .toolbar-search {
    max-width: 100%;
  }

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

  .summary-card {
    padding: 16px;
  }

  .summary-card__value {
    font-size: 1.2rem;
  }

  .dashboard-charts {
    grid-template-columns: 1fr;
  }

  .data-table {
    font-size: 0.82rem;
    display: block;
    overflow-x: auto;
  }

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

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

  .config-sections {
    grid-template-columns: 1fr;
  }

  .modal-container {
    max-height: 95vh;
    border-radius: var(--radius);
  }

  .relatorio-summary {
    flex-direction: column;
    gap: 12px;
  }
}

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