/* styles.css - visual clean e mobile-first */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-body: #f3f4f6;
  --bg-card: #ffffff;
  --bg-muted: #f9fafb;
  --border-subtle: #e5e7eb;
  --text-main: #111827;
  --text-muted: #6b7280;
  --accent: #2563eb;
  --accent-soft: #dbeafe;
  --secondary: #f59e0b;
  --secondary-soft: #fef3c7;
  --danger: #b91c1c;
  --success: #16a34a;
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.08);
  --radius-lg: 18px;
  --z-header: 40;
  --z-popover: 900;
  --z-overlay: 1500;
  --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.18);
  --disabled-opacity: 0.55;
  --transition-fast: 120ms ease;
}

html {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  touch-action: pan-y;
  overscroll-behavior-x: none;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  background: radial-gradient(circle at top left, #e0f2fe 0, transparent 50%),
              radial-gradient(circle at bottom right, #e5e7eb 0, transparent 55%),
              var(--bg-body);
  color: var(--text-main);
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  font-size: 15px;
  overflow-x: hidden;
  touch-action: pan-y;
  overscroll-behavior: none;
}
body.menu-open { overflow: hidden; }

.app-shell {
  max-width: none;
  width: 100%;
  max-width: 100vw;
  margin: 0 auto;
  padding: 0 12px 24px;
  overflow-x: hidden;
}

/* HEADER */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(37,99,235,0.08), rgba(245,158,11,0.06)), rgba(255,255,255,.96);
  border-radius: 999px;
  box-shadow: 0 18px 45px rgba(15,23,42,.12);
  backdrop-filter: blur(18px);
  margin-bottom: 18px;
  position: relative;
  z-index: var(--z-header);
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  height: 34px;
  object-fit: contain;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-subtitle {
  font-size: 11px;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Context menu */
.context-menu-wrap { position: relative; }
.context-btn {
  background: #0f172a;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
}
.context-btn:hover { background: #1f2937; }
.context-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.context-menu {
  position: absolute;
  top: 110%;
  right: 0;
  min-width: 200px;
  background: #fff;
  border: 1px solid rgba(15,23,42,0.12);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.15);
  padding: 0;
  display: none;
  z-index: 60;
}
.context-menu-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.4);
  backdrop-filter: blur(2px);
  z-index: 59;
}
.context-menu.open { display: block; }
.context-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(37,99,235,0.12), rgba(245,158,11,0.10));
  border-bottom: 1px solid rgba(15,23,42,0.08);
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}
.context-brand { display: flex; align-items: center; gap: 10px; }
.context-brand img { height: 34px; width: auto; }
.context-brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.context-brand-text strong { color: #0f172a; font-size: 14px; }
.context-brand-text span { color: #475569; font-size: 12px; }
.context-close {
  display: none;
  background: #0f172a;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 700;
  width: auto;
  min-width: 80px;
}
.context-menu-body { padding: 10px 12px 12px 12px; }
.context-menu ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.context-menu li { position: relative; }
.context-menu button {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 12px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  color: #0f172a;
}
.context-menu button:hover { background: rgba(37,99,235,0.12); }
.context-menu .has-submenu > span {
  display: block;
  padding: 12px 12px 8px 12px;
  font-weight: 800;
  font-size: 14px;
  color: #0f172a;
}
.context-menu .submenu {
  margin: 6px 0 0 0;
  padding: 8px 10px;
  border-left: none;
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: 10px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.context-menu .has-submenu {
  border: 1px solid rgba(15,23,42,0.12);
  border-radius: 12px;
  padding: 8px 10px 10px 10px;
  background: #fff;
}
.context-menu .has-submenu > span { margin-bottom: 2px; }
.context-menu i { margin-right: 8px; color: #2563eb; }

.context-menu-mobile,
.context-menu-backdrop-mobile {
  display: none;
}

.mobile-context-bar { display: none; }
.mobile-context-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.mobile-context-btn .hamburger-icon {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
}
.mobile-context-btn .hamburger-icon span {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
}

@media (max-width: 768px) {
  .context-menu-desktop { display: none !important; }
  .context-menu-backdrop-mobile.visible { display: block; position: fixed; inset: 0; background: rgba(15,23,42,0.4); backdrop-filter: blur(2px); z-index: calc(var(--z-overlay) - 1); }
  .context-menu-mobile {
    display: none;
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    border-radius: 0;
    box-shadow: 0 18px 45px rgba(0,0,0,0.25);
    border: none;
    padding: 18px;
    overflow-y: auto;
    z-index: var(--z-overlay);
    background: #fff;
  }
  .context-menu-mobile.open { display: block; }

  .context-menu {
    position: fixed !important;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    border-radius: 0;
    box-shadow: 0 18px 45px rgba(0,0,0,0.25);
    border: none;
    padding: 18px;
    overflow-y: auto;
    z-index: var(--z-overlay);
    transform: translateY(-110%);
    transition: transform 150ms ease;
  }
  .context-menu.open { transform: translateY(0); }
  .context-menu-backdrop.visible { display: block; }
  .context-close { display: block; }
  .context-menu .submenu {
    border-left: none;
    padding-left: 0;
  }
  .context-menu button,
  .context-menu .has-submenu > span {
    font-size: 16px;
    padding-left: 14px;
    padding-right: 14px;
  }
  .context-menu .has-submenu {
    padding: 10px 12px 12px 12px;
    gap: 6px;
  }
  .context-menu .submenu {
    padding: 10px 12px;
  }
}

/* PERÍODO */
.period-wrapper { position: relative; }

.period-button {
  border: 1px solid rgba(148, 163, 184, 0.9);
  background: #ffffff;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 12px;
  color: var(--text-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.08s ease;
}

.period-button:focus-visible,
.merchant-button:focus-visible,
.logout-btn:focus-visible,
.install-btn:focus-visible,
.auth-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.period-button:disabled,
.merchant-button:disabled,
.logout-btn:disabled,
.install-btn:disabled,
.auth-btn:disabled {
  opacity: var(--disabled-opacity);
  cursor: not-allowed;
}

.period-button,
.merchant-button,
.logout-btn,
.install-btn,
.auth-btn {
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.period-button::after {
  content: '▾';
  font-size: 24px;
  line-height: 1;
  margin-left: 8px;
  display: inline-block;
}

.period-button:hover {
  background: #f3f4f6;
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
}

/* backdrop global */
.period-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.42);
  backdrop-filter: blur(3px);
  z-index: var(--z-popover);
}

/* popover desktop */
.period-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 55px rgba(15,23,42,.22);
  border: 1px solid rgba(148,163,184,.4);
  padding: 10px;
  z-index: calc(var(--z-popover) + 1);
  min-width: 420px;
  max-height: 420px;
  overflow-y: auto;
  display: none;
}

.period-popover.open { display:block; }

.period-popover-header { display:none; }

.period-popover-inner {
  display:grid;
  grid-template-columns:1.2fr 1.8fr;
  gap:12px;
}

/* presets */
.period-presets {
  display:flex;
  flex-direction:column;
  gap:6px;
  font-size:12px;
}

.period-presets strong {
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.06em;
  color:var(--text-muted);
  margin-bottom:4px;
}

.preset-btn {
  border-radius:999px;
  border:1px solid var(--border-subtle);
  background:var(--bg-muted);
  padding:8px 12px;
  font-size:13px;
  text-align:left;
  cursor:pointer;
}

.preset-btn:hover { background:#e5e7eb; }
.preset-btn.active {
  background:var(--accent-soft);
  border-color:var(--accent);
  color:var(--accent);
}

/* custom range */
.period-custom {
  border-radius:14px;
  background:var(--bg-muted);
  padding:8px 10px;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.period-custom-header strong { font-size:12px; }
.period-custom-header span { font-size:11px; color:var(--text-muted); }

.period-custom-fields {
  display:grid;
  grid-template-columns:1fr;
  gap:8px;
  margin-top:4px;
}

.period-custom-fields label {
  display:flex;
  flex-direction:column;
  gap:2px;
  font-size:11px;
  color:var(--text-muted);
}

.period-custom-fields input[type=text] {
  border-radius:999px;
  border:1px solid var(--border-subtle);
  padding:8px 12px;
  font-size:14px;
  outline:none;
}

.period-custom-actions {
  display:flex;
  justify-content:flex-end;
  margin-top:4px;
}

.apply-btn {
  border-radius:999px;
  border:none;
  background:var(--accent);
  color:#fff;
  font-size:13px;
  padding:8px 16px;
  cursor:pointer;
}

.apply-btn:hover { background:#1d4ed8; }

.last-update {
  font-size:11px;
  color:var(--text-muted);
  padding:4px 8px;
  border-radius:999px;
  background:rgba(15,23,42,.03);
}

.refresh-button {
  border:none;
  border-radius:999px;
  padding:8px 18px;
  background:var(--accent);
  color:#fff;
  font-size:13px;
  font-weight:500;
  cursor:pointer;
  box-shadow:0 12px 30px rgba(37,99,235,.55);
}

/* MAIN */
.app-main {
  display:flex;
  flex-direction:column;
  gap:20px;
}

.section {
  margin-bottom: 28px;
  display:flex;
  flex-direction:column;
  gap:14px;
}

.section-title {
  font-size:15px;
  font-weight:600;
  letter-spacing:.03em;
  text-transform:uppercase;
  color:var(--text-muted);
}

.grid { display:grid; gap:14px; }
.grid-2 { grid-template-columns:repeat(2,minmax(0,1fr)); }
.grid-3 { grid-template-columns:repeat(3,minmax(0,1fr)); }
.grid-4 { grid-template-columns:repeat(4,minmax(0,1fr)); }


.grid-1 { grid-template-columns:1fr; }
.hourly-stack { grid-template-columns: 1fr; }
.grid-5 { grid-template-columns:repeat(5,minmax(0,1fr)); }

/* KPIs responsivos */
.kpi-grid-main,
.kpi-grid-efficiency {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

@media (max-width: 1600px) {
  .kpi-grid-main,
  .kpi-grid-efficiency {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1920px) {
  .kpi-grid-main,
  .kpi-grid-efficiency {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .kpi-grid-main,
  .kpi-grid-efficiency {
    grid-template-columns: 1fr;
  }
}

.section .grid,
.card .grid {
  width: 100%;
  max-width: 100%;
}

/* Produto - meta extra */
.list-submeta { font-size:11px; color:var(--text-muted); margin-top:2px; }

/* cards / kpis */
.card {
  background:var(--bg-card);
  border-radius:var(--radius-lg);
  border:1px solid rgba(148,163,184,.28);
  box-shadow:var(--shadow-soft);
  padding:12px 14px 14px;
  display:flex;
  flex-direction:column;
  gap:8px;
  overflow-x: hidden;
}

.kpi-card { position:relative; overflow:hidden; display:flex; flex-direction:column; gap:6px; }
.kpi-card::after {
  content:'';
  position:absolute;
  inset:auto -20%;
  bottom:-30px;
  height:40px;
  background:radial-gradient(circle at center, rgba(37,99,235,.12), transparent 60%);
}

.kpi-card.icon-card { flex-direction: row; align-items: center; gap: 12px; }
.kpi-card.icon-card .kpi-card-body { display: flex; flex-direction: column; gap: 4px; }

.kpi-icon-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size:44px;
  line-height:1;
  flex-shrink:0;
}
.kpi-label {
  font-size:13px;
  color:var(--text-muted);
  margin-bottom:4px;
}
.kpi-title-row{
  display:flex;
  align-items:center;
  gap:6px;
}
.kpi-icon{
  color: var(--accent);
  font-size:16px;
  line-height:1;
}

.kpi-value {
  font-size:22px;
  font-weight:600;
  letter-spacing:.01em;
}
.kpi-subtext{
  font-size:11px;
  color:var(--text-muted);
  margin-top:-2px;
}
.kpi-warning{
  color: var(--danger);
  font-weight: 700;
  margin-right: 4px;
}

.kpi-negative { color:var(--danger); }

.kpi-footer {
  font-size:11px;
  color:var(--text-muted);
}
.kpi-compare{
  display:flex;
  flex-direction:column;
  gap:4px;
  font-size:11px;
  color:var(--text-main);
}
.kpi-trend{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-weight:700;
}
.kpi-trend i{
  font-size:12px;
  line-height:1;
}
.kpi-trend.positive{
  color: var(--success);
}
.kpi-trend.negative{
  color: var(--danger);
}
.kpi-compare-row{
  display:grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items:center;
  gap:8px;
}
.kpi-compare-label{
  font-weight:600;
  color: var(--text-muted);
}
.kpi-compare-amount{
  text-align:center;
  color: var(--text-muted);
  font-weight:600;
}
.kpi-compare-row .kpi-trend{
  justify-content:flex-end;
}

/* kpi carousel */
.kpi-carousel-wrapper { position:static; }
.kpi-carousel-wrapper::after,
.kpi-carousel-wrapper::before { content:none; }

.kpi-nav-btn {
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  width:34px;
  height:34px;
  border-radius:999px;
  border:none;
  display:none;
  align-items:center;
  justify-content:center;
  font-size:20px;
  font-weight:600;
  cursor:pointer;
  background:linear-gradient(135deg,#2563eb,#3b82f6);
  color:#fff;
  box-shadow:0 10px 25px rgba(37,99,235,.45);
  z-index:2;
}

.kpi-nav-left { left:4px; }
.kpi-nav-right{ right:4px; }

/* charts / tables */
.card-header { display:flex; flex-direction:column; gap:2px; }
.card-title { font-weight:600; font-size:14px; }
.card-subtitle { font-size:12px; color:var(--text-muted); }

.chart-wrapper {
  position:relative;
  min-height:300px;
  width:100%;
  overflow:hidden;
}
.chart-wrapper canvas {
  display:block;
  width:100% !important;
  max-width:100%;
  height:auto !important;
}
.payments-layout {
  display: grid;
  width: 100%;
  max-width: 100%;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  gap: 12px;
}
.payments-chart {
  width: 100%;
  max-width: 100%;
  min-height: 280px;
}
.payments-chart canvas {
  height: 280px !important;
}
#paymentsTable {
  min-width: 320px;
  max-width: 100%;
  font-size: 11px;
}
#paymentsTable th,
#paymentsTable td {
  padding: 6px 6px;
}

.list { list-style:none; }
.list-products { display:grid; grid-template-columns:1fr; gap:10px; }

.list-item-product {
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:8px 10px;
  border-radius:999px;
  background:var(--bg-muted);
  border:1px solid rgba(209,213,219,.8);
}

.list-left { display:flex; flex-direction:column; gap:2px; }
.list-title-row { display:flex; align-items:center; gap:6px; }
.list-title { font-size:13px; font-weight:700; color: var(--text-main); }
.list-subtitle { font-size:11px; color:var(--text-muted); }

.list-right { display:flex; align-items:center; gap:8px; }
.list-value { font-size:13px; font-weight:500; }
.list-pill {
  font-size:11px;
  padding:2px 8px;
  border-radius:999px;
  background:var(--accent-soft);
  color:var(--accent);
}
.list-pill.trophy-1{ background: rgba(251,191,36,0.16); color: #b45309; }
.list-pill.trophy-2{ background: rgba(148,163,184,0.16); color: #475569; }
.list-pill.trophy-3{ background: rgba(180,83,9,0.16); color: #b45309; }
.list-pill.trophy-4{ background: rgba(5,150,105,0.16); color: #0f766e; }
.list-pill.trophy-5{ background: rgba(37,99,235,0.16); color: #1d4ed8; }


.pagination {
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  margin-top:8px;
  font-size:11px;
  color:var(--text-muted);
}

.pagination-small {
  font-size:11px;
}

.page-btn {
  border:1px solid var(--border-subtle);
  border-radius:999px;
  padding:4px 10px;
  background:#fff;
  cursor:pointer;
  font-size:11px;
}

.page-btn:disabled {
  opacity:0.5;
  cursor:default;
}

.page-info {
  white-space:nowrap;
}

.page-size-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.page-size-selector select {
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-muted);
  font-size: 12px;
  outline: none;
  cursor: pointer;
}

.page-size-selector select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(37,99,235,0.15);
}

/* Export buttons */
.export-buttons {
  display: flex;
  gap: 6px;
}
.export-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-muted);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}
.export-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.export-btn i {
  font-size: 12px;
}

/* Sortable table headers */
.table th.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 20px;
}

.table th.sortable:hover {
  background: rgba(37, 99, 235, 0.08);
}

.table th.sortable::after {
  content: '⇅';
  position: absolute;
  right: 8px;
  opacity: 0.3;
  font-size: 12px;
}

.table th.sortable.sorted-asc::after {
  content: '↑';
  opacity: 1;
  color: #2563eb;
  font-weight: bold;
}

.table th.sortable.sorted-desc::after {
  content: '↓';
  opacity: 1;
  color: #2563eb;
  font-weight: bold;
}

.revenue-day-filter-wrap {
  position: relative;
  margin-top: 4px;
}

.revenue-day-filter-btn {
  width: 100%;
  font-size: 11px;
  border: 1px solid rgba(148, 163, 184, 0.8);
  border-radius: 8px;
  padding: 3px 6px;
  background: #fff;
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
}

.revenue-day-filter-panel {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 120px;
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.8);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.15);
  padding: 6px 8px;
  z-index: 20;
}

.revenue-day-filter-panel.open {
  display: block;
}

.revenue-day-filter-panel label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-main);
  padding: 3px 0;
}

/* Destaque para finais de semana - linha inteira */
/* Destaque para finais de semana - design limpo e funcional */
tr.weekend-highlight {
  background-color: #eff6ff;
  border-left: 3px solid #3b82f6;
}

tr.weekend-highlight:hover {
  background-color: #dbeafe;
}

/* Coluna "Dia" com destaque */
tr.weekend-highlight td:nth-child(3) {
  font-weight: 700;
  color: #1e40af;
  background-color: #dbeafe;
}

/* Lucro negativo em vermelho */
.negative-value {
  color: #dc2626;
  font-weight: 600;
}

.table-scroll {
  width:100%;
  max-width:100%;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}

.table {
  width:100%;
  max-width:100%;
  border-collapse:collapse;
  font-size:12px;
  min-width:360px;
}

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

.table th,
.table td {
  padding:8px 8px;
  text-align:left;
  border-bottom:1px solid var(--border-subtle);
}
.trophy-cell{
  text-align:center;
  width:52px;
}
.trophy-1{ color:#fbbf24; }
.trophy-2{ color:#94a3b8; }
.trophy-3{ color:#b45309; }
.trophy-4{ color:#059669; }
.trophy-5{ color:#2563eb; }

.waiters-table {
  min-width: 320px;
  font-size: 11px;
}
.waiters-table th,
.waiters-table td {
  padding: 6px 6px;
}

.table th {
  font-weight:500;
  color:var(--text-muted);
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.04em;
}

.table tbody tr:nth-child(even){ background:#f9fafb; }
.table tbody tr:hover { background: var(--accent-soft); }
.table.condensed th,
.table.condensed td{ padding:6px 6px; }

.list-item-product:hover { background: var(--secondary-soft); border-color: rgba(245,158,11,0.35); }
.merchant-item:hover{ background: var(--secondary-soft); }
.badge-diff-negative{ color:var(--danger); font-weight:500; }
.badge-diff-zero{ color:var(--success); font-weight:500; }
.badge-diff-positive{ color:#92400e; font-weight:500; }

/* loading overlay */
.loading-overlay {
  position:fixed;
  inset:0;
  width:100%;
  height:100%;
  display:none;
  align-items:center;
  justify-content:center;
  z-index:var(--z-overlay);
}

.loading-overlay.visible { display:flex; }

.loading-backdrop {
  position:absolute;
  inset:0;
  background:rgba(15,23,42,.45);
  backdrop-filter:blur(4px);
}

.loading-card {
  position:relative;
  z-index:1;
  padding:18px 26px;
  border-radius:16px;
  background:rgba(15,23,42,.96);
  box-shadow:0 18px 55px rgba(0,0,0,.6);
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
}

.loading-text { color:#e5e7eb; font-size:13px; }

.ellipsis-loader {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
}

.ellipsis-loader span {
  width:8px;
  height:8px;
  border-radius:999px;
  background:#fbbf24;
  box-shadow:0 0 10px rgba(251,191,36,.8);
  animation:ellipsis 1.1s infinite ease-in-out both;
}

.ellipsis-loader span:nth-child(1){ animation-delay:-.32s; }
.ellipsis-loader span:nth-child(2){ animation-delay:-.16s; }

@keyframes ellipsis {
  0%,80%,100% { transform:scale(.6) translateY(0); opacity:.6; }
  40% { transform:scale(1) translateY(-2px); opacity:1; }
}

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

/* MOBILE */
@media (max-width:768px){
  .app-shell{
    max-width:100%;
    width: 100%;
    margin:8px auto 16px;
    padding:0 10px 16px;
  }
  .payments-layout{
    grid-template-columns: 1fr;
  }
  .table { min-width: 0; }
  .waiters-table { min-width: 0; font-size: 10px; }
  #paymentsTable {
    min-width: 0;
  }
  .app-header{
    flex-direction:column;
    align-items:stretch;
    gap:10px;
    border-radius:22px;
    padding:12px 14px;
  }
  .logo-area{
    justify-content:center;
    align-items:center;
    flex-direction:column;
  }
  .brand-logo{
    height:46px;
  }
  .logo-text{
    align-items:center;
    text-align:center;
  }
  .logo-subtitle{
    font-size:13px;
    font-weight:600;
  }
  .period-wrapper{
    width:100%;
  }
  .period-button {
  border: 1px solid rgba(148, 163, 184, 0.9);
  background: #ffffff;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 12px;
  color: var(--text-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.08s ease;
}

  .header-actions{
    flex-wrap:wrap;
    justify-content:space-between;
  }
  .period-wrapper{
    width:100%;
  }
  .period-button{
    width:100%;
  }


  .period-popover{
    position:fixed;
    inset:0;
    margin:0;
    border-radius:0;
    min-width:0;
    width:100%;
    height:100vh;
    max-height:100vh;
    padding:0;
    border:none;
    -webkit-overflow-scrolling:touch;
    overflow:hidden;
    background:#fff;
    display:none;
    flex-direction:column;
  }
  .period-popover.open{ display:flex; }

  .period-modal-backdrop.visible{ display:block; }

  .period-popover-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:12px 16px;
    border-bottom:1px solid var(--border-subtle);
    background:#f9fafb;
  }
  .popover-close{
    font-size:13px;
    border:none;
    background:transparent;
    color:var(--accent);
    padding:4px 6px;
  }
  .period-popover-inner{
    display:grid;
    grid-template-columns:1fr;
    gap:12px;
    padding:10px 16px 16px;
    overflow-y:auto;
    -webkit-overflow-scrolling:touch;
    flex:1;
  }

  .kpi-grid-mobile{
    display:flex;
    overflow-x:auto;
    gap:10px;
    -webkit-overflow-scrolling:touch;
    padding:2px 10px 6px;
    scrollbar-width:none;
  }
  .kpi-grid-mobile::-webkit-scrollbar{ display:none; }
  .kpi-grid-mobile .kpi-card{
    min-width:78vw;
    flex-shrink:0;
  }
  .kpi-nav-btn{ display:flex; }
  .grid-2,
  .grid-3,
  .grid-4,
  .grid-5{ grid-template-columns:1fr; }
  .chart-wrapper{ min-height:210px; }
  .table{ min-width:0; }
}


@media (min-width: 1440px) {
  .app-shell {
    max-width: 1260px;
    padding: 0 32px 24px;
    margin-left: auto;
    margin-right: auto;
  }
  .kpi-grid-main,
  .kpi-grid-efficiency {
    grid-template-columns: repeat(3, minmax(0,1fr));
  }
}


.carousel-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.18);
  color: #ffffff;
  cursor: pointer;
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.25);
  z-index: 5;
}

.carousel-nav-btn:hover {
  background: rgba(15, 23, 42, 0.32);
}

.carousel-nav-btn--left {
  left: 4px;
}

.carousel-nav-btn--right {
  right: 4px;
}

/* Ensure the button doesn't fully cover content text beneath */
.carousel-nav-btn svg,
.carousel-nav-btn span {
  pointer-events: none;
}



/* Filtro de grupo para produtos vendidos (single select) */
.card-header-with-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.card-header-with-actions .card-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.products-group-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.products-group-filter label {
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.products-group-filter-wrap {
  position: relative;
  min-width: 180px;
}

.products-group-filter-btn {
  min-width: 180px;
  max-width: 280px;
  width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-muted);
  font-size: 12px;
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
}

.products-group-filter-btn:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(37,99,235,0.15);
}

.products-group-filter-panel {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 220px;
  max-height: 240px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  box-shadow: 0 12px 26px rgba(15,23,42,0.16);
  padding: 8px 10px;
  z-index: 30;
}

.products-group-filter-panel.open {
  display: block;
}

.products-group-filter-panel label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-main);
  padding: 3px 0;
  text-transform: none;
  letter-spacing: 0;
}




/* ============================
   AUTH OVERLAY (OTP)
   ============================ */
.auth-overlay { position:fixed; inset:0; z-index:9999; display:none; }
.auth-overlay.active { display:block; }
.auth-backdrop { position:absolute; inset:0; background:rgba(15,23,42,0.55); backdrop-filter: blur(3px); }
.auth-card {
  position:relative;
  width:min(520px, calc(100vw - 32px));
  max-height: 90vh; /* Permite ocupar até 90% da altura da tela */
  margin: 5vh auto 0 auto;
  background: var(--card, #ffffff);
  border: 1px solid rgba(15,23,42,0.12);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  overflow:hidden;
  display: flex;
  flex-direction: column;
}
.auth-header { 
  padding:18px 18px 10px 18px; 
  border-bottom:1px solid rgba(15,23,42,0.08);
  flex-shrink: 0;
}
.auth-title { font-weight:800; font-size:18px; color: var(--text, #0f172a); }
.auth-subtitle { margin-top:4px; font-size:13px; color: var(--text-muted, #64748b); }
.auth-body { 
  padding:16px 18px 18px 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}
.auth-label { display:block; font-size:12px; color: var(--text-muted, #64748b); margin:10px 0 6px; }
.auth-input, .auth-select {
  width:100%;
  padding:12px 14px;
  border-radius:12px;
  border: 1.5px solid rgba(15,23,42,0.16);
  background:#fff;
  color: var(--text, #0f172a);
  outline:none;
}
.auth-input:focus, .auth-select:focus { border-color: rgba(42,142,220,0.85); box-shadow: 0 0 0 3px rgba(42,142,220,0.18); }
.auth-input.is-invalid {
  border-color: #b91c1c;
  box-shadow: 0 0 0 2px rgba(185, 28, 28, 0.12);
}
.auth-btn {
  box-shadow: 0 10px 24px rgba(37,99,235,0.15);
  width:100%;
  margin-top:12px;
  padding:12px 14px;
  border-radius:12px;
  border: 1px solid rgba(37,99,235,0.35);
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  font-weight:700;
  cursor:pointer;
}
.auth-btn:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(37,99,235,0.18); }
.auth-btn.secondary { background: rgba(148,163,184,0.14); border-color: rgba(148,163,184,0.35); color:#0f172a; }
.auth-hint { margin-top:10px; font-size:12px; color: var(--text-muted, #64748b); }
.auth-error,
.auth-success {
  margin-top: 10px;
  font-size: 12px;
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transform: translateY(-4px);
  transition: opacity 180ms ease, max-height 180ms ease, transform 180ms ease;
}
.auth-error {
  color: #991b1b;
  background: rgba(185, 28, 28, 0.08);
  border-color: rgba(185, 28, 28, 0.18);
}
.auth-success {
  color: #166534;
  background: rgba(22, 163, 74, 0.08);
  border-color: rgba(22, 163, 74, 0.18);
}
.auth-error.show,
.auth-success.show {
  opacity: 1;
  max-height: 200px;
  transform: translateY(0);
}

@keyframes auth-pulse {
  0% { transform: scale(0.98); opacity: 0.7; }
  50% { transform: scale(1.01); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes auth-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

.auth-success.anim-success { animation: auth-pulse 320ms ease; }
.auth-error.anim-error { animation: auth-shake 320ms ease; }
.auth-footer { 
  padding: 10px 18px 16px 18px; 
  border-top:1px solid rgba(15,23,42,0.08);
  flex-shrink: 0; /* Não encolhe, mantém o botão sempre visível */
}
.auth-footnote { font-size:12px; color: var(--text-muted, #64748b); }
.auth-step.hidden { display:none; }
.auth-merchant-title { font-weight:800; font-size:14px; color: var(--text, #0f172a); margin-bottom:10px; }

/* Auth step com merchant list - layout flexível para manter botão visível */
#authStepMerchant.hidden { display: none; }
#authStepMerchant {
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  min-height: 0;
}

#authStepMerchant {
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  min-height: 0;
}

.merchant-list-wrapper {
  flex: 1;
  min-height: 0;
  /* altura limitada para exibir ~4 cards antes de rolar; em telas menores usa 60vh */
  max-height: min(60vh, 460px);
  overflow-y: auto;
  padding: 0 0 12px;
}

.merchant-list-wrapper .merchant-list {
  flex: 1;
  max-height: none;
  overflow: visible;
}

.auth-merchant-footer {
  position: sticky;
  bottom: 0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 12px 0 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0), #fff 70%);
  gap: 10px;
}

#authStepMerchant .auth-merchant-title {
  flex-shrink: 0;
}

#authStepMerchant .merchant-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0; /* Importante para o flex funcionar corretamente */
}

#authStepMerchant .auth-btn {
  flex-shrink: 0;
  margin-top: 16px;
}

#authStepMerchant #btnConfirmMerchant {
  display: none;
}

#authStepMerchant .auth-hint {
  flex-shrink: 0;
}

/* ============================
   HEADER: Merchant + Logout
   ============================ */
.merchant-wrap { display:flex; align-items:center; }
.merchant-select{
  max-width: 260px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(15,23,42,0.16);
  background: rgba(255,255,255,0.92);
  color: var(--text, #0f172a);
}
.logout-btn{
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(15,23,42,0.16);
  background: rgba(255,255,255,0.92);
  color: var(--text, #0f172a);
  font-weight:700;
  cursor:pointer;
}
.logout-btn:hover{ background: rgba(255,255,255,1); }
.install-btn{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(37,99,235,0.22);
  background: #2563eb;
  color: #fff;
  font-weight:700;
  cursor:pointer;
  box-shadow: 0 10px 25px rgba(37,99,235,0.18);
}
.install-btn:hover{
  background: #1d4ed8;
}

@media (max-width: 640px){
  .app-shell{ padding-top: 72px; }
  .header-actions{ flex-wrap: wrap; }
  .merchant-select{ max-width: 100%; width: 100%; }
  .merchant-wrap{ width:100%; }
  .header-actions .context-btn{ display: none; }
  .mobile-context-bar{
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(37,99,235,0.12), rgba(245,158,11,0.10)), rgba(255,255,255,0.96);
    box-shadow: 0 12px 28px rgba(0,0,0,0.14);
    z-index: var(--z-overlay);
  }
  .mobile-context-btn{
    width: 100%;
    justify-content: center;
    border-radius: 14px;
    box-shadow: 0 14px 32px rgba(15,23,42,0.16);
    font-size: 15px;
    color: #fff;
  }
  .logout-btn,
  .install-btn{ width:100%; }
}

@media (max-width: 480px) {
  .section-title { font-size: 13px; }
  .kpi-value { font-size: 20px; }
  .card-title { font-size: 13px; }
  .card-subtitle { font-size: 11px; }
  .table { font-size: 11px; }
}


/* Auth header brand refinements */
.auth-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  background: linear-gradient(135deg, rgba(42,142,220,0.10), rgba(0,63,115,0.06));
}
.auth-brand{
  display:flex;
  align-items:center;
  justify-content:center;
  width:64px;
  height:44px;
  padding:6px 8px;
  border-radius:14px;
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(15,23,42,0.10);
}
.auth-logo{
  max-width: 100%;
  max-height: 100%;
  height:auto;
  width:auto;
  display:block;
}
.auth-headline{ flex:1; min-width:0; }
.auth-step-pill{
  font-size:12px;
  font-weight:800;
  padding:6px 10px;
  border-radius:999px;
  border: 1px solid rgba(42,142,220,0.30);
  background: rgba(255,255,255,0.85);
  color:#003F73;
  white-space:nowrap;
}
.auth-mini{
  margin-top:8px;
  font-size:12px;
  color: var(--text-muted, #64748b);
}



/* ============================
   AUTH HEADER PRO (centered)
   ============================ */
.auth-header-centered{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:22px 18px 14px 18px;
  background: linear-gradient(180deg, rgba(42,142,220,0.08), rgba(255,255,255,0.0));
  border-bottom: 1px solid rgba(15,23,42,0.08);
}
.auth-logo-centered{
  height:46px;
  max-width: 240px;
  margin: 2px 0 10px 0;
}
.auth-header-centered .auth-title{
  font-size:24px;
  font-weight:900;
  letter-spacing:-0.02em;
  line-height:1.1;
  color:#0b2545;
}
.auth-header-centered .auth-subtitle{
  margin-top:6px;
  font-size:13px;
  font-weight:600;
  color: rgba(15,23,42,0.55);
}
.auth-step-pill-centered{
  margin-top:10px;
  font-size:11px;
  font-weight:900;
  letter-spacing:0.02em;
  padding:6px 10px;
  border-radius:999px;
  border: 1px solid rgba(42,142,220,0.28);
  background: rgba(255,255,255,0.88);
  color:#003F73;
}
.auth-card{ border-radius: 20px; }
.auth-body{ padding-top: 12px; }

.auth-progress {
  margin-top: 10px;
  width: 100%;
  height: 6px;
  background: rgba(15,23,42,0.08);
  border-radius: 999px;
  overflow: hidden;
}

.auth-progress-bar {
  height: 100%;
  width: 33%;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-radius: inherit;
  transition: width var(--transition-fast);
}

.auth-otp-group { margin: 8px 0 12px; }
.otp-boxes {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
}
.auth-otp-input {
  width: 48px;
  min-width: 48px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  padding: 10px 0;
  border-radius: 12px;
  border: 1.5px solid rgba(15,23,42,0.16);
  background: #fff;
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}
.auth-otp-input:focus {
  outline: none;
  border-color: rgba(37,99,235,0.7);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
  transform: translateY(-1px);
}
.auth-otp-input.invalid {
  border-color: #b91c1c;
  box-shadow: 0 0 0 2px rgba(185,28,28,0.12);
}

@media (max-width: 420px){
  .auth-header-centered .auth-title{ font-size:20px; }
  .auth-logo-centered{ height:40px; max-width: 200px; }
}


/* Auth: link-style action */
.auth-btn.link{
  background: transparent;
  border: 0;
  box-shadow: none;
  margin-top: 10px;
  padding: 8px 10px;
  color: #003F73;
  text-decoration: underline;
}
.auth-btn.link:hover{ background: rgba(42,142,220,0.10); border-radius: 12px; text-decoration: none; }

#btnResendOtp{ display:none; }

.auth-btn.is-loading {
  pointer-events: none;
  opacity: 0.8;
  position: relative;
}

.auth-btn.is-loading::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border: 2px solid rgba(0,0,0,0.18);
  border-top-color: rgba(0,0,0,0.55);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Efeito avião ao enviar código */
.send-plane {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 72px;
  color: var(--success);
  z-index: 12000;
  animation: plane-fly 4s ease-in-out forwards;
  text-shadow: 0 8px 18px rgba(37,99,235,0.35);
  pointer-events: none;
  filter: drop-shadow(0 6px 12px rgba(37,99,235,0.32));
}

/* rastro do avião */
.send-plane::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 60%;
  width: 2px;
  height: 0;
  background: linear-gradient(180deg, rgba(37,99,235,0.45), rgba(37,99,235,0));
  transform: translateX(-50%);
  animation: plane-trail 3s ease-in-out forwards;
}

@keyframes plane-trail {
  0% { height: 0; opacity: 0; }
  10% { height: 30vh; opacity: 0.6; }
  50% { height: 45vh; opacity: 0.35; }
  100% { height: 60vh; opacity: 0; }
}

@keyframes plane-fly {
  0% { transform: translate(-50%, -50%) scale(0.9) rotate(-6deg); opacity: 0; }
  15% { opacity: 1; }
  40% { transform: translate(10vw, -15vh) scale(1) rotate(5deg); opacity: 1; }
  60% { transform: translate(40vw, -30vh) scale(1) rotate(-3deg); opacity: 1; }
  80% { transform: translate(70vw, -45vh) scale(1) rotate(2deg); opacity: 1; }
  100% { transform: translate(95vw, -60vh) scale(0.98) rotate(0deg); opacity: 0; }
}


/* MERCHANT LISTVIEW */

/* ============================
   MERCHANT LISTVIEW
   ============================ */
.merchant-button{
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 12px;
  border-radius:12px;
  border:1px solid rgba(15,23,42,0.16);
  background: rgba(255,255,255,0.92);
  color: var(--text, #0f172a);
  font-weight:800;
  cursor:pointer;
}
.merchant-button:hover{ background: rgba(255,255,255,1); }
.merchant-button-label{ max-width: 240px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.merchant-button-caret{ font-size:14px; opacity:0.7; }

.merchant-list{
  display:flex;
  flex-direction:column;
  gap:10px;
  /* Não definir max-height aqui - o container pai (picker-body/auth-body) controla o scroll */
}
.merchant-item{
  display:flex;
  flex-direction:row;
  align-items:center;
  gap:10px;
  padding:12px 12px;
  border-radius:14px;
  border: 1px solid rgba(15,23,42,0.14);
  background: rgba(255,255,255,0.92);
  cursor:pointer;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}
.merchant-item:hover{
  transform: translateY(-1px);
  border-color: rgba(42,142,220,0.35);
  box-shadow: 0 10px 25px rgba(15,23,42,0.10);
}
.merchant-item.active{
  border-color: rgba(42,142,220,0.75);
  box-shadow: 0 0 0 3px rgba(42,142,220,0.18);
  background: rgba(42,142,220,0.08);
}
.merchant-logo-wrap{
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.merchant-logo{
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}
.merchant-item-name{
  font-weight:900;
  letter-spacing:-0.01em;
  color:#0b2545;
}
.merchant-item-sub{
  margin-top:4px;
  font-size:12px;
  color: rgba(15,23,42,0.55);
}

/* Picker modal for header selection */
.picker-overlay{ position:fixed; inset:0; z-index:9998; display:none; }
.picker-overlay.active{ display:block; }
.picker-backdrop{ position:absolute; inset:0; background: rgba(15,23,42,0.50); backdrop-filter: blur(3px); }
.picker-card{
  position:relative;
  width: min(520px, calc(100vw - 32px));
  max-height: 90vh; /* Permite ocupar até 90% da altura da tela */
  margin: 5vh auto 0 auto;
  background: var(--card, #ffffff);
  border: 1px solid rgba(15,23,42,0.12);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  overflow:hidden;
  display: flex;
  flex-direction: column;
}
.picker-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:16px 16px;
  border-bottom:1px solid rgba(15,23,42,0.08);
  background: linear-gradient(180deg, rgba(42,142,220,0.06), rgba(255,255,255,0.0));
  flex-shrink: 0;
}
.picker-title{ font-weight:900; font-size:16px; color:#0b2545; }
.picker-close{
  width:36px; height:36px;
  border-radius:12px;
  border:1px solid rgba(15,23,42,0.14);
  background: rgba(255,255,255,0.9);
  cursor:pointer;
  font-size:20px;
  line-height:1;
}
.picker-close:hover{ background: rgba(255,255,255,1); }
.picker-body{ 
  padding: 14px 16px 16px 16px;
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 640px){
  .merchant-button{ width:100%; justify-content:space-between; }
  .merchant-button-label{ max-width: 100%; }
}

@media (min-width: 1200px){
  .list-products{
    grid-template-columns: repeat(2, minmax(0,1fr));
  }
  .list-products .list-item{
    height: 100%;
  }
}

.chart-toggle-group{
  display:flex;
  gap:8px;
  align-items:center;
}
.chart-toggle-btn{
  border:1px solid #e5e7eb;
  background:#ffffff;
  padding:6px 12px;
  border-radius:9999px;
  cursor:pointer;
  font-size:13px;
  font-weight:600;
  color:#374151;
}
.chart-toggle-btn.active{
  background:#2563eb;
  border-color:#2563eb;
  color:#ffffff;
  box-shadow:0 4px 12px rgba(37,99,235,0.25);
}
.groups-chart-wrapper{
  max-width: 700px;
  margin: 0 auto;
}
