/* ─── VARIABLES & ROOT ─────────────────────────────────────────────────── */
:root {
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Slate/Zinc Palette for Premium Dark Mode */
  --bg-app: #080c16;
  --bg-card: rgba(15, 22, 40, 0.75);
  --bg-header: rgba(15, 22, 40, 0.9);
  --border-color: rgba(255, 255, 255, 0.05);
  --border-color-hover: rgba(255, 255, 255, 0.1);
  
  /* Text Colors */
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  /* Accents */
  --color-blue: #3b82f6;
  --color-blue-glow: rgba(59, 130, 246, 0.12);
  --color-emerald: #10b981;
  --color-emerald-glow: rgba(16, 185, 129, 0.12);
  --color-amber: #f59e0b;
  --color-amber-glow: rgba(245, 158, 11, 0.12);
  --color-purple: #8b5cf6;
  --color-purple-glow: rgba(139, 92, 246, 0.12);
  --color-rose: #f43f5e;
  --color-rose-glow: rgba(244, 63, 94, 0.12);

  /* Store Brands */
  --color-canoinhas: #06b6d4;
  --color-rio-negrinho: #a855f7;
  --color-sao-bento: #10b981;
  --color-mafra: #ef4444;
}

/* ─── BASE RESET ──────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  font-size: 13px; /* Reduced from 14px */
}

/* Custom Scrollbar */
.scrollbar::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
.scrollbar::-webkit-scrollbar-track {
  background: transparent;
}
.scrollbar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
}
.scrollbar::-webkit-scrollbar-thumb:hover {
  background: var(--color-blue);
}

/* ─── LAYOUT CONTAINER ─────────────────────────────────────────────────── */
.app-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0.85rem; /* Reduced from 1.5rem */
  display: flex;
  flex-direction: column;
  gap: 0.85rem; /* Reduced from 1.5rem */
}

/* ─── HEADER & FILTER PANEL ────────────────────────────────────────────── */
.app-header {
  background: var(--bg-header);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 0.85rem; /* Reduced from 1.25rem */
  padding: 1rem; /* Reduced from 1.5rem */
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.header-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.header-logo-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-icon {
  width: 2.25rem; /* Reduced from 3rem */
  height: 2.25rem;
  background: var(--color-blue-glow);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 0.5rem;
  color: var(--color-blue);
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-icon i {
  width: 1.15rem;
  height: 1.15rem;
}

h1 {
  font-size: 1.25rem; /* Reduced from 1.5rem */
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(to right, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  font-size: 0.75rem; /* Reduced from 0.85rem */
  color: var(--text-secondary);
}

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

.btn-sync {
  background: var(--color-blue);
  color: #ffffff;
  border: none;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem; /* Reduced padding */
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
  box-shadow: 0 3px 8px rgba(59, 130, 246, 0.2);
}

.btn-sync:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.btn-sync:active {
  transform: translateY(0);
}

.btn-sync i {
  width: 0.85rem;
  height: 0.85rem;
}

.btn-sync.spinning i {
  animation: spin 1s linear infinite;
}

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

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

/* ─── FILTERS ─────────────────────────────────────────────────────────── */
.filters-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  border-top: 1px solid var(--border-color);
  padding-top: 0.85rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex-grow: 1;
  min-width: 120px;
}

.filter-group label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.filter-group select {
  background: rgba(31, 41, 55, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 0.4rem;
  color: var(--text-primary);
  padding: 0.4rem 0.6rem;
  font-family: inherit;
  font-size: 0.8rem;
  outline: none;
  cursor: pointer;
  transition: all 0.12s ease;
}

.filter-group select:focus {
  border-color: var(--color-blue);
  box-shadow: 0 0 0 2px var(--color-blue-glow);
}

.filter-group select option {
  background: #111827;
  color: var(--text-primary);
}

.toggle-group {
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
  min-height: 2rem;
  min-width: 120px;
  flex-grow: 0;
}

.switch-container {
  position: relative;
  display: inline-block;
  width: 2.15rem;
  height: 1.15rem;
}

.switch-container input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #374151;
  transition: .2s;
  border-radius: 34px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 0.85rem;
  width: 0.85rem;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .2s;
  border-radius: 50%;
}

input:checked + .switch-slider {
  background-color: var(--color-emerald);
}

input:checked + .switch-slider:before {
  transform: translateX(1rem);
}

.toggle-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
}

/* ─── KPI CARDS ───────────────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.85rem;
  padding: 0.85rem; /* Reduced padding */
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.15s ease;
  backdrop-filter: blur(12px);
}

.kpi-card:hover {
  border-color: var(--border-color-hover);
  transform: translateY(-1px);
}

.kpi-icon-wrapper {
  width: 2.5rem; /* Reduced from 3.25rem */
  height: 2.5rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-icon-wrapper i {
  width: 1.15rem;
  height: 1.15rem;
}

.kpi-icon-wrapper.blue { background: var(--color-blue-glow); border: 1px solid rgba(59, 130, 246, 0.15); color: var(--color-blue); }
.kpi-icon-wrapper.emerald { background: var(--color-emerald-glow); border: 1px solid rgba(16, 185, 129, 0.15); color: var(--color-emerald); }
.kpi-icon-wrapper.amber { background: var(--color-amber-glow); border: 1px solid rgba(245, 158, 11, 0.15); color: var(--color-amber); }
.kpi-icon-wrapper.purple { background: var(--color-purple-glow); border: 1px solid rgba(139, 92, 246, 0.15); color: var(--color-purple); }
.kpi-icon-wrapper.rose { background: var(--color-rose-glow); border: 1px solid rgba(244, 63, 94, 0.15); color: var(--color-rose); }

.kpi-content {
  min-width: 0;
}

.kpi-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  display: block;
}

.kpi-value {
  font-size: 1.2rem; /* Reduced from 1.45rem */
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0.05rem 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kpi-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── CHARTS SECTION ──────────────────────────────────────────────────── */
.charts-section {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.85rem;
  padding: 1rem; /* Reduced padding */
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  backdrop-filter: blur(12px);
}

.card-half { grid-column: span 2; }
.card-donut { grid-column: span 1; }
.card-full { grid-column: span 3; }

.chart-header h3 {
  font-size: 0.95rem; /* Reduced */
  font-weight: 700;
  color: var(--text-primary);
}

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

.chart-wrapper {
  position: relative;
  height: 200px; /* Reduced from 280px */
  width: 100%;
}

.donut-container {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ─── RANKINGS SECTION ────────────────────────────────────────────────── */
.rankings-section {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.tabs-nav {
  display: flex;
  background: rgba(31, 41, 55, 0.3);
  border: 1px solid var(--border-color);
  border-radius: 0.6rem;
  padding: 0.2rem;
  width: fit-content;
}

.tab-btn {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  border-radius: 0.45rem;
  padding: 0.45rem 1rem; /* Reduced padding */
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.12s ease;
}

.tab-btn i {
  width: 0.85rem;
  height: 0.85rem;
}

.tab-btn.active {
  background: var(--bg-card);
  color: var(--color-blue);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Store ranking cards grid */
.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.85rem;
}

.store-ranking-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.85rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 380px; /* Reduced from 480px */
  backdrop-filter: blur(12px);
}

.store-card-header {
  padding: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #ffffff;
}

.store-card-header h4 {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.store-total {
  font-size: 0.85rem;
  font-weight: 700;
  opacity: 0.95;
}

.bg-canoinhas {
  background: linear-gradient(135deg, var(--color-canoinhas), #0891b2);
  box-shadow: 0 2px 10px rgba(6, 182, 212, 0.15);
}
.bg-rio-negrinho {
  background: linear-gradient(135deg, var(--color-rio-negrinho), #7e22ce);
  box-shadow: 0 2px 10px rgba(168, 85, 247, 0.15);
}
.bg-sao-bento {
  background: linear-gradient(135deg, var(--color-sao-bento), #047857);
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.15);
}
.bg-mafra {
  background: linear-gradient(135deg, var(--color-mafra), #b91c1c);
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.15);
}

.store-card-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem; /* Reduced gap */
}

/* Seller List Item style */
.seller-item {
  display: flex;
  align-items: center;
  padding: 0.6rem 0.75rem;
  border-radius: 0.5rem;
  background: rgba(31, 41, 55, 0.25);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.12s ease;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  min-height: 48px;
}

.seller-item:hover {
  background: rgba(31, 41, 55, 0.45);
  border-color: var(--border-color-hover);
  transform: translateX(2px);
}

.medal-badge {
  font-size: 1rem;
  margin-right: 0.5rem;
  width: 1.25rem;
  display: flex;
  justify-content: center;
}

.rank-number {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  width: 1.25rem;
  margin-right: 0.5rem;
  text-align: center;
}

.seller-item-info {
  flex-grow: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  line-height: 1.35;
}

.seller-item-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.seller-item-val {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  line-height: 1.2;
}

.seller-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--color-blue);
  opacity: 0.8;
  transition: width 0.3s ease-out;
}

/* ─── GLOBAL RANKING TABLE ────────────────────────────────────────────── */
.table-card {
  border: 1px solid var(--border-color);
  border-radius: 0.85rem;
  overflow: hidden;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.global-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.8rem;
}

.global-table th, .global-table td {
  padding: 0.65rem 0.85rem; /* Reduced padding */
  border-bottom: 1px solid var(--border-color);
}

.global-table th {
  background: rgba(31, 41, 55, 0.3);
  color: var(--text-secondary);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  user-select: none;
}

.global-table tbody tr {
  cursor: pointer;
  transition: background 0.12s ease;
}

.global-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.015);
}

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

.col-rank { width: 50px; }
.col-name { font-weight: 600; }
.col-store { width: 130px; }
.col-role { width: 130px; }
.col-revenue { width: 150px; font-weight: 700; }
.col-performance { width: 220px; }

/* Badges */
.badge-store {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 0.4rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #ffffff;
}

.badge-store.canoinhas { background: rgba(6, 182, 212, 0.1); border: 1px solid rgba(6, 182, 212, 0.2); color: var(--color-canoinhas); }
.badge-store.rio-negrinho { background: rgba(168, 85, 247, 0.1); border: 1px solid rgba(168, 85, 247, 0.2); color: var(--color-rio-negrinho); }
.badge-store.sao-bento { background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.2); color: var(--color-sao-bento); }
.badge-store.mafra { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.2); color: var(--color-mafra); }

.badge-role {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  border-radius: 0.3rem;
  font-size: 0.65rem;
  font-weight: 600;
  background: rgba(75, 85, 99, 0.15);
  border: 1px solid rgba(75, 85, 99, 0.25);
  color: var(--text-secondary);
}

.badge-role.GESTOR { background: var(--color-purple-glow); border-color: rgba(139, 92, 246, 0.2); color: var(--color-purple); }
.badge-role.LIDER { background: var(--color-amber-glow); border-color: rgba(245, 158, 11, 0.2); color: var(--color-amber); }

.badge-status {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  border-radius: 0.3rem;
  font-size: 0.65rem;
  font-weight: 700;
}
.badge-status.ATIVO { background: var(--color-emerald-glow); border: 1px solid rgba(16, 185, 129, 0.2); color: var(--color-emerald); }
.badge-status.INATIVO { background: var(--color-rose-glow); border: 1px solid rgba(244, 63, 94, 0.2); color: var(--color-rose); }

/* Table progress bar */
.table-perf-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.table-perf-bg {
  flex-grow: 1;
  height: 5px;
  background: rgba(55, 65, 81, 0.4);
  border-radius: 6px;
  overflow: hidden;
}

.table-perf-fill {
  height: 100%;
  background: linear-gradient(to right, var(--color-blue), #60a5fa);
  border-radius: 6px;
  transition: width 0.4s ease-out;
}

.table-perf-pct {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  width: 2rem;
  text-align: right;
  flex-shrink: 0;
}

.text-right { text-align: right; }
.text-center { text-align: center; }

/* ─── MODAL DIALOG ────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

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

.modal-container {
  background: #090d16;
  border: 1px solid var(--border-color-hover);
  border-radius: 1rem;
  width: 100%;
  max-width: 760px; /* Reduced from 820px */
  max-height: 92vh;
  overflow-y: auto;
  padding: 1.25rem; /* Reduced padding */
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.modal-profile-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.modal-avatar {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.65rem;
  background: var(--color-blue-glow);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: var(--color-blue);
  font-size: 1.25rem;
  font-weight: 850;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-badges {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.12s ease;
}

.modal-close-btn:hover { color: #ffffff; }

/* Modal KPIs */
.modal-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.modal-kpi-card {
  background: rgba(31, 41, 55, 0.35);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 0.75rem;
  text-align: center;
}

.modal-kpi-title {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 0.15rem;
}

.modal-kpi-card h3 {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.text-white { color: #ffffff !important; }

/* Modal Charts */
.modal-charts {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 0.85rem;
}

.modal-chart-card {
  background: rgba(31, 41, 55, 0.15);
  border: 1px solid var(--border-color);
  border-radius: 0.85rem;
  padding: 0.6rem 0.75rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.modal-chart-card h4 {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-chart-wrapper {
  position: relative;
  height: 155px;
  width: 100%;
}

/* Modal Table */
.modal-history-card {
  background: rgba(31, 41, 55, 0.15);
  border: 1px solid var(--border-color);
  border-radius: 0.85rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.modal-history-card h4 { font-size: 0.85rem; font-weight: 700; }
.max-h-60 { max-height: 12rem; }

.modal-history-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.78rem;
}

.modal-history-table th, .modal-history-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-history-table th {
  background: rgba(31, 41, 55, 0.35);
  color: var(--text-secondary);
  font-weight: 700;
}

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

/* ─── ANIMATIONS ──────────────────────────────────────────────────────── */
.animate-fade-in {
  animation: fadeIn 0.15s ease-out forwards;
}

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

/* ─── RESPONSIVE DESIGN ───────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .charts-section { grid-template-columns: 1fr; }
  .card-half, .card-donut, .card-full { grid-column: span 1; }
  .modal-charts { grid-template-columns: 1fr; }
}

/* ─── TOUCH TARGETS & NATIVE FEEL ───────────────────────────────────────── */
@media (max-width: 640px) {
  /* Increase tap target sizes for iOS/Android */
  .filter-group select, 
  .btn-sync, 
  .tab-btn {
    min-height: 44px;
    font-size: 0.85rem;
  }

  .app-container { padding: 0.5rem; gap: 0.5rem; }
  .app-header { padding: 0.75rem; }
  .header-main { flex-direction: column; align-items: flex-start; }
  .header-actions { width: 100%; justify-content: space-between; }
  
  /* Horizontal scrollable filters for native app feel */
  .filters-panel { 
    flex-wrap: nowrap; 
    overflow-x: auto; 
    -webkit-overflow-scrolling: touch; 
    padding-bottom: 0.5rem;
    gap: 0.85rem;
  }
  /* Hide scrollbar for a cleaner look */
  .filters-panel::-webkit-scrollbar { display: none; }
  .filter-group { min-width: 130px; flex-shrink: 0; }
  .toggle-group { min-width: 120px; flex-shrink: 0; margin-top: 0; }
  
  .kpi-grid { grid-template-columns: 1fr; }
  .modal-kpis { grid-template-columns: 1fr; gap: 0.4rem; }
  
  /* Full screen modal on mobile */
  .modal-overlay { padding: 0; }
  .modal-container { 
    padding: 1rem; 
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
    border: none;
  }
  
  /* Horizontal scroll for global table */
  .table-responsive {
    -webkit-overflow-scrolling: touch;
  }
}

