/* ========================================================
 * DEPILCLEAR - tema.css  (visual 2026)
 * Camada de aparência por cima do Tailwind compilado e do style.css.
 * Mantém roxo + dourado da marca, com superfícies mais limpas, menos gradiente
 * e hierarquia mais clara. Carregue POR ÚLTIMO.
 * ======================================================== */
:root {
  --t-bg: #f6f4fa;
  --t-surface: #ffffff;
  --t-card: #f4f0fb;
  --t-border: #e8e1f3;
  --t-text: #1c1527;
  --t-muted: #6b6280;
  --t-accent: #5b34d6;
  --t-accent-strong: #3f2399;
  --t-accent-soft: #efe9ff;
  --t-gold: #b8901c;
  --t-shadow: 0 1px 2px rgba(28, 21, 39, .04), 0 8px 24px -12px rgba(63, 35, 153, .18);
  --t-shadow-lg: 0 2px 4px rgba(28, 21, 39, .04), 0 24px 48px -20px rgba(63, 35, 153, .28);
  --t-radius: 20px;
}
/* Tema escuro — regra 60·30·10 com as cores da logo:
   60% preto (fundo), 30% grafite com toque de roxo (superfícies, menu, cartões), 10% dourado (ação e destaque).
   O roxo da logo aparece só em detalhes secundários. */
html.dark {
  --t-bg: #0c0b0f;            /* 60 — preto da logo, levemente quente */
  --t-surface: #15131b;       /* 30 — superfícies */
  --t-card: #1c1924;          /* 30 — cartões elevados */
  --t-border: #2a2533;
  --t-text: #f4f1f7;
  --t-muted: #a9a2b6;
  --t-accent: #d4af37;        /* 10 — dourado da logo */
  --t-accent-strong: #e7c766;
  --t-accent-soft: rgba(212, 175, 55, .12);
  --t-on-accent: #1a1405;
  --t-purple: #9b6dff;        /* roxo da logo, clareado para ler no escuro */
  --t-gold: #d4af37;
  --t-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 28px -16px rgba(0, 0, 0, .8);
  --t-shadow-lg: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 28px 56px -24px rgba(0, 0, 0, .85);
}

/* Fundo com brilho sutil da marca */
body {
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(124, 58, 237, .07), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(212, 175, 55, .06), transparent 60%),
    var(--t-bg) !important;
  color: var(--t-text);
  -webkit-font-smoothing: antialiased;
}

/* Superfícies */
.bg-brand-lightSurface { background-color: var(--t-surface) !important; }
.bg-brand-lightCard { background-color: var(--t-card) !important; }
.bg-brand-lightBg { background-color: var(--t-bg) !important; }
.border-brand-lightBorder { border-color: var(--t-border) !important; }
html.dark .dark\:bg-brand-darkSurface { background-color: var(--t-surface) !important; }
html.dark .dark\:bg-brand-darkCard { background-color: var(--t-card) !important; }
html.dark .dark\:bg-brand-darkBg { background-color: var(--t-bg) !important; }
html.dark .dark\:border-brand-darkBorder { border-color: var(--t-border) !important; }

.rounded-3xl { border-radius: var(--t-radius) !important; }
.shadow-xl, .shadow-lg { box-shadow: var(--t-shadow) !important; }
.shadow-2xl { box-shadow: var(--t-shadow-lg) !important; }

/* Menu lateral: item ativo em pílula suave com marcador dourado (sem gradiente pesado) */
#app-sidebar { background: color-mix(in srgb, var(--t-surface) 94%, transparent) !important; backdrop-filter: blur(10px); }
#app-sidebar .nav-item { position: relative; font-weight: 600; letter-spacing: .1px; transition: background-color .15s ease, color .15s ease; }
#app-sidebar .nav-item[aria-current="page"],
#app-sidebar .nav-item.bg-gradient-to-r {
  background: var(--t-accent-soft) !important;
  color: var(--t-accent-strong) !important;
  box-shadow: none !important;
}
#app-sidebar .nav-item[aria-current="page"]::before,
#app-sidebar .nav-item.bg-gradient-to-r::before {
  content: ""; position: absolute; left: 4px; top: 22%; bottom: 22%; width: 3px; border-radius: 3px; background: var(--t-gold);
}
#app-sidebar .nav-item:not(.bg-gradient-to-r):hover { background: var(--t-card) !important; }
#nav-recepcao:not(.bg-gradient-to-r) { background: transparent !important; border-color: transparent !important; }

/* Cabeçalho em vidro */
header.sticky { background: color-mix(in srgb, var(--t-surface) 82%, transparent) !important; backdrop-filter: blur(12px) saturate(1.2); box-shadow: none !important; }

/* Botões principais: cor sólida da marca, com leve elevação */
button.bg-gradient-to-r.from-brand-purpleDeep,
a.bg-gradient-to-r.from-brand-purpleDeep {
  background: var(--t-accent) !important;
  border-color: transparent !important;
  box-shadow: 0 6px 16px -8px rgba(91, 52, 214, .7) !important;
  transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
}
html.dark button.bg-gradient-to-r.from-brand-purpleDeep,
html.dark a.bg-gradient-to-r.from-brand-purpleDeep { background: #6d4ae8 !important; }
button.bg-gradient-to-r.from-brand-purpleDeep:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -10px rgba(91, 52, 214, .8) !important; }
button.bg-gradient-to-r.from-brand-purpleDeep:active { transform: translateY(0); }
button.bg-gradient-to-r.from-brand-purpleDeep .text-brand-gold { color: #fde68a !important; }

/* Campos */
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), select, textarea {
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):focus, select:focus, textarea:focus {
  border-color: var(--t-accent) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--t-accent) 18%, transparent) !important;
  outline: none;
}

/* Títulos com mais presença */
main h2.text-xl, main h2.text-2xl { letter-spacing: -.4px; }

/* Tela de login: cartão flutuante sobre o fundo da marca */
#view-login {
  background:
    radial-gradient(800px 500px at 15% 10%, rgba(124, 58, 237, .16), transparent 60%),
    radial-gradient(700px 500px at 90% 90%, rgba(212, 175, 55, .14), transparent 60%),
    var(--t-bg) !important;
}
#view-login > .max-w-md { box-shadow: var(--t-shadow-lg) !important; border-radius: 28px !important; }

#connection-indicator-desktop { border-radius: 999px !important; }

/* Rolagem fina e da cor da marca */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--t-accent) 35%, transparent) transparent; }

@media (prefers-reduced-motion: reduce) {
  button.bg-gradient-to-r.from-brand-purpleDeep:hover { transform: none; }
}

/* Cliente importada sem sexo informado: esconde a etiqueta vazia */
#clients-table-body span.rounded-full.font-bold:empty { display: none; }

/* ===================== CELULAR (estilo app) ===================== */
#bottom-nav, #mais-sheet, #mais-overlay, #mobile-sync { display: none; }

@media (max-width: 767px) {
  /* Topo: logo à esquerda, status e tema à direita (o menu "hambúrguer" vira a aba "Mais") */
  header.md\:hidden > button[onclick="toggleMobileMenu()"] { display: none !important; }
  header.md\:hidden { gap: 8px; }
  header.md\:hidden img { margin-right: auto; }
  #mobile-sync { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font: 700 11px/1 Montserrat, system-ui, sans-serif; color: #047857; background: #ecfdf5; }
  #mobile-sync .ms-ponto { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
  #mobile-sync[data-sync="off"] { color: #92400e; background: #fef3c7; }
  #mobile-sync[data-sync="sync"] { color: #5b21b6; background: #ede9fe; }
  html.dark #mobile-sync { background: #052e22; color: #6ee7b7; }
  html.dark #mobile-sync[data-sync="off"] { background: #3a2a05; color: #fcd34d; }
  html.dark #mobile-sync[data-sync="sync"] { background: #241540; color: #c4b5fd; }

  /* Barra de abas inferior */
  #bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--t-surface) 92%, transparent);
    backdrop-filter: blur(14px) saturate(1.3);
    border-top: 1px solid var(--t-border);
  }
  #bottom-nav > * {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 52px; border: 0; background: none; border-radius: 14px;
    color: var(--t-muted); font: 700 10.5px/1 Montserrat, system-ui, sans-serif; text-decoration: none; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  #bottom-nav svg { width: 23px; height: 23px; stroke-width: 2; transition: transform .15s ease; }
  #bottom-nav [aria-current="page"] { color: var(--t-accent); }
  #bottom-nav [aria-current="page"] svg { transform: translateY(-1px) scale(1.08); stroke-width: 2.4; }
  #bottom-nav > *:active svg { transform: scale(.9); }

  /* Espaço para a barra e para o botão "Novo" */
  #view-dashboard main { padding-bottom: calc(150px + env(safe-area-inset-bottom)) !important; }
  #mobile-fab:not([hidden]) { bottom: calc(76px + env(safe-area-inset-bottom)) !important; right: 14px !important; min-height: 50px !important; }
  #toast-wrapper { bottom: calc(140px + env(safe-area-inset-bottom)) !important; }

  /* Folha "Mais" (sobe de baixo) */
  #mais-overlay:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(10, 6, 20, .45); backdrop-filter: blur(2px); animation: overlayIn .2s ease both; }
  #mais-sheet:not([hidden]) {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 46;
    max-height: 88dvh; overflow-y: auto;
    padding: 8px 16px calc(18px + env(safe-area-inset-bottom));
    background: var(--t-surface); color: var(--t-text);
    border-radius: 26px 26px 0 0; box-shadow: 0 -20px 50px -20px rgba(0, 0, 0, .45);
    animation: sheetUp .28s cubic-bezier(.2, .8, .2, 1) both;
  }
  .ms-alca { width: 40px; height: 5px; border-radius: 99px; background: var(--t-border); margin: 4px auto 10px; }
  .ms-topo { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
  .ms-topo h2 { margin: 0; font-size: 20px; font-weight: 900; letter-spacing: -.3px; }
  .ms-topo p { margin: 2px 0 0; font-size: 12px; color: var(--t-muted); }
  .ms-fechar { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--t-card); color: var(--t-text); display: grid; place-items: center; }
  .ms-fechar svg { width: 20px; height: 20px; }
  .ms-grade { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .ms-grade > * {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    min-height: 88px; padding: 10px 6px; border-radius: 18px; border: 1px solid var(--t-border);
    background: var(--t-card); color: var(--t-text); text-decoration: none; text-align: center;
    font: 700 12px/1.2 Montserrat, system-ui, sans-serif; cursor: pointer;
  }
  .ms-grade > .hidden { display: none !important; }
  .ms-grade svg { width: 24px; height: 24px; color: var(--t-accent); }
  .ms-grade [aria-current="page"] { border-color: var(--t-accent); background: var(--t-accent-soft); }
  .ms-rodape { display: grid; gap: 8px; margin-top: 14px; }
  .ms-rodape button { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 0 16px; border-radius: 16px; border: 1px solid var(--t-border); background: none; color: var(--t-text); font: 700 14px/1 Montserrat, system-ui, sans-serif; }
  .ms-rodape svg { width: 20px; height: 20px; }
  .ms-rodape .ms-sair { color: #be123c; }
  html.dark .ms-rodape .ms-sair { color: #fda4af; }
  .ms-links { text-align: center; font-size: 12px; color: var(--t-muted); margin: 14px 0 0; }
  .ms-links a { color: var(--t-accent); font-weight: 700; }

  /* Janelas (cadastros, agendamento…) viram folhas que sobem de baixo, como nos apps */
  [id^="modal-"].fixed { align-items: flex-end !important; padding: 0 !important; }
  [id^="modal-"].fixed > div {
    width: 100% !important; max-width: none !important; margin: 0 !important;
    max-height: 92dvh !important; overflow-y: auto !important;
    border-radius: 26px 26px 0 0 !important;
    padding-bottom: calc(16px + env(safe-area-inset-bottom)) !important;
    animation: sheetUp .28s cubic-bezier(.2, .8, .2, 1) both !important;
  }

  /* Clientes: tabela vira lista de cartões (nome + WhatsApp + ações) */
  #section-clientes table thead { display: none; }
  #section-clientes table, #clients-table-body { display: block; width: 100%; }
  #clients-table-body tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 8px; row-gap: 2px; padding: 12px 14px; border-bottom: 1px solid var(--t-border); }
  #clients-table-body td { display: block; padding: 0 !important; border: 0 !important; }
  #clients-table-body td:nth-child(1) { grid-column: 1; grid-row: 1; font-size: 15px; white-space: normal; }
  #clients-table-body td:nth-child(4) { grid-column: 1; grid-row: 2; font-size: 13px; }
  #clients-table-body td:nth-child(2), #clients-table-body td:nth-child(3), #clients-table-body td:nth-child(5) { display: none; }
  #clients-table-body td:last-child { grid-column: 2; grid-row: 1 / span 2; }
  #clients-table-body td[colspan] { grid-column: 1 / -1; grid-row: auto; }

  /* Menos aperto: títulos e espaçamentos de app */
  main .tab-pane { gap: 14px; }
  main .tab-pane > * + * { margin-top: 14px !important; }
  main h2.text-xl, main h2.text-2xl { font-size: 20px !important; }
  main .p-5 { padding: 16px !important; }
}

/* Depiladora e TV: sem barra inferior */
html.modo-mural #bottom-nav, html.modo-mural #mais-sheet, html.modo-mural #mais-overlay { display: none !important; }
html.modo-mural #view-dashboard main { padding-bottom: 24px !important; }

@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { #mais-sheet, [id^="modal-"].fixed > div { animation: none !important; } }

@media (max-width: 767px) {
  /* O botão flutuante "Novo…" já cobre estas ações: some o botão repetido do topo de cada aba */
  main .tab-pane > div:first-child :is(button[onclick^="openNewAppointmentModal"], button[onclick^="openClientModal"], button[onclick^="openServiceModal"], button[onclick^="openCategoryModal"], button[onclick^="openProfessionalModal"]) { display: none !important; }
}

@media (max-width: 767px) {
  /* Caixa: espaço para a barra inferior; selo de sincronização acima dela */
  body:has(#bottom-nav):not(:has(#view-dashboard)) { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  #dc-sync-pill { bottom: calc(78px + env(safe-area-inset-bottom)) !important; }
}

/* ===================== TEMA ESCURO 60·30·10 ===================== */
html.dark body { background: var(--t-bg) !important; color: var(--t-text); }
html.dark #view-login {
  background:
    radial-gradient(700px 420px at 15% 0%, rgba(212, 175, 55, .10), transparent 60%),
    radial-gradient(600px 420px at 100% 100%, rgba(155, 109, 255, .10), transparent 60%),
    var(--t-bg) !important;
}
/* Texto: hierarquia em 3 tons (títulos, corpo, apoio) */
html.dark .dark\:text-white, html.dark .text-slate-900.dark\:text-white { color: var(--t-text) !important; }
html.dark .dark\:text-slate-200, html.dark .dark\:text-slate-300 { color: #ddd7e6 !important; }
html.dark .dark\:text-slate-400, html.dark .text-slate-400, html.dark .text-slate-500, html.dark .text-brand-lightMuted { color: var(--t-muted) !important; }

/* Ação principal = dourado (os 10%) */
html.dark button.bg-gradient-to-r.from-brand-purpleDeep,
html.dark a.bg-gradient-to-r.from-brand-purpleDeep,
html.dark #mobile-fab:not([hidden]),
html.dark .bg-brand-violet:is(button, a) {
  background: linear-gradient(180deg, #e2c260, #c9a12e) !important;
  color: var(--t-on-accent) !important;
  border-color: transparent !important;
  box-shadow: 0 8px 20px -10px rgba(212, 175, 55, .55) !important;
}
html.dark button.bg-gradient-to-r.from-brand-purpleDeep :is(svg, span, i),
html.dark #mobile-fab svg,
html.dark .bg-brand-violet:is(button, a) :is(svg, span) { color: var(--t-on-accent) !important; }
html.dark button.bg-gradient-to-r.from-brand-purpleDeep:hover { filter: brightness(1.06); }

/* Menu lateral, barra inferior e filtros: item ativo em dourado */
html.dark #app-sidebar { background: var(--t-surface) !important; border-color: var(--t-border) !important; }
html.dark #app-sidebar .nav-item[aria-current="page"],
html.dark #app-sidebar .nav-item.bg-gradient-to-r { background: var(--t-accent-soft) !important; color: var(--t-accent-strong) !important; }
html.dark #app-sidebar .nav-item.bg-gradient-to-r svg { color: var(--t-accent) !important; }
html.dark #app-sidebar .nav-item:not(.bg-gradient-to-r) { color: #cfc8da !important; }
html.dark #app-sidebar .nav-item svg { color: var(--t-muted) !important; }
html.dark #bottom-nav { background: color-mix(in srgb, var(--t-surface) 94%, transparent); }
html.dark #bottom-nav [aria-current="page"] { color: var(--t-accent) !important; }
html.dark .md-filtros button[aria-selected="true"] { background: var(--t-accent) !important; color: var(--t-on-accent) !important; box-shadow: 0 6px 14px -8px rgba(212, 175, 55, .6); }
html.dark .client-gender-btn.bg-brand-violet { background: var(--t-accent) !important; color: var(--t-on-accent) !important; }
html.dark .ms-grade [aria-current="page"] { border-color: var(--t-accent); background: var(--t-accent-soft); }
html.dark .ms-grade svg { color: var(--t-accent); }

/* Cabeçalho e superfícies */
html.dark header.sticky { background: color-mix(in srgb, var(--t-bg) 85%, transparent) !important; border-color: var(--t-border) !important; }
html.dark .md-resumo, html.dark .md-card { background: var(--t-surface); }
html.dark .md-hora { background: var(--t-accent-soft); color: var(--t-accent-strong); }
html.dark .md-card:not(.md-chegou) { border-left-color: var(--t-accent); }

/* Campos */
html.dark input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),
html.dark textarea { color: var(--t-text) !important; }
/* select mantém a cor própria (ex.: status verde/âmbar do agendamento) */
html.dark input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),
html.dark select, html.dark textarea { background-color: #110f16 !important; border-color: var(--t-border) !important; }
html.dark input::placeholder, html.dark textarea::placeholder { color: #7d7689 !important; }
html.dark input:focus, html.dark select:focus, html.dark textarea:focus {
  border-color: var(--t-accent) !important; box-shadow: 0 0 0 3px rgba(212, 175, 55, .18) !important;
}

/* Destaques e números em dourado; roxo da logo nos detalhes */
html.dark .text-brand-gold { color: var(--t-accent) !important; }
html.dark .text-brand-violet, html.dark .dark\:text-brand-violetLight { color: var(--t-purple) !important; }

/* Interruptor de tema no escuro: grafite com aro dourado */
html.dark .theme-switch-track { background: linear-gradient(135deg, #1c1924, #2a2533) !important; border-color: rgba(212, 175, 55, .45) !important; }

/* Folhas e janelas */
html.dark #mais-sheet:not([hidden]), html.dark [id^="modal-"].fixed > div { background: var(--t-surface) !important; }
html.dark .ms-grade > *, html.dark .ms-fechar { background: var(--t-card); border-color: var(--t-border); }

* { scrollbar-color: color-mix(in srgb, var(--t-accent) 35%, transparent) transparent; }

/* ===================== CELULAR: demais páginas ===================== */
@media (max-width: 767px) {
  /* Tabelas comuns viram cartões: rótulo da coluna à esquerda, valor à direita */
  table.tabela-cartoes { min-width: 0 !important; width: 100%; }
  table.tabela-cartoes thead { display: none; }
  table.tabela-cartoes, table.tabela-cartoes tbody { display: block; }
  table.tabela-cartoes tbody tr { display: block; padding: 10px 14px; border-bottom: 1px solid var(--t-border); }
  table.tabela-cartoes tbody td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 5px 0 !important; border: 0 !important; text-align: right !important; font-size: 13px; min-width: 0; }
  table.tabela-cartoes tbody td[data-label]::before { content: attr(data-label); flex-shrink: 0; text-align: left; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; color: var(--t-muted); }
  table.tabela-cartoes tbody td:first-child { font-size: 15px; font-weight: 800; }
  table.tabela-cartoes tbody td:first-child::before { display: none; }
  table.tabela-cartoes tbody td:first-child { justify-content: flex-start; text-align: left !important; }
  table.tabela-cartoes tbody td[colspan] { display: block; text-align: center !important; }
  table.tabela-cartoes tbody td > * { max-width: 70%; }
  table.tabela-cartoes tbody td:first-child > * { max-width: 100%; }

  /* Caixa: botões do topo em grade (sem fileira com rolagem lateral) */
  body:has(#pos-items-table-body) > header { gap: 10px !important; }
  body:has(#pos-items-table-body) > header > div:last-child {
    display: grid !important; grid-template-columns: repeat(3, 1fr); gap: 8px !important; overflow: visible !important; padding-bottom: 0 !important;
  }
  body:has(#pos-items-table-body) > header > div:last-child > button:not(.theme-switch-track) {
    flex-direction: column; justify-content: center; gap: 4px !important; min-height: 58px; padding: 8px 4px !important;
    white-space: normal !important; text-align: center; font-size: 11px !important; line-height: 1.15; border-radius: 14px !important;
  }
  body:has(#pos-items-table-body) > header > div:last-child > button:not(.theme-switch-track) svg { width: 18px !important; height: 18px !important; }
  /* status e "Agenda" já estão no topo/barra inferior; o tema vai para a linha do logo */
  body:has(#pos-items-table-body) > header > div:last-child > a[href="index.html"] { display: none !important; }
  body:has(#pos-items-table-body) > header > div:last-child > #connection-status-pos { grid-column: 1 / -1; justify-self: center; padding: 4px 12px !important; }
  body:has(#pos-items-table-body) > header > div:last-child > .theme-switch-track { position: absolute !important; top: 12px; right: 16px; }
  body:has(#pos-items-table-body) > header { position: relative; }
  #dc-sync-pill { display: none !important; }

  /* Páginas de texto (privacidade, termos) */
  body > main.max-w-3xl, body > main.max-w-4xl { padding-left: 16px !important; padding-right: 16px !important; }
}

@media (max-width: 767px) {
  /* Formulários: nada de 3 colunas espremidas no celular */
  #section-configuracoes .grid:not(.grid-cols-1),
  [id^="modal-"] form .grid.grid-cols-3,
  [id^="modal-"] form .grid.sm\:grid-cols-3 { grid-template-columns: 1fr 1fr !important; }
  #section-configuracoes .grid > .col-span-2,
  #section-configuracoes .grid > [class*="col-span-2"] { grid-column: 1 / -1; }
  #section-configuracoes input, #section-configuracoes select, #section-configuracoes textarea { font-size: 16px !important; } /* evita zoom automático do iPhone */
}
@media (max-width: 400px) {
  #section-configuracoes .grid:not(.grid-cols-1) { grid-template-columns: 1fr !important; }
}
@media (max-width: 767px) {
  /* iPhone dá zoom sozinho em campos com letra menor que 16px: fixa 16px em todos */
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), select, textarea { font-size: 16px !important; }
}
@media (max-width: 767px) {
  /* Letras miúdas do desktop (9–11px) ficam legíveis no celular */
  .text-\[9px\], .text-\[10px\], .text-\[10\.5px\] { font-size: 11.5px !important; }
  .text-\[11px\] { font-size: 12px !important; }
  .text-xs { font-size: 13px !important; line-height: 1.45 !important; }
}

/* ===== WhatsApp: aviso de pendentes e fila ===== */
#wpp-fila-aviso { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 16px; border-radius: 16px; border: 1px solid #a7f3d0; background: #ecfdf5; color: #065f46; font: 600 14px/1.3 Montserrat, system-ui, sans-serif; text-align: left; cursor: pointer; }
#wpp-fila-aviso[hidden] { display: none; }
#wpp-fila-aviso svg { width: 20px; height: 20px; flex-shrink: 0; }
#wpp-fila-aviso .wpp-ver { margin-left: auto; padding: 6px 12px; border-radius: 999px; background: #10b981; color: #fff; font-weight: 800; font-size: 13px; }
html.dark #wpp-fila-aviso { background: #062a20; border-color: #065f46; color: #a7f3d0; }
#wpp-modal .wpp-modo { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; margin: 0 0 12px; }
#wpp-modal .wpp-modo select { flex: 1; }
#wpp-modal .wpp-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
#wpp-modal .wpp-lista > li { padding: 12px 14px; border-radius: 16px; border: 1px solid var(--t-border); background: var(--t-card); }
#wpp-modal .wpp-cab { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
#wpp-modal .wpp-cab strong { font-size: 15px; }
#wpp-modal .wpp-cab span { font-size: 11px; font-weight: 700; color: var(--t-muted); }
#wpp-modal .wpp-texto { white-space: pre-line; font-size: 13px; line-height: 1.45; margin: 8px 0 10px; max-height: 7.5em; overflow: auto; color: var(--t-text); }
#wpp-modal .wpp-acoes { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
#wpp-modal .wpp-acoes button { min-height: 44px; padding: 0 14px; border-radius: 14px; font-weight: 700; font-size: 13px; border: 1px solid var(--t-border); display: inline-flex; align-items: center; gap: 6px; }
#wpp-modal .wpp-enviar { background: #16a34a !important; color: #fff !important; border-color: transparent !important; }
#wpp-modal .wpp-enviar svg { width: 16px; height: 16px; }
#wpp-modal .wpp-feito { opacity: .6; }
#wpp-modal .wpp-ok { color: #047857; font-weight: 800; font-size: 13px; }
html.dark #wpp-modal .wpp-ok { color: #6ee7b7; }
#wpp-modal .wpp-vazio { text-align: center; padding: 24px; color: var(--t-muted); font-weight: 700; }
@media (max-width: 767px) {
  :is(#imp-modal, #wpp-modal) { place-items: end stretch !important; padding: 0 !important; }
  :is(#imp-modal, #wpp-modal) .imp-caixa { max-width: none !important; border-radius: 26px 26px 0 0 !important; max-height: 92dvh !important; padding-bottom: calc(16px + env(safe-area-inset-bottom)) !important; animation: sheetUp .28s cubic-bezier(.2,.8,.2,1) both !important; }
  #wpp-modal .wpp-acoes button { flex: 1; justify-content: center; }
}

/* WhatsApp: barra "o app não abriu" e destaque da próxima mensagem */
#wpp-fallback { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 90; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; max-width: calc(100% - 24px); padding: 10px 12px 10px 16px; border-radius: 18px; background: var(--t-surface); color: var(--t-text); border: 1px solid var(--t-border); box-shadow: var(--t-shadow-lg); font: 600 13px/1.3 Montserrat, system-ui, sans-serif; }
#wpp-fallback button { min-height: 40px; padding: 0 14px; border-radius: 12px; border: 0; background: #16a34a; color: #fff; font-weight: 800; }
#wpp-fallback .wpp-fb-x { background: transparent; color: var(--t-muted); font-size: 20px; padding: 0 8px; }
@media (max-width: 767px) { #wpp-fallback { bottom: calc(84px + env(safe-area-inset-bottom)); } }
#wpp-modal .wpp-proxima { border-color: #16a34a; box-shadow: 0 0 0 2px rgba(22, 163, 74, .25); }

/* ===================== LOGIN PROFISSIONAL ===================== */
#view-login.lg-tela { min-height: 100dvh; width: 100%; display: grid; grid-template-columns: 1fr; background: var(--t-bg) !important; }
.lg-marca {
  position: relative; overflow: hidden; color: #fff; padding: 20px 20px 22px;
  background:
    radial-gradient(500px 300px at 110% -10%, rgba(212, 175, 55, .35), transparent 60%),
    radial-gradient(500px 360px at -20% 120%, rgba(124, 58, 237, .55), transparent 60%),
    linear-gradient(160deg, #17102a 0%, #0c0b0f 70%);
}
.lg-marca-topo { display: flex; justify-content: center; }
.lg-logo { width: 190px; height: auto; background: #fff; border-radius: 18px; padding: 10px 14px; box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .7); }
.lg-marca-meio, .lg-rodape-marca { display: none; }
.lg-selo { display: inline-block; margin: 0 0 14px; padding: 5px 12px; border-radius: 999px; border: 1px solid rgba(212, 175, 55, .5); color: #e7c766; font: 800 11px/1 Montserrat, system-ui, sans-serif; letter-spacing: 1.2px; text-transform: uppercase; }
.lg-titulo { margin: 0 0 22px; font: 900 32px/1.15 Montserrat, system-ui, sans-serif; letter-spacing: -.8px; max-width: 460px; }
.lg-recursos { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; max-width: 440px; }
.lg-recursos li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.45; color: #d9d3e4; }
.lg-recursos b { color: #fff; }
.lg-recursos svg { flex-shrink: 0; width: 22px; height: 22px; padding: 8px; box-sizing: content-box; border-radius: 12px; background: rgba(212, 175, 55, .14); color: #e7c766; }
.lg-rodape-marca { font-size: 12px; color: #9d95ad; margin: 0; }

.lg-form-area { display: flex; flex-direction: column; align-items: center; padding: 0 16px calc(24px + env(safe-area-inset-bottom)); }
.lg-barra { width: 100%; max-width: 440px; display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 14px 0; }
.lg-status { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--t-border); background: var(--t-surface); font: 700 12px/1 Montserrat, system-ui, sans-serif; color: var(--t-muted); }
.lg-ponto { width: 8px; height: 8px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, .2); }
.lg-cartao { width: 100%; max-width: 440px; margin-top: -4px; padding: 26px 22px; border-radius: 26px; background: var(--t-surface); border: 1px solid var(--t-border); box-shadow: var(--t-shadow-lg); }
.lg-logo-celular { display: none; }
.lg-h2 { margin: 0; font: 900 26px/1.2 Montserrat, system-ui, sans-serif; letter-spacing: -.5px; color: var(--t-text); }
.lg-sub { margin: 6px 0 22px; font-size: 14px; color: var(--t-muted); }
.lg-form { display: grid; gap: 16px; }
.lg-campo label { display: block; margin-bottom: 6px; font: 700 13px/1 Montserrat, system-ui, sans-serif; color: var(--t-text); }
.lg-input { position: relative; display: flex; align-items: center; }
.lg-input > svg { position: absolute; left: 14px; width: 18px; height: 18px; color: var(--t-muted); pointer-events: none; }
.lg-input input { width: 100%; min-height: 52px; padding: 0 48px 0 44px; border-radius: 16px; border: 1px solid var(--t-border); background: var(--t-card); color: var(--t-text); font: 500 16px/1 Montserrat, system-ui, sans-serif; }
.lg-input input::placeholder { color: var(--t-muted); opacity: .8; }
.lg-olho { position: absolute; right: 4px; width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: none; color: var(--t-muted); border-radius: 12px; cursor: pointer; }
.lg-olho svg { width: 18px; height: 18px; }
.lg-linha { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.lg-lembrar { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font: 700 14px/1 Montserrat, system-ui, sans-serif; color: var(--t-text); cursor: pointer; }
.lg-lembrar input { width: 20px; height: 20px; accent-color: var(--t-accent); }
.lg-esqueci { font-size: 12px; color: var(--t-muted); }
.lg-erro { margin: 0; padding: 10px 12px; border-radius: 12px; font-size: 13px; font-weight: 600; border: 1px solid; }
.lg-caps { margin: 0; font-size: 12px; font-weight: 700; }
.lg-entrar {
  min-height: 54px; border: 0; border-radius: 16px; display: flex; align-items: center; justify-content: center; gap: 8px;
  font: 800 15px/1 Montserrat, system-ui, sans-serif; letter-spacing: .3px; cursor: pointer;
  background: var(--t-accent); color: #fff; box-shadow: 0 12px 26px -12px rgba(91, 52, 214, .8); transition: transform .12s ease, filter .12s ease;
}
html.dark .lg-entrar { background: linear-gradient(180deg, #e2c260, #c9a12e); color: #1a1405; box-shadow: 0 12px 26px -12px rgba(212, 175, 55, .6); }
.lg-entrar svg { width: 18px; height: 18px; }
.lg-entrar:hover { filter: brightness(1.06); transform: translateY(-1px); }
.lg-entrar[disabled] { opacity: .7; cursor: wait; transform: none; }
.lg-termos { margin: 18px 0 0; font-size: 12px; line-height: 1.55; color: var(--t-muted); text-align: center; }
.lg-termos a { color: var(--t-accent); font-weight: 700; text-decoration: underline; }
html.dark .lg-termos a { color: var(--t-accent-strong); }
.lg-seguro { display: flex; align-items: center; gap: 6px; margin: 16px 0 0; font-size: 12px; color: var(--t-muted); }
.lg-seguro svg { width: 14px; height: 14px; }

/* Computador: marca à esquerda, formulário à direita */
@media (min-width: 1024px) {
  #view-login.lg-tela { grid-template-columns: minmax(420px, 1.05fr) 1fr; }
  .lg-marca { display: flex; flex-direction: column; justify-content: space-between; padding: 40px 48px; min-height: 100dvh; }
  .lg-marca-topo { justify-content: flex-start; }
  .lg-marca-meio, .lg-rodape-marca { display: block; }
  .lg-logo { width: 210px; }
  .lg-form-area { justify-content: center; padding: 24px 40px; }
  .lg-barra { position: absolute; top: 18px; right: 28px; width: auto; }
  .lg-cartao { padding: 36px 34px; margin-top: 0; }
}
/* Celular: faixa da marca curta no topo, cartão sobe um pouco sobre ela */
@media (max-width: 1023px) {
  .lg-marca { padding-bottom: 54px; }
  .lg-form-area { margin-top: -40px; position: relative; }
  .lg-barra { position: absolute; top: -96px; right: 16px; width: auto; padding: 0; }
  .lg-marca-topo { padding-top: env(safe-area-inset-top); justify-content: flex-start; }
  .lg-logo { width: 150px; padding: 8px 10px; border-radius: 14px; }
  .lg-barra { top: -100px; }
}
@media (max-width: 380px) { .lg-logo { width: 140px; } .lg-cartao { padding: 22px 18px; } }
