/* O navegador da página inicial e os ecrãs do ERP desenhados dentro dele.
   Tudo é medido em "em" a partir de .browser, para encolher como uma imagem. */

.browser {
  --s: 1;
  font-size: calc(10px * var(--s));
  width: 64em;
  max-width: 100%;
  border: 1.5px solid var(--rule-strong);
  border-radius: 12px;
  overflow: hidden;
  background: var(--app-bg);
  box-shadow: 10px 10px 0 -1px var(--rule), var(--shadow);
}

.br-bar {
  display: flex;
  align-items: center;
  gap: 0.8em;
  height: 3.2em;
  padding: 0 1.2em;
  background: var(--sheet);
  border-bottom: 1px solid var(--rule);
}

.br-dots { display: flex; gap: 0.5em; }
.br-dots i { width: 1em; height: 1em; border-radius: 50%; background: var(--rule); }
.br-dots i:nth-child(1) { background: #f87171; }
.br-dots i:nth-child(2) { background: #fbbf24; }
.br-dots i:nth-child(3) { background: #4ade80; }

.br-url {
  flex: 1;
  max-width: 30em;
  margin: 0 auto;
  height: 2.1em;
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding: 0 1em;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-3);
  font-size: 1.1em;
}

.br-body {
  height: 40em;
  position: relative;
  overflow: hidden;
}

.app {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 15em 1fr;
  color: var(--app-text);
  font-size: 1em;
  line-height: 1.35;
}

.app.enter { animation: app-in 0.45s var(--ease); }
.app.enter [data-k] { animation: k-in 0.5s var(--ease) both; }
.app.enter [data-k]:nth-child(2) { animation-delay: 0.05s; }
.app.enter [data-k]:nth-child(3) { animation-delay: 0.1s; }
.app.enter [data-k]:nth-child(4) { animation-delay: 0.15s; }

@keyframes app-in { from { opacity: 0.4; } }
@keyframes k-in { from { opacity: 0; transform: translateY(0.8em); } }

/* Barra lateral */
.a-side {
  background: var(--app-surface);
  border-right: 1px solid var(--app-border);
  padding: 1em 0.8em;
  overflow: hidden;
}

.a-brand { display: flex; align-items: center; gap: 0.6em; font-size: 1.15em; font-weight: 700; margin: 0 0 0.8em 0.2em; white-space: nowrap; }
.a-brand img { width: 1.9em; height: 1.9em; border-radius: 0.5em; }
.a-brand b { color: var(--brand); font-weight: 800; }

.a-group { font-size: 0.75em; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--app-muted); margin: 1.1em 0 0.4em 0.6em; }

.a-item {
  display: flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.45em 0.6em;
  border-radius: 0.6em;
  font-size: 1em;
  color: var(--app-text-2);
  white-space: nowrap;
}

.a-item .mdi { font-size: 1.3em; }
.a-item.on { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.a-item em { margin-left: auto; font-style: normal; font-size: 0.7em; font-weight: 800; background: var(--accent); color: #fff; padding: 0.1em 0.5em; border-radius: 999px; }

/* Conteúdo */
.a-main { display: flex; flex-direction: column; min-width: 0; }

.a-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4em;
  padding: 0 1.6em;
  background: var(--app-surface);
  border-bottom: 1px solid var(--app-border);
}

.a-top small { display: block; font-size: 0.8em; color: var(--app-text-2); }
.a-top strong { font-size: 1.15em; font-weight: 700; color: var(--app-text); }
.a-top-r { display: flex; align-items: center; gap: 1em; font-size: 1.5em; color: var(--app-text-2); }
.a-bell { position: relative; }
.a-bell b { position: absolute; top: -0.3em; right: -0.4em; font-size: 0.45em; background: var(--danger); color: #fff; border-radius: 999px; padding: 0.05em 0.45em; }
.a-av { width: 1.5em; height: 1.5em; border-radius: 50%; display: grid; place-items: center; font-size: 0.6em; width: 2.4em; height: 2.4em; background: var(--brand); color: #fff; font-weight: 700; }

.a-page { padding: 1.4em 1.6em; display: flex; flex-direction: column; gap: 1.1em; min-height: 0; }

.a-hello { display: flex; align-items: center; justify-content: space-between; }
.a-hello h4 { font-size: 1.6em; font-weight: 800; letter-spacing: -0.01em; }
.a-hello small { color: var(--app-text-2); font-size: 0.95em; }

.a-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  padding: 0.6em 1em;
  border-radius: 0.6em;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  font-size: 0.95em;
  white-space: nowrap;
}
.a-btn .mdi { font-size: 1.25em; }
.a-full { width: 100%; margin-top: auto; padding: 0.8em; }

:root[data-theme="dark"] .a-btn,
:root[data-theme="dark"] .a-av { color: #04201d; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .a-btn,
  :root:not([data-theme="light"]) .a-av { color: #04201d; }
}

.a-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1em; }

.a-kpi,
.a-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 0.8em;
  padding: 1em 1.1em;
}

.a-kpi-h { display: flex; align-items: center; gap: 0.6em; font-size: 0.95em; color: var(--app-text); }
.a-kpi b { display: block; font-size: 1.6em; font-weight: 800; margin: 0.4em 0 0.1em; letter-spacing: -0.01em; }
.a-kpi small { font-size: 0.8em; color: var(--app-text-2); }
.a-kpi .up { font-style: normal; color: var(--ok); font-weight: 700; }

.a-ic { width: 2.2em; height: 2.2em; border-radius: 0.6em; display: grid; place-items: center; font-size: 1.1em; }
.a-ic.teal { background: var(--brand-soft); color: var(--brand); }
.a-ic.blue { background: var(--info-soft); color: var(--info); }
.a-ic.amber { background: var(--accent-soft); color: var(--accent); }
.a-ic.green { background: var(--ok-soft); color: var(--ok); }
.a-ic.red { background: var(--danger-soft); color: var(--danger); }

.a-row { display: flex; gap: 1em; min-height: 0; }
.a-grow { flex: 1; min-width: 0; }
.a-w40 { width: 40%; flex-shrink: 0; }
.a-card h5 { font-size: 1.05em; font-weight: 700; margin-bottom: 0.7em; }

.a-chart { width: 100%; height: 9em; display: block; }
.a-chart .line { fill: none; stroke: var(--brand); stroke-width: 2; vector-effect: non-scaling-stroke; }
.a-chart .fill { fill: var(--brand-soft); }

.a-li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6em;
  padding: 0.5em 0;
  font-size: 0.95em;
  border-bottom: 1px solid var(--app-border);
}
.a-li:last-of-type { border-bottom: 0; }
.a-li > span { display: flex; align-items: center; gap: 0.4em; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-li > span small { color: var(--app-text-2); margin-left: 0.3em; }
.a-li b { white-space: nowrap; }
.a-li .mdi { font-size: 1.2em; }

.red { color: var(--danger) !important; }
.amber { color: var(--accent); }

.tag {
  font-style: normal;
  font-size: 0.8em;
  font-weight: 700;
  padding: 0.15em 0.6em;
  border-radius: 999px;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.tag.red { color: var(--danger); }
.tag.amber { color: var(--accent-ink); }
.tag.blue { color: var(--info); }
.tag.green { color: var(--ok); }

/* POS */
.a-pos { display: grid; grid-template-columns: 1fr 22em; gap: 1.1em; height: 100%; }
.a-search { display: flex; align-items: center; gap: 0.5em; padding: 0.7em 1em; border-radius: 0.7em; background: var(--app-surface); border: 1px solid var(--app-border); color: var(--app-muted); font-size: 0.95em; }
.a-search .mdi { font-size: 1.3em; }
.a-chips { display: flex; gap: 0.5em; margin: 0.9em 0; font-size: 0.9em; }
.a-chips > * { padding: 0.3em 0.9em; border-radius: 999px; border: 1px solid var(--app-border); background: var(--app-surface); color: var(--app-text-2); }
.a-chips b { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.a-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8em; }
.a-prod { background: var(--app-surface); border: 1px solid var(--app-border); border-radius: 0.8em; padding: 0.8em; display: flex; flex-direction: column; gap: 0.3em; }
.a-pimg { height: 3.6em; border-radius: 0.5em; background: var(--app-alt); display: grid; place-items: center; color: var(--app-muted); font-size: 1.6em; }
.a-prod small { font-size: 0.85em; color: var(--app-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-prod b { font-size: 0.95em; color: var(--brand-ink); }
.a-cart { display: flex; flex-direction: column; }
.a-tot { display: flex; justify-content: space-between; align-items: baseline; margin: 1em 0; padding-top: 0.8em; border-top: 1.5px dashed var(--app-border); }
.a-tot b { font-size: 1.6em; font-weight: 800; }

/* Restaurante */
.a-tables { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.8em; }
.a-table { border-radius: 0.8em; padding: 0.9em 1em; background: var(--app-surface); border: 1px solid var(--app-border); border-top: 0.35em solid var(--ok); min-height: 7.2em; display: flex; flex-direction: column; gap: 0.25em; }
.a-table > div { display: flex; justify-content: space-between; align-items: center; }
.a-table em { font-style: normal; font-size: 0.75em; font-weight: 700; color: var(--ok); }
.a-table strong { font-size: 1.25em; margin-top: auto; }
.a-table small { font-size: 0.85em; color: var(--app-text-2); display: flex; align-items: center; gap: 0.3em; }
.a-table.occ { border-top-color: #ea7a0b; }
.a-table.occ em { color: #ea7a0b; }
.a-table.res { border-top-color: var(--info); }
.a-table.res em { color: var(--info); }
.a-table.clean { border-top-color: var(--app-muted); }
.a-table.clean em { color: var(--app-muted); }
.a-kitchen { display: flex; align-items: center; gap: 0.7em; padding: 0.8em 1em; border-radius: 0.8em; background: var(--app-surface); border: 1px solid var(--app-border); font-weight: 600; }
.a-kitchen > span { display: flex; align-items: center; gap: 0.4em; margin-right: auto; }
.a-kitchen .mdi { font-size: 1.4em; color: #ea7a0b; }

/* Escola */
.a-bars { display: flex; align-items: flex-end; gap: 1.2em; height: 10em; padding: 0 0.5em; }
.a-bars > div { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 0.3em; }
.a-bars span { width: 70%; background: var(--brand); border-radius: 0.3em 0.3em 0 0; }
.a-bars small { font-size: 0.8em; color: var(--app-text-2); }
.a-li > span:has(small) { flex-direction: column; align-items: flex-start; gap: 0; }
.a-li > span:has(small) small { margin: 0; }
