/* Conferência diária · Smart Oliveira Formoso-MG
   Mundo: placas de corredor do supermercado. */

@font-face { font-family: 'Barlow'; font-weight: 500; font-display: swap; src: url('fonts/barlow-500.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 600; font-display: swap; src: url('fonts/barlow-600.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 700; font-display: swap; src: url('fonts/barlow-700.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 600; font-display: swap; src: url('fonts/barlow-condensed-600.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 700; font-display: swap; src: url('fonts/barlow-condensed-700.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 800; font-display: swap; src: url('fonts/barlow-condensed-800.woff2') format('woff2'); }

:root {
  --red: #b5121b;
  --red-deep: #8f0d15;
  --red-soft: #f6dcdd;
  --ink: #1b1c1e;
  --ink-2: #45474b;
  --ink-3: #64666a;
  --ground: #f5f4f0;
  --ground-2: #ecebe5;
  --panel: #ffffff;
  --rule: #d9d7cf;
  --rule-strong: #b9b7ae;
  --wire: #55585c;
  --stamp: #5b2c83;          /* tinta de carimbo: o outro gerente */
  --stamp-tint: #efe7f5;
  --due: #9a5b00;
  --due-tint: #fbefd9;
  --late: #a3111a;
  --ok: #1f6b45;
  --signal: #f2b705;

  --sec-vermelho: #b5121b;  --sec-vermelho-fg: #ffffff;
  --sec-verde: #1f6b45;     --sec-verde-fg: #ffffff;
  --sec-amarelo: #f2b705;   --sec-amarelo-fg: #1b1c1e;
  --sec-azul: #1d4e89;      --sec-azul-fg: #ffffff;
  --sec-grafite: #2e3236;   --sec-grafite-fg: #ffffff;

  --cond: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --sans: 'Barlow', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --top: env(safe-area-inset-top, 0px);
  --bottom: env(safe-area-inset-bottom, 0px);
  --tabbar: 64px;
  --ease: cubic-bezier(.2, .8, .2, 1);

  color-scheme: light;
  accent-color: var(--red);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--red); scroll-padding: calc(var(--top) + 96px) 0 calc(var(--tabbar) + var(--bottom) + 16px); }
body {
  min-height: 100dvh;
  background: var(--ground);
  color: var(--ink);
  font: 500 17px/1.35 var(--sans);
  font-variant-numeric: tabular-nums;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
  caret-color: var(--red);
}
::selection { background: var(--signal); color: var(--ink); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; border-radius: 3px; }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

#statusbar { position: fixed; inset: 0 0 auto 0; height: var(--top); background: var(--red); z-index: 30; }
#app { max-width: 560px; margin: 0 auto; min-height: 100dvh; background: var(--ground); position: relative; }
@media (min-width: 600px) {
  html { background: var(--ground-2); }
  #app { box-shadow: 0 0 0 1px var(--rule); }
}

/* ---------- Casca vermelha ---------- */

.shell { background: var(--red); color: #fff; padding: calc(var(--top) + 12px) 16px 0; }
.shell-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.brand { font: 800 21px/1 var(--cond); letter-spacing: .02em; text-transform: uppercase; }
.brand small { display: block; font: 600 13px/1.3 var(--sans); letter-spacing: 0; text-transform: none; opacity: .86; margin-top: 3px; }
.who { text-align: right; font: 600 13px/1.3 var(--sans); }
.who-name { display: inline-flex; align-items: center; gap: 7px; margin-top: 3px; font: 700 20px/1.1 var(--cond); letter-spacing: .02em; text-transform: uppercase; }
.live { width: 9px; height: 9px; border-radius: 50%; background: #7ee2a8; box-shadow: 0 0 0 2px rgba(255, 255, 255, .25); }
.live.off { background: transparent; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .7); }

.score { display: flex; align-items: flex-end; gap: 16px; padding: 14px 0 12px; }
.big { font: 800 88px/.8 var(--cond); letter-spacing: -.02em; white-space: nowrap; }
.big small { font-size: 42px; letter-spacing: 0; opacity: .72; }
.split { font: 600 15px/1.45 var(--sans); padding-bottom: 2px; min-width: 0; }
.split p { display: flex; align-items: center; gap: 8px; }
.key { width: 12px; height: 12px; flex: none; border-radius: 2px; }
.key.me { background: #fff; }
.key.other { box-shadow: inset 0 0 0 2px #fff; background: repeating-linear-gradient(-45deg, rgba(255,255,255,.55) 0 2px, transparent 2px 5px); }
.split .on { font-size: 13px; opacity: .86; }
.strip { display: flex; height: 8px; background: rgba(0, 0, 0, .22); margin: 0 -16px; }
.strip .me { background: #fff; transition: width .35s var(--ease); }
.strip .other { background: repeating-linear-gradient(-45deg, rgba(255,255,255,.7) 0 3px, rgba(255,255,255,.28) 3px 6px); transition: width .35s var(--ease); }

.notice { display: flex; align-items: center; gap: 10px; padding: 10px 16px; font: 600 14px/1.35 var(--sans); background: var(--ink); color: #fff; }
.notice button { margin-left: auto; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; min-height: 36px; white-space: nowrap; }
.notice button + button { margin-left: 4px; }
.notice.install { background: var(--panel); color: var(--ink); border-bottom: 1px solid var(--rule); }
.notice.install b { font-weight: 700; }

.shell.compact { padding-bottom: 14px; }
.shell.compact h1 { font: 800 30px/1 var(--cond); text-transform: uppercase; letter-spacing: .01em; margin-top: 14px; }
.shell.compact p { font: 600 14px/1.35 var(--sans); opacity: .9; margin-top: 6px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: #fff; font: 700 15px/1 var(--sans); min-height: 36px; margin-left: -6px; }

/* ---------- Placas de seção ---------- */

.aisle { position: relative; }
.hang {
  position: sticky; top: var(--top); z-index: 5;
  padding: 16px 12px 0;
  background: var(--ground);
}
.hang::before, .hang::after { content: ""; position: absolute; top: 0; width: 1px; height: 17px; background: var(--wire); }
.hang::before { left: 22%; }
.hang::after { right: 22%; }
.board {
  --bg: var(--sec-vermelho); --fg: var(--sec-vermelho-fg);
  position: relative;
  display: flex; align-items: center; gap: 12px;
  min-height: 64px; padding: 10px 14px 15px;
  background: var(--bg); color: var(--fg);
  border-radius: 6px;
  box-shadow: 0 3px 6px rgba(27, 28, 30, .16);
  transform-origin: 50% -16px;
}
.board[data-color="verde"] { --bg: var(--sec-verde); --fg: var(--sec-verde-fg); }
.board[data-color="amarelo"] { --bg: var(--sec-amarelo); --fg: var(--sec-amarelo-fg); }
.board[data-color="azul"] { --bg: var(--sec-azul); --fg: var(--sec-azul-fg); }
.board[data-color="grafite"] { --bg: var(--sec-grafite); --fg: var(--sec-grafite-fg); }
.disc {
  flex: none; width: 42px; height: 42px; border-radius: 50%;
  background: var(--fg); color: var(--bg);
  display: grid; place-items: center;
  font: 800 28px/1 var(--cond);
}
.disc svg.i { width: 24px; height: 24px; stroke-width: 3; }
.board h2 { font: 800 23px/1 var(--cond); text-transform: uppercase; letter-spacing: .01em; text-wrap: balance; }
.board .sub { font: 600 14px/1.25 var(--sans); margin-top: 4px; opacity: .9; }
.board .meter { position: absolute; left: 14px; right: 14px; bottom: 6px; height: 3px; background: color-mix(in srgb, var(--fg) 26%, transparent); border-radius: 2px; overflow: hidden; }
.board .meter span { display: block; height: 100%; background: var(--fg); transition: width .35s var(--ease); }
.board .edit-title { margin-left: auto; color: var(--fg); min-width: 44px; min-height: 44px; display: grid; place-items: center; border-radius: 6px; }
.board.swing { animation: swing 1.1s var(--ease); }
@keyframes swing {
  0% { transform: rotate(0); }
  18% { transform: rotate(2.2deg); }
  42% { transform: rotate(-1.4deg); }
  66% { transform: rotate(.6deg); }
  100% { transform: rotate(0); }
}

/* ---------- Itens ---------- */

.items { list-style: none; padding: 6px 12px 22px; }
.item { border-bottom: 1px solid var(--rule); }
.item:last-child { border-bottom: 0; }
.row { display: grid; grid-template-columns: 1fr auto; align-items: stretch; min-height: 62px; }
.tick {
  display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: 0;
  text-align: left; padding: 10px 6px 10px 0; min-height: 62px;
}
.box {
  width: 30px; height: 30px; border-radius: 4px;
  border: 2px solid var(--ink);
  display: grid; place-items: center;
  font: 800 18px/1 var(--cond);
  background: var(--panel);
  transition: background-color .15s var(--ease), border-color .15s var(--ease), transform .15s var(--ease);
}
.tick:active .box { transform: scale(.92); }
.box svg.i { width: 20px; height: 20px; stroke-width: 3; color: #fff; }
.txt { font: 500 17px/1.3 var(--sans); }
.meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; font: 600 13.5px/1.3 var(--sans); color: var(--ink-3); }
.meta .by-other { color: var(--stamp); }
.meta .note { color: var(--ink-2); font-weight: 600; }
.meta .note b { font-weight: 700; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px 2px 5px; border-radius: 3px; font: 700 12.5px/1.4 var(--sans); background: var(--ground-2); color: var(--ink-2); }
.chip svg.i { width: 14px; height: 14px; stroke-width: 2.4; }
.chip.due-now { background: var(--due-tint); color: var(--due); }
.chip.due-late { background: var(--red-soft); color: var(--late); }

.item.mine .box { background: var(--red); border-color: var(--red); }
.item.mine .txt { color: var(--ink-2); }
.item.other .box { border: 2px dashed var(--stamp); color: var(--stamp); background: var(--stamp-tint); }
.item.mine.also .box { position: relative; }
.item.mine.also .box::after {
  content: attr(data-initial); position: absolute; right: -9px; bottom: -8px;
  width: 17px; height: 17px; border-radius: 50%; background: var(--stamp); color: #fff;
  font: 800 11px/17px var(--cond); text-align: center; box-shadow: 0 0 0 2px var(--ground);
}
.item.conditional .box { border-style: dotted; }

.more {
  display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 4px;
  min-width: 56px; padding: 8px 0 8px 8px; color: var(--ink-3);
  font: 700 14px/1 var(--sans);
}
.more .t-me { color: var(--ink-2); }
.more .t-other { color: var(--stamp); }
.more svg.i { width: 18px; height: 18px; }
.more .has-note { color: var(--ink); }

.panel { padding: 0 0 16px 44px; }
.panel .others { list-style: none; margin-bottom: 10px; font: 600 14px/1.4 var(--sans); color: var(--ink-2); }
.panel .others li + li { margin-top: 4px; }
.panel .others .who-o { color: var(--stamp); font-weight: 700; }
.field-label { display: block; font: 700 13px/1.2 var(--sans); color: var(--ink-2); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em; }
textarea, .input {
  width: 100%; background: var(--panel); border: 1px solid var(--rule-strong); border-radius: 6px;
  padding: 10px 12px; font: 500 16px/1.35 var(--sans); color: var(--ink);
}
textarea { min-height: 76px; resize: vertical; }
textarea:focus, .input:focus { outline: 3px solid var(--signal); outline-offset: 0; border-color: var(--ink); }
.panel-actions { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.panel-actions .hint { font: 600 13px/1.3 var(--sans); color: var(--ink-3); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 16px; border-radius: 6px;
  font: 700 15px/1 var(--sans);
  background: var(--panel); color: var(--ink); box-shadow: inset 0 0 0 1px var(--rule-strong);
  transition: background-color .15s var(--ease);
}
.btn:active { background: var(--ground-2); }
.btn.primary { background: var(--ink); color: #fff; box-shadow: none; }
.btn.primary:active { background: #000; }
.btn.danger { color: var(--late); }
.btn[disabled] { opacity: .5; cursor: default; }
.btn svg.i { width: 18px; height: 18px; }

.endcap { margin: 8px 12px 28px; padding: 18px 16px; border: 1px solid var(--rule); border-radius: 6px; background: var(--panel); }
.endcap h3 { font: 800 22px/1.05 var(--cond); text-transform: uppercase; }
.endcap p { font: 500 15px/1.4 var(--sans); color: var(--ink-2); margin-top: 6px; }
.endcap.done { background: var(--ok); color: #fff; border-color: var(--ok); }
.endcap.done p { color: #fff; opacity: .92; }

/* ---------- Histórico ---------- */

.days { list-style: none; padding: 8px 12px 28px; }
.day-row { display: grid; grid-template-columns: 58px 1fr auto; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 14px 0; border-bottom: 1px solid var(--rule); min-height: 72px; }
.day-num { font: 800 38px/.85 var(--cond); text-align: center; }
.day-num small { display: block; font: 700 12px/1.3 var(--sans); text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); margin-top: 4px; }
.day-row .bar { display: flex; height: 8px; background: var(--ground-2); border-radius: 1px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--rule); }
.day-row .bar .me { background: var(--red); }
.day-row .bar .other { background: repeating-linear-gradient(-45deg, var(--stamp) 0 3px, #9b7cb6 3px 6px); }
.day-row .lbl { font: 600 14px/1.3 var(--sans); color: var(--ink-2); margin-top: 6px; }
.day-row .lbl b { font: 800 19px/1 var(--cond); color: var(--ink); margin-right: 4px; }
.day-row .pct { font: 800 24px/1 var(--cond); }
.day-row .pct.full { color: var(--ok); }
.day-row .pct.low { color: var(--late); }
.day-row.today .day-num { color: var(--red); }

.missing { color: var(--late); }

/* ---------- Ajustar lista ---------- */

.edit-list { list-style: none; padding: 6px 12px 10px; }
.edit-list > li { border-bottom: 1px solid var(--rule); }
.edit-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; width: 100%; text-align: left; min-height: 56px; padding: 10px 0; }
.edit-row .txt { font-size: 16px; }
.edit-row svg.i { color: var(--ink-3); }
.editor { padding: 4px 0 16px; display: grid; gap: 12px; }
.editor .opts { display: flex; flex-wrap: wrap; gap: 10px 18px; font: 600 15px/1.3 var(--sans); }
.editor .opts label { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; }
.editor .opts input[type="checkbox"] { width: 22px; height: 22px; }
.editor .opts input[type="time"] { width: 120px; }
.editor .acts { display: flex; flex-wrap: wrap; gap: 8px; }
.add-item { display: flex; gap: 8px; padding: 12px 12px 26px; }
.add-item .input { flex: 1; }
.account { margin: 10px 12px 30px; padding: 16px; border-top: 1px solid var(--rule); display: flex; align-items: center; justify-content: space-between; gap: 12px; font: 600 15px/1.35 var(--sans); color: var(--ink-2); }
.account b { color: var(--ink); }
.new-section { padding: 0 12px 10px; }

/* ---------- Entrada ---------- */

.login { min-height: 100dvh; display: flex; flex-direction: column; padding: calc(var(--top) + 0px) 20px calc(var(--bottom) + 24px); }
.login .sign { position: relative; padding-top: 54px; margin: 0 auto; width: min(300px, 78vw); }
.login .sign::before, .login .sign::after { content: ""; position: absolute; top: 0; width: 1px; height: 60px; background: var(--wire); }
.login .sign::before { left: 27%; }
.login .sign::after { right: 27%; }
.login .sign img { display: block; width: 100%; height: auto; position: relative; }
.login h1 { font: 800 34px/1 var(--cond); text-transform: uppercase; text-align: center; margin-top: 26px; letter-spacing: .01em; }
.login .lead { text-align: center; font: 600 15px/1.4 var(--sans); color: var(--ink-3); margin-top: 6px; }
.login .step { margin-top: 30px; }
.login h2 { font: 700 15px/1.2 var(--sans); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); margin-bottom: 12px; }
.login h2.center { text-align: center; text-wrap: balance; }
.pick { display: grid; gap: 10px; }
.pick button {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 72px; padding: 0 18px; border-radius: 6px; text-align: left;
  background: var(--panel); box-shadow: inset 0 0 0 1px var(--rule-strong), 0 1px 0 var(--rule);
}
.pick button:active { background: var(--ground-2); }
.pick .nm { font: 800 28px/1 var(--cond); text-transform: uppercase; letter-spacing: .01em; }
.pick .st { font: 600 13px/1.3 var(--sans); color: var(--ink-3); text-align: right; }
.pin-wrap { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 300px; margin: 0 auto; }
.pin-cell { height: 68px; border-radius: 6px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--rule-strong); display: grid; place-items: center; }
.pin-cell.filled::after { content: ""; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); }
.pin-cell.cur { box-shadow: inset 0 0 0 2px var(--ink); }
.pin-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; font-size: 16px; caret-color: transparent; }
.pin-wrap:focus-within .pin-cell.cur { box-shadow: inset 0 0 0 2px var(--ink), 0 0 0 3px var(--signal); }
.login .msg { text-align: center; min-height: 44px; margin-top: 14px; font: 600 15px/1.4 var(--sans); color: var(--ink-2); }
.login .msg.err { color: var(--late); }
.login .alt { display: block; margin: 6px auto 0; min-height: 44px; font: 700 15px/1 var(--sans); color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.login .foot { margin-top: auto; text-align: center; font: 600 13px/1.4 var(--sans); color: var(--ink-3); padding-top: 30px; }

/* ---------- Barra inferior ---------- */

main.with-tabs { padding-bottom: calc(var(--tabbar) + var(--bottom)); }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  max-width: 560px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, 1fr);
  height: calc(var(--tabbar) + var(--bottom)); padding-bottom: var(--bottom);
  background: var(--panel); border-top: 1px solid var(--rule);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--ink-3); text-decoration: none; font: 700 13px/1 var(--sans);
  position: relative;
}
.tabbar a[aria-current="page"] { color: var(--red); }
.tabbar a[aria-current="page"]::before { content: ""; position: absolute; top: -1px; left: 22%; right: 22%; height: 3px; background: var(--red); }

/* ---------- Carregando ---------- */

.skel { padding: 18px 12px; display: grid; gap: 14px; }
.skel i { display: block; height: 18px; border-radius: 3px; background: linear-gradient(90deg, var(--ground-2), #f9f8f5, var(--ground-2)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.skel i.b { height: 64px; border-radius: 6px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar) + var(--bottom) + 14px); transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 6px; font: 600 15px/1.3 var(--sans);
  z-index: 40; max-width: calc(100vw - 32px); box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
