/* BLOCO: Fundamentos visuais
   Centraliza a identidade do painel para manter cores, espaços e contrastes consistentes. */
:root {
  color-scheme: light;
  --page: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --surface-hover: #f8fafc;
  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --muted-light: #94a3b8;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --brand-soft: #ccfbf1;
  --success: #16a34a;
  --success-soft: #dcfce7;
  --warning: #f59e0b;
  --warning-soft: #fef3c7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --info: #2563eb;
  --info-soft: #dbeafe;
  --purple: #7c3aed;
  --purple-soft: #ede9fe;
  --sidebar-width: 268px;
  --header-height: 82px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 22px 50px rgba(15, 23, 42, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--page);
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[hidden],
.hidden {
  display: none !important;
}

:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.24);
  outline-offset: 2px;
}

/* BLOCO: Cabeçalho da autenticação
   Apresenta a marca sem competir visualmente com o formulário de entrada. */
.login-topbar {
  position: relative;
  z-index: 10;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px);
}

.topbar-inner {
  width: min(1180px, 100%);
  min-height: 74px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* BLOCO: Identidade visual LynxMenu
   Exibe a arte oficial enviada pelo proprietário sem alterar proporções ou conteúdo da marca. */
.brand-logo-image,
.sidebar-brand-image {
  display: block;
  object-fit: cover;
  object-position: center;
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: 12px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
}

.brand-logo-image {
  width: min(230px, 72vw);
  height: 70px;
}

.brand-mark,
.sidebar-logo {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #ffffff;
  background: linear-gradient(145deg, #0f766e, #134e4a);
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.2);
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
}

.brand-mark svg,
.sidebar-logo svg {
  width: 24px;
  height: 24px;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  font-size: 18px;
  letter-spacing: -0.02em;
}

.brand-copy span {
  color: var(--muted);
  font-size: 12px;
}

/* BLOCO: Autenticação
   Mantém o login compacto, legível e confortável em qualquer tamanho de tela. */
.lock {
  width: min(480px, calc(100% - 32px));
  margin: clamp(34px, 8vh, 84px) auto;
  display: grid;
  gap: 16px;
}

.lock.hidden {
  display: none;
}

.lock .panel {
  padding: clamp(24px, 5vw, 38px);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.lock .panel h2 {
  margin-bottom: 8px;
  font-size: clamp(25px, 4vw, 32px);
  letter-spacing: -0.035em;
}

.lock .form-grid {
  gap: 15px;
  margin-top: 22px !important;
}

.lock .btn,
.lock .btn-secondary {
  width: 100%;
  min-height: 48px;
}

/* BLOCO: Botões compartilhados
   Garante alvos acessíveis, estados previsíveis e transições discretas. */
.btn,
.btn-secondary,
.btn-danger,
.small-btn,
.text-button,
.header-client-link,
.refresh-button {
  min-height: 40px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 750;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}

.btn {
  color: #ffffff;
  background: var(--brand);
  box-shadow: 0 7px 16px rgba(15, 118, 110, 0.16);
}

.btn:hover {
  background: var(--brand-dark);
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.22);
  transform: translateY(-1px);
}

.btn-secondary,
.small-btn,
.refresh-button {
  border: 1px solid var(--line);
  color: var(--ink-soft);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover,
.small-btn:hover,
.refresh-button:hover {
  border-color: var(--line-strong);
  color: var(--brand);
  background: var(--surface-hover);
}

.btn-danger {
  color: #ffffff;
  background: var(--danger);
}

.small-btn {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 12px;
}

.text-button {
  min-height: 32px;
  padding: 4px 2px;
  color: var(--brand);
  background: transparent;
  font-size: 13px;
}

.text-button:hover {
  color: var(--brand-dark);
}

.refresh-button svg,
.header-client-link svg {
  width: 17px;
  height: 17px;
}

/* BLOCO: Alerta de novo pedido
   Mantém o aviso acima da interface com destaque alto e leitura imediata. */
.new-order-alert {
  position: fixed;
  top: 96px;
  right: 22px;
  z-index: 200;
  width: min(440px, calc(100vw - 44px));
  padding: 16px;
  border: 1px solid #fbbf24;
  border-left: 6px solid var(--warning);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  color: #78350f;
  background: #fffbeb;
  box-shadow: var(--shadow-lg);
  animation: alert-arrival 450ms cubic-bezier(0.2, 0.8, 0.2, 1), alert-pulse 900ms ease-in-out 2 500ms;
}

.new-order-alert[hidden] {
  display: none;
}

.new-order-alert-icon {
  font-size: 26px;
}

.new-order-alert-content {
  min-width: 0;
  display: grid;
  gap: 3px;
  line-height: 1.35;
}

.new-order-alert-content strong {
  color: #7c2d12;
  font-size: 15px;
}

.new-order-alert-content span {
  font-size: 13px;
}

.new-order-alert-action,
.new-order-alert-close {
  min-height: 36px;
  border-radius: 9px;
  font-weight: 800;
}

.new-order-alert-action {
  padding: 7px 11px;
  color: #ffffff;
  background: var(--danger);
}

.new-order-alert-close {
  width: 36px;
  padding: 4px;
  color: #7c2d12;
  background: transparent;
  font-size: 22px;
}

@keyframes alert-arrival {
  from {
    opacity: 0;
    transform: translateY(-16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes alert-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.025);
  }
}

/* BLOCO: Estrutura autenticada
   Reserva a lateral para navegação e mantém o conteúdo fluido em telas grandes. */
.app {
  display: none;
  min-height: 100vh;
  background: var(--page);
}

.app.active {
  display: block;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 80;
  width: var(--sidebar-width);
  padding: 22px 16px 16px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid rgba(226, 232, 240, 0.82);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 8px 0 30px rgba(15, 23, 42, 0.025);
  transition: transform 240ms ease;
}

.sidebar-brand {
  min-height: 70px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-brand-image {
  width: 100%;
  max-width: 238px;
  height: 70px;
}

.sidebar-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

.sidebar-brand div {
  display: grid;
  gap: 1px;
}

.sidebar-brand strong {
  font-size: 17px;
  letter-spacing: -0.02em;
}

.sidebar-brand span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.sidebar-restaurant {
  margin: 24px 4px 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 4px;
  background: linear-gradient(145deg, #ffffff, #f8fafc);
  box-shadow: var(--shadow-sm);
}

.sidebar-restaurant > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-restaurant strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-restaurant small {
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--success);
  font-size: 11px;
  font-weight: 750;
}

.sidebar-restaurant i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  background: var(--success);
  box-shadow: 0 0 0 4px var(--success-soft);
}

/* BLOCO: Navegação lateral
   Destaca o módulo ativo sem alterar as permissões controladas pelo JavaScript. */
.tabs {
  display: grid;
  gap: 4px;
}

.nav-label {
  margin: 2px 12px 8px;
  color: var(--muted-light);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.tabs button {
  position: relative;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 720;
  text-align: left;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.tabs button::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: -16px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  content: "";
  background: transparent;
}

.tabs button svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
}

.tabs button:hover {
  color: var(--ink);
  background: var(--surface-soft);
  transform: translateX(2px);
}

.tabs button.active {
  color: var(--brand-dark);
  background: #ecfdf5;
}

.tabs button.active::before {
  background: var(--brand);
}

.tabs button.active svg {
  color: var(--brand);
  stroke-width: 2.1;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.sidebar-logout {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 720;
}

.sidebar-logout:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.sidebar-logout svg {
  width: 19px;
  height: 19px;
}

.sidebar-overlay {
  display: none;
}

.workspace {
  min-width: 0;
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

/* BLOCO: Cabeçalho contextual
   Mantém ações frequentes acessíveis sem sobrecarregar a área principal. */
.app-header {
  position: sticky;
  top: 0;
  z-index: 60;
  min-height: var(--header-height);
  padding: 14px clamp(18px, 3vw, 36px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.82);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: rgba(248, 250, 252, 0.9);
  backdrop-filter: blur(18px);
}

.app-header-left,
.app-header-actions {
  display: flex;
  align-items: center;
}

.app-header-left {
  min-width: 0;
  gap: 12px;
}

.app-header-actions {
  gap: 10px;
}

.dashboard-copy {
  min-width: 0;
}

.dashboard-copy h1 {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: clamp(19px, 2.1vw, 25px);
  line-height: 1.18;
  letter-spacing: -0.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-copy p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.icon-button {
  position: relative;
  width: 42px;
  height: 42px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.icon-button:hover {
  border-color: var(--line-strong);
  color: var(--brand);
  transform: translateY(-1px);
}

.icon-button svg {
  width: 20px;
  height: 20px;
}

.menu-toggle {
  display: none;
}

.header-client-link {
  min-height: 42px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 12px;
}

.header-client-link:hover {
  border-color: var(--line-strong);
  color: var(--brand);
}

.notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 2px solid var(--page);
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: var(--danger);
  font-size: 10px;
  font-weight: 850;
}

.profile {
  position: relative;
}

.profile-button {
  min-height: 46px;
  padding: 4px 8px 4px 5px;
  border: 1px solid transparent;
  border-radius: 13px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  background: transparent;
}

.profile-button:hover,
.profile-button[aria-expanded="true"] {
  border-color: var(--line);
  background: var(--surface);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #ffffff;
  background: linear-gradient(145deg, var(--brand), #0d9488);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.03em;
}

.profile-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
  text-align: left;
}

.profile-copy strong,
.profile-copy small {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-copy strong {
  font-size: 12px;
}

.profile-copy small {
  color: var(--muted);
  font-size: 10px;
}

.profile-button > svg {
  width: 15px;
  height: 15px;
  color: var(--muted);
}

.profile-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 90;
  width: 190px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: menu-arrival 140ms ease-out;
}

.profile-menu button {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
}

.profile-menu button:hover {
  color: var(--brand);
  background: var(--surface-soft);
}

@keyframes menu-arrival {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* BLOCO: Conteúdo e hierarquia
   Define largura confortável e espaços regulares para todos os módulos. */
.app-content {
  width: min(100%, 1560px);
  margin: 0 auto;
  padding: 24px clamp(18px, 3vw, 36px) 42px;
}

.notice {
  min-height: 44px;
  margin-bottom: 22px;
  padding: 10px 14px;
  border: 1px solid #bae6fd;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #075985;
  background: #f0f9ff;
  font-size: 12px;
  line-height: 1.45;
}

.notice svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.section {
  display: none;
}

.section.active {
  display: grid;
  gap: 20px;
  animation: section-arrival 240ms ease-out;
}

@keyframes section-arrival {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-heading,
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-heading {
  min-height: 68px;
}

.section-heading h2 {
  margin: 3px 0 5px;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.section-heading p,
.panel-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.eyebrow {
  color: var(--brand);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.panel {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.panel h2,
.panel h3 {
  margin: 0 0 14px;
  color: var(--ink);
  letter-spacing: -0.025em;
}

.panel h2 {
  font-size: 18px;
}

.panel h3 {
  font-size: 15px;
}

.panel-heading {
  margin-bottom: 18px;
}

.panel-heading h2 {
  margin: 3px 0 4px;
}

.panel-heading.compact {
  margin-bottom: 12px;
}

.muted,
.empty {
  color: var(--muted);
  line-height: 1.5;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.team-layout {
  grid-template-columns: minmax(280px, 0.8fr) minmax(320px, 1.2fr);
}

/* BLOCO: Indicadores do dashboard
   Usa seis cards com ícones, variação real e leitura rápida. */
.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.metric {
  position: relative;
  min-width: 0;
  min-height: 156px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

/* BLOCO: Indicadores do faturamento
   Mantém o título no topo e centraliza o valor logo abaixo para facilitar a leitura financeira. */
.revenue-metrics .revenue-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
}

.revenue-metric-title,
.revenue-metric-value {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
}

.revenue-metric-title {
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}

.revenue-metric-value {
  margin-top: 18px;
  color: var(--ink);
  font-size: clamp(28px, 3.2vw, 36px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.metric::after {
  position: absolute;
  right: -34px;
  bottom: -50px;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  content: "";
  background: var(--metric-soft, var(--brand-soft));
  opacity: 0.58;
}

.metric:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.metric-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.metric-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.metric-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: var(--metric-color, var(--brand));
  background: var(--metric-soft, var(--brand-soft));
}

.metric-icon svg {
  width: 20px;
  height: 20px;
}

.metric-value {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 17px;
  color: var(--ink);
  font-size: clamp(28px, 3.2vw, 36px);
  line-height: 1;
  letter-spacing: -0.045em;
}

.metric-trend {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 680;
}

.metric-trend i {
  padding: 3px 6px;
  border-radius: 999px;
  font-style: normal;
  font-weight: 850;
}

.metric-trend.positive i {
  color: var(--success);
  background: var(--success-soft);
}

.metric-trend.negative i {
  color: var(--danger);
  background: var(--danger-soft);
}

.metric-trend.neutral i {
  color: var(--muted);
  background: var(--surface-soft);
}

.metric-orders {
  --metric-color: #2563eb;
  --metric-soft: #dbeafe;
}

.metric-delivered {
  --metric-color: #16a34a;
  --metric-soft: #dcfce7;
}

.metric-progress {
  --metric-color: #7c3aed;
  --metric-soft: #ede9fe;
}

.metric-late {
  --metric-color: #dc2626;
  --metric-soft: #fee2e2;
}

.metric-revenue {
  --metric-color: #0f766e;
  --metric-soft: #ccfbf1;
}

.metric-ticket {
  --metric-color: #d97706;
  --metric-soft: #fef3c7;
}

/* BLOCO: Gráfico de desempenho
   Renderiza dados reais em SVG responsivo sem carregar bibliotecas de terceiros. */
.performance-panel {
  padding: 22px;
}

.chart-filters {
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  background: var(--surface-soft);
}

.chart-filters button {
  min-height: 31px;
  padding: 6px 11px;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 760;
}

.chart-filters button.active {
  color: var(--brand-dark);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.performance-chart {
  min-height: 292px;
}

.chart-summary {
  margin-bottom: 12px;
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.chart-summary strong {
  font-size: 22px;
  letter-spacing: -0.035em;
}

.chart-summary span {
  color: var(--muted);
  font-size: 11px;
}

.chart-canvas {
  width: 100%;
  height: auto;
  min-height: 230px;
  overflow: visible;
}

.chart-grid-line {
  stroke: #e2e8f0;
  stroke-width: 1;
  stroke-dasharray: 4 5;
}

.chart-axis-label {
  fill: #94a3b8;
  stroke: none;
  font-size: 10px;
  font-weight: 650;
}

.chart-area {
  fill: url("#dashboardChartGradient");
  stroke: none;
}

.chart-line {
  fill: none;
  stroke: var(--brand);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-point {
  fill: #ffffff;
  stroke: var(--brand);
  stroke-width: 2;
}

.chart-empty-hint {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

/* BLOCO: Listas do resumo
   Exibe pedidos em tabela compacta e clientes em linhas com avatares. */
.dashboard-lists {
  align-items: stretch;
}

.dashboard-list-panel {
  min-height: 320px;
}

.dashboard-table-wrap {
  overflow-x: auto;
}

.dashboard-table {
  min-width: 560px;
}

.dashboard-table td,
.dashboard-table th {
  padding: 12px 10px;
}

.dashboard-table .small-btn {
  box-shadow: none;
}

.recent-client-list {
  display: grid;
}

.recent-client-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
}

.recent-client-row:last-child {
  border-bottom: 0;
}

.client-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--brand-dark);
  background: var(--brand-soft);
  font-size: 11px;
  font-weight: 850;
}

.recent-client-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.recent-client-copy strong,
.recent-client-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-client-copy strong {
  font-size: 13px;
}

.recent-client-copy span,
.recent-client-value small {
  color: var(--muted);
  font-size: 10px;
}

.recent-client-value {
  display: grid;
  gap: 2px;
  text-align: right;
}

.recent-client-value strong {
  font-size: 12px;
}

.empty-state {
  min-height: 218px;
  padding: 28px 18px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 9px;
  color: var(--muted);
  text-align: center;
}

.empty-state-icon {
  width: 50px;
  height: 50px;
  margin-bottom: 4px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: var(--brand);
  background: var(--brand-soft);
}

.empty-state-icon svg {
  width: 24px;
  height: 24px;
}

.empty-state strong {
  color: var(--ink-soft);
  font-size: 14px;
}

.empty-state p {
  max-width: 310px;
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
}

/* BLOCO: Formulários
   Reforça legibilidade, consistência e feedback de foco em todos os cadastros. */
.form-grid {
  display: grid;
  gap: 13px;
}

.two-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 760;
}

input,
textarea,
select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  color: var(--ink);
  background: #ffffff;
  box-shadow: 0 1px 1px rgba(15, 23, 42, 0.02);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input:hover,
textarea:hover,
select:hover {
  border-color: var(--line-strong);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

textarea {
  min-height: 90px;
  resize: vertical;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

/* BLOCO: Visibilidade das senhas
   Posiciona o botão de olho sem interferir no valor ou no preenchimento automático. */
.password-control {
  position: relative;
  display: block;
  width: 100%;
}

.password-control input {
  padding-right: 48px;
}

.password-visibility-button {
  position: absolute;
  top: 50%;
  right: 6px;
  width: 36px;
  min-height: 34px;
  padding: 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  transform: translateY(-50%);
}

.password-visibility-button:hover,
.password-visibility-button:focus-visible {
  border-color: var(--line);
  color: var(--ink);
  background: var(--surface-soft);
}

.password-visibility-button svg {
  width: 21px;
  height: 21px;
}

/* BLOCO: Dias de funcionamento
   Organiza as opções em botões compactos e fáceis de tocar. */
.day-options {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.day-options label {
  min-height: 42px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--ink-soft);
  background: var(--surface);
}

.day-options label:has(input:checked) {
  border-color: rgba(15, 118, 110, 0.35);
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.day-options input {
  width: auto;
  min-height: auto;
  accent-color: var(--brand);
}

/* BLOCO: Filtros financeiros e de clientes
   Mantém controles compactos sem sacrificar a área de leitura. */
.revenue-filter {
  width: min(100%, 780px);
  display: inline-grid;
  gap: 14px;
}

.revenue-filter h2 {
  margin-bottom: 0;
}

.revenue-filter-row {
  display: grid;
  grid-template-columns: minmax(220px, 430px) auto;
  align-items: end;
  gap: 11px;
}

.revenue-filter .small-btn {
  min-height: 44px;
  white-space: nowrap;
}

.custom-dates {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
}

.client-toolbar {
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: minmax(220px, 430px);
  gap: 10px;
}

.sort-btn {
  padding: 0;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.sort-btn:hover {
  color: var(--brand);
}

.pagination-controls {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.contact-actions {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.contact-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--surface);
}

.contact-btn:hover {
  border-color: var(--brand);
}

.contact-btn img {
  width: 20px;
  height: 20px;
  display: block;
  object-fit: contain;
}

/* BLOCO: Tabelas
   Melhora escaneabilidade e mantém o conteúdo operacional completo. */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 12px;
  line-height: 1.45;
}

th {
  color: var(--muted);
  background: #f8fafc;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

tbody tr {
  transition: background 150ms ease;
}

tbody tr:hover {
  background: #fbfdff;
}

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

.status {
  min-height: 25px;
  padding: 4px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  color: #ffffff;
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}

.recebido {
  background: var(--info);
}

.preparo {
  background: var(--warning);
}

.entrega {
  background: var(--purple);
}

.entregue {
  background: var(--success);
}

.cancelado {
  background: var(--danger);
}

/* BLOCO: Tempo e status dos pedidos
   Destaca urgência sem depender apenas do texto. */
.time-alert {
  min-width: 128px;
  padding: 7px 9px;
  border-radius: 9px;
  display: inline-grid;
  gap: 2px;
  font-size: 10px;
  font-weight: 850;
}

.time-alert small {
  font-size: 9px;
  font-weight: 720;
  opacity: 0.82;
}

.time-ok {
  color: #166534;
  background: var(--success-soft);
}

.time-watch {
  color: #854d0e;
  background: var(--warning-soft);
}

.time-warning {
  color: #9a3412;
  background: #ffedd5;
}

.time-late {
  color: #991b1b;
  background: var(--danger-soft);
}

.order-status-select {
  width: 185px;
  min-width: 185px;
  max-width: 100%;
  min-height: 38px;
  padding: 8px 30px 8px 10px;
  font-size: 11px;
  font-weight: 720;
  text-align: center;
  text-align-last: center;
}

.order-status-actions {
  display: grid;
  justify-items: center;
  gap: 7px;
}

/* BLOCO: Cardápio e prévia
   Valoriza fotos, produtos e ações sem alterar o editor existente. */
.product-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.product-row:last-child {
  border-bottom: 0;
}

.thumb {
  width: 92px;
  height: 72px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background-color: var(--surface-soft);
  display: block;
  object-fit: cover;
}

.thumb-empty {
  background: var(--surface-soft);
}

.preview-shell {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--page);
}

.preview-hero {
  padding: 18px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 180px;
  align-items: center;
  gap: 14px;
  background: var(--surface);
}

.preview-hero h3 {
  margin: 0 0 6px;
}

.preview-photo {
  display: block;
  width: 100%;
  height: 125px;
  min-height: 125px;
  border-radius: 12px;
  background-color: var(--surface-soft);
  object-fit: cover;
}

.preview-products {
  padding: 15px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.preview-card {
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.preview-card-photo {
  display: block;
  width: 100%;
  height: 105px;
  background-color: var(--surface-soft);
  object-fit: cover;
}

.preview-card-body {
  padding: 11px;
  display: grid;
  gap: 6px;
}

.preview-card-body h4,
.preview-card-body p {
  margin: 0;
}

.preview-card-body p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.price {
  color: var(--brand);
  font-weight: 850;
}

/* BLOCO: Configuração do segundo fator
   Mantém QR Code e confirmação legíveis, sem expor ou armazenar o segredo no CSS. */
#twoFactorSetup {
  max-width: 520px;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

#twoFactorQrCode {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
}

/* BLOCO: Tablet e notebooks compactos
   Recolhe a sidebar e reduz colunas sem esconder funcionalidades. */
@media (max-width: 1180px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-copy {
    display: none;
  }
}

@media (max-width: 1080px) {
  .sidebar {
    transform: translateX(-102%);
    box-shadow: var(--shadow-lg);
  }

  .app.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .workspace {
    margin-left: 0;
  }

  .menu-toggle {
    display: grid;
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: block;
    visibility: hidden;
    background: rgba(15, 23, 42, 0.42);
    opacity: 0;
    transition: opacity 220ms ease, visibility 220ms ease;
  }

  .app.sidebar-open .sidebar-overlay {
    visibility: visible;
    opacity: 1;
  }

  .grid-2,
  .team-layout {
    grid-template-columns: 1fr;
  }

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

/* BLOCO: Celulares
   Prioriza ações essenciais, cards em coluna e tabelas convertidas em cartões. */
@media (max-width: 760px) {
  .topbar-inner {
    padding: 12px 16px;
  }

  .app-header {
    min-height: 72px;
    padding: 10px 14px;
  }

  .app-header-actions {
    gap: 6px;
  }

  .header-client-link {
    width: 42px;
    padding: 10px;
  }

  .header-client-link span {
    display: none;
  }

  .profile-button {
    padding: 4px;
  }

  .profile-button > svg {
    display: none;
  }

  .dashboard-copy h1 {
    max-width: calc(100vw - 235px);
    font-size: 17px;
  }

  .dashboard-copy p {
    font-size: 10px;
  }

  .app-content {
    padding: 16px 12px 32px;
  }

  .notice {
    align-items: flex-start;
  }

  .section-heading,
  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-heading .refresh-button {
    width: 100%;
  }

  .metrics,
  .two-cols,
  .revenue-filter-row,
  .custom-dates,
  .preview-hero,
  .preview-products {
    grid-template-columns: 1fr;
  }

  .metric {
    min-height: 145px;
  }

  .panel {
    padding: 16px;
    border-radius: 15px;
  }

  .performance-panel {
    padding: 16px 12px;
  }

  .chart-filters {
    width: 100%;
  }

  .chart-filters button {
    flex: 1;
  }

  .performance-chart {
    min-height: 248px;
  }

  .chart-canvas {
    min-height: 190px;
  }

  .day-options {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .product-row {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .product-row .actions {
    grid-column: 1 / -1;
  }

  .thumb {
    width: 76px;
    height: 64px;
  }

  .new-order-alert {
    top: 12px;
    right: 12px;
    width: calc(100vw - 24px);
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .new-order-alert-action {
    grid-column: 2 / -1;
    width: 100%;
  }

  .new-order-alert-close {
    grid-column: 3;
    grid-row: 1;
  }

  .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    width: 100%;
    min-width: 0;
    display: block;
  }

  thead {
    display: none;
  }

  tr {
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: 13px;
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
  }

  td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 10px;
    overflow-wrap: anywhere;
  }

  td:last-child {
    border-bottom: 0;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }

  .dashboard-table {
    min-width: 0;
  }

  .dashboard-table td {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .order-status-select {
    width: 100%;
    min-width: 0;
  }

  .pagination-controls {
    justify-content: center;
  }
}

@media (max-width: 470px) {
  .brand-copy span {
    display: none;
  }

  .dashboard-copy h1 {
    max-width: calc(100vw - 205px);
  }

  .notification-button {
    display: none;
  }

  .recent-client-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .recent-client-value {
    grid-column: 2;
    text-align: left;
  }

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

/* BLOCO: Acessibilidade de movimento
   Respeita usuários que solicitaram menos animações no sistema operacional. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
