/* Tema Bento Dark Glass 100% fluido (tela cheia em monitores, notebooks, tablets e celulares) */
:root {
  --outer-bg: #16161a;
  --rail-bg: #101013;
  --card: rgba(255, 255, 255, 0.055);
  --card-inner: rgba(255, 255, 255, 0.065);
  --row-bg: rgba(255, 255, 255, 0.06);
  --row-hover: rgba(255, 255, 255, 0.095);
  --input-bg: rgba(16, 16, 20, 0.6);
  --ink: #f4f4f6;
  --muted: #a1a1aa;
  --line: rgba(255, 255, 255, 0.09);
  --accent: #ff6a1a;
  --accent-glow: rgba(255, 106, 26, 0.22);
  --lime: #d9f270;
  --danger: #f87171;
  --danger-bg: rgba(248, 113, 113, 0.16);
  --warn: #fbbf24;
  --warn-bg: rgba(251, 191, 36, 0.16);
  --ok: #4ade80;
  --ok-bg: rgba(74, 222, 128, 0.16);
  --cyan: #38bdf8;
  --pink: #f472b6;
  --f-sans: "Plus Jakarta Sans", "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --r-card: 22px;
  --r-row: 16px;
  --r-inp: 12px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  -webkit-text-size-adjust: 100%;
  width: 100%;
  min-height: 100%;
}

body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(60vw circle at 28% 18%, var(--accent-glow), transparent 65%),
    radial-gradient(50vw circle at 85% 12%, rgba(217, 242, 112, 0.05), transparent 60%),
    linear-gradient(165deg, #27272e 0%, #1e1e24 55%, #17171c 100%);
  background-attachment: fixed;
  color: var(--ink);
  font: 15px/1.45 var(--f-sans);
}

/* Aplicativo ocupa 100% da janela sem bordas desperdiçadas */
.app-shell {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(12px, 1.6vw, 24px);
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: clamp(14px, 1.8vw, 24px);
  align-items: start;
}

.app-shell.modo-login {
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  justify-items: center;
  padding: 20px;
}

.app-shell.modo-mestre {
  grid-template-columns: minmax(0, 1fr);
}

/* Barra lateral esquerda em cápsula ajustada exatamente à altura da tela */
aside.rail {
  background: var(--rail-bg);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 24px;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: clamp(12px, 1.6vw, 24px);
  height: calc(100vh - 2 * clamp(12px, 1.6vw, 24px));
  height: calc(100dvh - 2 * clamp(12px, 1.6vw, 24px));
  overflow-y: auto;
  scrollbar-width: none;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.38);
}
aside.rail::-webkit-scrollbar { display: none; }

.rail-brand {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  flex-shrink: 0;
}

.rail-brand img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  padding: 3px;
}

.rail-nav, .rail-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.rail-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  color: #9ca3af;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.rail-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.rail-btn[aria-pressed="true"] {
  color: #fff;
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.rail-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rail-dot {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

/* Área principal fluida */
.workspace {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 1.6vw, 20px);
  min-width: 0;
  padding-bottom: 92px;
}

.app-shell.modo-login .workspace {
  padding-bottom: 0;
  align-items: center;
}

header.workspace-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.workspace-title { min-width: 0; flex: 1 1 200px; }

.workspace-title h1 {
  margin: 0;
  font-size: clamp(1.3rem, 2.2vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.workspace-title .sub {
  color: var(--muted);
  font-size: 0.82rem;
  display: block;
  margin-top: 2px;
}

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

.icon-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.icon-circle:hover { background: rgba(255, 255, 255, 0.1); }
.icon-circle svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.9; }

.avatar-pill {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #18181b);
  border: 2px solid rgba(255, 255, 255, 0.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.88rem;
  color: #fff;
  overflow: hidden;
  flex-shrink: 0;
}
.avatar-pill img { width: 100%; height: 100%; object-fit: contain; background: #fff; padding: 2px; }

/* ===== BENTO DASHBOARD (Visão Geral) ===== */
.bento-top {
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(0, 1fr);
  gap: clamp(14px, 1.6vw, 18px);
}

.hero-bento {
  background:
    radial-gradient(320px circle at 78% 38%, var(--accent-glow), transparent 72%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.035) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--r-card);
  padding: clamp(18px, 2.2vw, 26px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.hero-bento::before {
  content: "";
  position: absolute;
  right: -40px;
  top: 6px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 32px rgba(255, 255, 255, 0.02);
  pointer-events: none;
}

.hero-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.hero-copy { min-width: 0; flex: 1; }

.hero-copy .eyebrow {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.74);
  letter-spacing: 0.02em;
  display: block;
  margin-bottom: 6px;
}

.hero-copy h2 {
  margin: 0 0 16px 0;
  font-size: clamp(1.4rem, 2.5vw, 2.2rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
}

.hero-emblem {
  width: clamp(68px, 7.5vw, 104px);
  height: clamp(68px, 7.5vw, 104px);
  border-radius: 22px;
  background: radial-gradient(circle at 30% 30%, var(--accent), rgba(0, 0, 0, 0.38));
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.32);
  flex-shrink: 0;
  overflow: hidden;
}
.hero-emblem img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  padding: 6px;
}
.hero-emblem svg {
  width: 48%;
  height: 48%;
  stroke: #fff;
  fill: none;
  stroke-width: 1.7;
}

.hero-metrics {
  position: relative;
  z-index: 1;
  background: rgba(18, 18, 23, 0.5);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  align-items: center;
  gap: 12px;
}

.hm-item { min-width: 0; }

.hm-item strong {
  display: block;
  font-size: clamp(1.08rem, 1.7vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hm-item .hm-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.72);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.hm-bar {
  height: 2px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 2px;
  margin-top: 7px;
  overflow: hidden;
}
.hm-bar > i {
  display: block;
  height: 100%;
  border-radius: 2px;
}

.hm-go {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: #111114;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hm-go:hover { background: var(--accent); color: #111; }

.bento-right-stack {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: clamp(14px, 1.6vw, 18px);
  min-width: 0;
}

.bento-card {
  background: var(--card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: clamp(16px, 1.8vw, 20px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.bento-card h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chart-box {
  position: relative;
  height: 112px;
  width: 100%;
  min-width: 0;
}
.chart-box svg {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-axis {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--muted);
  padding: 0 4px;
}

.split-highlight {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 12px;
  align-items: stretch;
  height: 100%;
}

.lime-value {
  font-size: clamp(1.35rem, 2vw, 1.85rem);
  font-weight: 700;
  color: var(--lime);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  margin: 4px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sub-showcase {
  background: var(--card-inner);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  min-width: 0;
}
.sub-showcase .sc-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(17, 17, 20, 0.65);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.sub-showcase strong {
  font-size: 0.85rem;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sub-showcase small { font-size: 0.74rem; color: var(--muted); }

/* Lista inferior */
.bento-list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.select-pill {
  width: auto;
  max-width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.85rem;
  color: var(--ink);
}

.bento-cols-header {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr) minmax(0, 1fr) 90px auto;
  gap: 12px;
  padding: 2px 14px 8px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 0.75rem;
  color: var(--muted);
}

.bento-rows { display: grid; gap: 9px; }

.bento-row {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr) minmax(0, 1fr) 90px auto;
  gap: 12px;
  align-items: center;
  background: var(--row-bg);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--r-row);
  padding: 11px 14px;
  transition: background 0.15s;
}
.bento-row:hover { background: var(--row-hover); }

.br-main {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.br-thumb {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #17171c;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.76rem;
  color: var(--accent);
  flex-shrink: 0;
}
.br-title { min-width: 0; }
.br-title strong {
  display: block;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.br-title small {
  display: block;
  color: var(--muted);
  font-size: 0.77rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.br-stat {
  font-size: 0.84rem;
  display: flex;
  align-items: center;
  gap: 6px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ===== CARTÕES E FORMULÁRIOS INTERNOS ===== */
main.view-grid {
  display: grid;
  gap: clamp(14px, 1.6vw, 18px);
  width: 100%;
  min-width: 0;
}

main.login-wrap {
  width: 100%;
  max-width: 400px;
}

section.card {
  background: var(--card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: clamp(15px, 2vw, 22px);
  display: grid;
  gap: 14px;
  min-width: 0;
}

section.card h2 {
  font-size: 1.06rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

section.card h2 small {
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 175px), 1fr));
}
.grid .wide { grid-column: 1 / -1; }

label {
  display: grid;
  gap: 5px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
  min-width: 0;
}

label.check-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--ink);
  cursor: pointer;
}
label.check-inline input { width: auto; flex-shrink: 0; }

input, select, textarea {
  font: 500 0.95rem var(--f-sans);
  color: var(--ink);
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: var(--r-inp);
  padding: 10px 12px;
  width: 100%;
  min-width: 0;
}
input[type="color"] {
  padding: 4px;
  height: 42px;
  cursor: pointer;
}
textarea { resize: vertical; min-height: 74px; }
input:focus, select:focus, textarea:focus, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.num { text-align: right; font-variant-numeric: tabular-nums; }

.btn {
  font: 600 0.88rem var(--f-sans);
  border-radius: 999px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  width: auto;
  max-width: 100%;
  transition: transform 0.12s, background 0.15s;
}
.btn:hover { background: rgba(255, 255, 255, 0.13); }
.btn:active { transform: scale(0.98); }

.btn.white-pill {
  background: #ffffff;
  border-color: #ffffff;
  color: #111114;
  font-weight: 700;
  padding: 10px 20px;
}
.btn.white-pill:hover { background: #eaeaf0; }

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 700;
}
.btn.dark {
  background: #141418;
  border-color: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); border-color: rgba(248, 113, 113, 0.35); background: transparent; }
.btn.small { padding: 6px 12px; font-size: 0.79rem; }

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

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.69rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: 0.03em;
}
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.neutral { background: rgba(255, 255, 255, 0.08); color: var(--muted); border: 1px solid var(--line); }

.kpis {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 145px), 1fr));
}
.kpi {
  background: var(--row-bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  min-width: 0;
}
.kpi small { display: block; font-size: 0.73rem; color: var(--muted); }
.kpi strong { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; display: block; overflow-wrap: anywhere; }

.lista-cards { display: grid; gap: 10px; }
.card-linha {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 14px;
  padding: 14px 15px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--r-row);
  background: var(--row-bg);
  min-width: 0;
}
.card-linha:hover { background: var(--row-hover); }
.card-linha .meta { font-size: 0.81rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 5px 12px; margin-top: 4px; }
.card-linha .preco-destaque { font-size: 1.15rem; font-weight: 700; color: var(--lime); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.card-linha .saldo-destaque { font-size: 0.8rem; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.card-linha .row-actions { grid-column: 1 / -1; margin-top: 2px; }

.item {
  display: grid;
  gap: 10px;
  grid-template-columns: 140px minmax(0, 1fr) 92px 140px 110px auto;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--row-bg);
  min-width: 0;
}
.item .total { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--lime); padding: 10px 0; text-align: right; white-space: nowrap; }
.item .del { border: none; background: transparent; color: var(--danger); font-size: 1.4rem; line-height: 1; padding: 8px; cursor: pointer; width: auto; }
.item .hint { grid-column: 1 / -1; font-size: 0.76rem; color: var(--muted); margin-top: -4px; }

.quick { display: flex; flex-wrap: wrap; gap: 7px; }
.quick button {
  font: 600 0.8rem var(--f-sans);
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  width: auto;
}
.quick button:hover { border-color: var(--accent); color: #fff; }

.sum { display: grid; gap: 7px; font-variant-numeric: tabular-nums; }
.sum div { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); }
.sum div span:last-child { color: var(--ink); font-weight: 600; }
.sum .grand { font-size: 1.4rem; font-weight: 700; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; color: var(--ink); }
.sum .grand span:last-child { color: var(--lime); }

.internal {
  background: rgba(17, 17, 20, 0.5);
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 11px 14px;
  font-size: 0.87rem;
  color: var(--muted);
}
.internal b { color: var(--ok); }

.swatches { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  padding: 0;
}
.swatch:hover { transform: scale(1.1); }

.cor-painel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  background: var(--row-bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}
.cor-roda-box { display: grid; gap: 8px; justify-items: center; }
.cor-roda-wrap {
  position: relative;
  width: 144px;
  height: 144px;
  border-radius: 50%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}
.cor-roda-wrap canvas {
  display: block;
  width: 144px;
  height: 144px;
  border-radius: 50%;
  cursor: crosshair;
  touch-action: none;
}
.cor-ponteiro {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2.5px solid #fff;
  box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.75);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.cor-controles { display: grid; gap: 10px; min-width: 0; }
.cor-hex-row { display: flex; align-items: center; gap: 8px; }
.cor-amostra {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  flex-shrink: 0;
}
@media (max-width: 540px) {
  .cor-painel { grid-template-columns: minmax(0, 1fr); }
}

/* Barra inferior flutuante na aba Orçamento */
.bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 16px;
  width: min(760px, calc(100vw - 32px));
  background: rgba(17, 17, 20, 0.94);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: #fff;
  padding: 10px 14px 10px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 12;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
}
.bar .t { flex: 1; min-width: 0; }
.bar .t small { display: block; color: var(--muted); font-size: 0.69rem; text-transform: uppercase; letter-spacing: 0.05em; }
.bar .t strong { font-size: 1.25rem; font-weight: 700; color: var(--lime); font-variant-numeric: tabular-nums; }

.modal-fundo {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}
.modal-caixa {
  background: #25252b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  padding: clamp(16px, 2.5vw, 22px);
  display: grid;
  gap: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}
.modal-caixa h3 {
  margin: 0;
  font-size: 1.08rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.chips-editaveis { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--row-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.84rem;
}
.chip button { border: none; background: transparent; color: var(--danger); cursor: pointer; font-weight: 700; padding: 0 2px; width: auto; }

.linha-config {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto;
  align-items: center;
  background: var(--row-bg);
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
}

.empty { color: var(--muted); text-align: center; padding: 24px 12px; }
.logo-prev { max-height: 64px; max-width: 180px; width: auto; height: auto; object-fit: contain; border-radius: 10px; background: rgba(255, 255, 255, 0.08); padding: 4px; border: 1px solid var(--line); }

.logo-editor-palco {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  border-radius: 16px;
  border: 1px dashed var(--line);
  background: repeating-conic-gradient(#2c2c34 0% 25%, #23232a 0% 50%) 50% / 16px 16px;
}
.logo-editor-palco canvas {
  max-width: 100%;
  max-height: 240px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: grab;
  touch-action: none;
}
.logo-editor-palco canvas:active { cursor: grabbing; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%);
  background: #fff;
  color: #111114;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 700;
  z-index: 40;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  max-width: 92vw;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
.toast.on { opacity: 1; }

/* ===== TABLETS E NOTEBOOKS COM ZOOM (até 1120px) ===== */
@media (max-width: 1120px) {
  .bento-top {
    grid-template-columns: minmax(0, 1fr);
  }
  .bento-right-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto;
  }
  .bento-cols-header,
  .bento-row {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto;
  }
  .bento-cols-header span:nth-child(4),
  .bento-row .br-spark {
    display: none;
  }
}

@media (max-width: 960px) {
  .item {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .item .f-desc { grid-column: 1 / -1; order: -1; }
  .item .f-tipo { grid-column: 1 / -1; }
  .item .f-qtd, .item .f-unit { grid-column: span 1; }
  .item .total { grid-column: 1 / 2; text-align: left; }
  .item .del { justify-self: end; }
}

/* ===== TABLETS EM RETRATO E CELULARES (até 780px) ===== */
@media (max-width: 780px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
    padding: 12px 12px calc(86px + env(safe-area-inset-bottom, 0px)) 12px;
  }
  aside.rail {
    position: fixed;
    top: auto;
    bottom: max(8px, env(safe-area-inset-bottom, 0px));
    left: 10px;
    right: 10px;
    height: 58px;
    flex-direction: row;
    justify-content: space-between;
    padding: 6px 10px;
    border-radius: 999px;
    z-index: 16;
    overflow: visible;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.72);
  }
  .rail-brand { display: none; }
  .rail-nav, .rail-bottom { flex-direction: row; gap: 4px; }
  .workspace { padding-bottom: 84px; }
  .bar {
    bottom: calc(74px + env(safe-area-inset-bottom, 0px));
    width: calc(100vw - 20px);
    padding: 8px 10px 8px 16px;
  }
  .toast { bottom: calc(140px + env(safe-area-inset-bottom, 0px)); }
  .bento-right-stack { grid-template-columns: minmax(0, 1fr); }
  .bento-cols-header { display: none; }
  .bento-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px 10px;
  }
  .bento-row .br-main { grid-column: 1 / -1; }
  .linha-config { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

  /* Evita zoom automático do navegador no celular ao tocar num campo */
  input, select, textarea { font-size: 16px; }
}

/* ===== CELULARES COMPACTOS (até 540px) ===== */
@media (max-width: 540px) {
  .hero-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hm-go { display: none; }
  .hero-emblem { width: 58px; height: 58px; border-radius: 16px; }
  .split-highlight { grid-template-columns: minmax(0, 1fr); }
  .card-linha { grid-template-columns: minmax(0, 1fr); }
  .card-linha .preco-destaque,
  .card-linha .saldo-destaque { text-align: left; }
  .linha-config { grid-template-columns: minmax(0, 1fr); }
}

/* ===== CELULARES ESTREITOS (até 420px) ===== */
@media (max-width: 420px) {
  aside.rail { left: 8px; right: 8px; padding: 6px 8px; gap: 2px; }
  .rail-nav, .rail-bottom { gap: 2px; }
  .rail-btn { width: 38px; height: 38px; border-radius: 12px; }
  .bento-row { grid-template-columns: minmax(0, 1fr) auto; }
}
