:root {
  --bg: #141225; --panel: #1c1a2f; --panel-2: #242140; --panel-3: #2d2a50;
  --line: rgba(255,255,255,.08); --line-2: rgba(255,255,255,.14);
  --text: #f4efe6; --muted: #c4c1dc; --dim: #918eb2;
  --acc: #e63458; --acc-2: #ff7a92; --acc-ink: #fff;
  --din: #4ade80; --c-ok: #34d399; --c-warn: #f5b942; --c-info: #60a5fa; --c-bad: #ff8a8a; --c-violet: #a78bfa;
  --r: 14px; --rail: 84px; --ease: cubic-bezier(.22,.8,.24,1);
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14.5px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.02em; }
h1 { font-size: 1.55rem; } h2 { font-size: 1.1rem; } h3 { font-size: .95rem; }
svg { display: block; flex: none; }
.muted { color: var(--muted); } .right { text-align: right; } .grow { flex: 1; }
.din { color: var(--din); font-weight: 700; font-variant-numeric: tabular-nums lining-nums; }
.din.neg, .neg { color: var(--c-bad); }
.num, .stat .v, .dp-dia { font-variant-numeric: tabular-nums lining-nums; }
:focus-visible { outline: 2px solid var(--acc-2); outline-offset: 2px; }

/* ===== estrutura: trilho fino ===== */
.shell { display: grid; grid-template-columns: var(--rail) 1fr; min-height: 100vh; }
.nav { position: sticky; top: 0; height: 100vh; padding: 16px 10px; display: flex; flex-direction: column; gap: 4px; border-right: 1px solid var(--line); background: linear-gradient(180deg, #1c1a2f, #141225); }
.marca { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; color: var(--acc); background: radial-gradient(circle at 30% 20%, rgba(230,52,88,.22), rgba(230,52,88,.04)); border: 1px solid rgba(230,52,88,.3); }
.brand { display: grid; place-items: center; margin: 2px 0 16px; }
.links { position: relative; display: grid; gap: 4px; }
.links a { position: relative; z-index: 1; display: grid; justify-items: center; gap: 3px; padding: 9px 0 7px; border-radius: 13px; color: var(--muted); text-decoration: none; font-size: .68rem; font-weight: 600; transition: color .2s, background .2s; }
.links a:hover { color: var(--text); background: rgba(255,255,255,.04); }
.links a.on { color: var(--acc-2); }
.ind { position: absolute; left: 0; right: 0; top: 0; height: 58px; border-radius: 13px; background: rgba(230,52,88,.1); border: 1px solid rgba(230,52,88,.25); transition: transform .35s var(--ease), opacity .2s; opacity: 0; pointer-events: none; }
.user { display: grid; justify-items: center; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); }
.user small { font-size: .62rem; text-align: center; line-height: 1.2; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .8rem; color: var(--acc-ink); background: linear-gradient(180deg, #f0486b, #d62b50); }
.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); cursor: pointer; transition: .2s; }
.icon-btn:hover { color: var(--text); border-color: var(--line-2); }
.topbar { display: none; }
.main { padding: 26px clamp(16px, 2.6vw, 44px) 60px; max-width: 1760px; width: 100%; margin: 0 auto; }
.view { animation: entra .35s var(--ease) both; } .view.quieto { animation: none; } .view.sai { animation: sai .13s ease both; }
@keyframes entra { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes sai { to { opacity: 0; transform: translateY(-4px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes sobe { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.conn { position: fixed; bottom: 14px; right: 14px; padding: 6px 12px; border-radius: 99px; background: #3a1626; border: 1px solid rgba(248,113,113,.4); color: var(--c-bad); font-size: .75rem; font-weight: 700; display: none; z-index: 40; }
.conn.off { display: block; }

/* ===== cabeçalho de página ===== */
.head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 22px; }
.head h1 { margin-right: auto; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mes { display: inline-flex; align-items: center; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); }
.mes strong { min-width: 9.5rem; text-align: center; font-size: .92rem; }

/* ===== cartões, métricas, tabelas ===== */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.card > h3 { margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card > h3 .sub { margin-left: auto; font-weight: 500; font-size: .76rem; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 15px 17px; display: grid; gap: 2px; }
.stat .k { color: var(--muted); font-size: .76rem; font-weight: 600; }
.stat .v { font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.stat small { color: var(--muted); font-size: .74rem; }
.stat.grande { background: linear-gradient(160deg, rgba(230,52,88,.12), var(--panel) 60%); border-color: rgba(230,52,88,.25); }
.stat.alerta { border-color: rgba(245,185,66,.3); } .stat.alerta .v { color: var(--c-warn); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; margin-bottom: 14px; }
.tabela { width: 100%; border-collapse: collapse; }
.tabela th { text-align: left; color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.tabela td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tabela tr:last-child td { border-bottom: 0; }
.tabela tbody tr.clic { cursor: pointer; } .tabela tbody tr.clic:hover { background: rgba(255,255,255,.03); }
.tabela .r { text-align: right; white-space: nowrap; } .tabela .c { text-align: center; }
.rolagem { overflow-x: auto; margin: 0 -6px; padding: 0 6px; }
.empty { padding: 44px 10px; text-align: center; color: var(--muted); }
.barra { height: 8px; border-radius: 99px; background: var(--panel-3); overflow: hidden; }
.barra i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #d62b50, var(--acc-2)); }
.rank { display: grid; gap: 10px; }
.rank .l { display: grid; gap: 4px; }
.rank .t { display: flex; justify-content: space-between; gap: 10px; font-size: .86rem; }
.rank .t span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grafico { display: flex; align-items: flex-end; gap: 3px; height: 150px; padding-top: 8px; }
.grafico .b { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; position: relative; }
.grafico .b i { display: block; width: 100%; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, #f0486b, #d62b50); min-height: 2px; opacity: .85; transition: opacity .2s; }
.grafico .b:hover i { opacity: 1; }
.eixo { display: flex; justify-content: space-between; color: var(--dim); font-size: .7rem; margin-top: 6px; }

/* ===== botões, formulários, pílulas ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 15px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--panel-2); font-weight: 600; cursor: pointer; transition: .2s; white-space: nowrap; }
.btn:hover { border-color: rgba(255,255,255,.25); background: var(--panel-3); }
.btn.primary { background: linear-gradient(180deg, #f0486b, #d62b50); color: var(--acc-ink); border-color: transparent; font-weight: 700; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.perigo { color: var(--c-bad); border-color: rgba(248,113,113,.35); }
.btn.peq { padding: 4px 10px; font-size: .8rem; border-radius: 9px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
input, select, textarea { width: 100%; padding: 9px 12px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--panel-2); transition: border-color .2s, box-shadow .2s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px rgba(230,52,88,.15); }
input[type=checkbox] { width: auto; accent-color: var(--acc); }
label { display: grid; gap: 5px; font-size: .78rem; font-weight: 600; color: var(--muted); }
.form { display: grid; gap: 12px; } .grade2 { grid-template-columns: 1fr 1fr; } .grade2 .inteira { grid-column: 1 / -1; }
.busca { position: relative; min-width: 220px; } .busca input { padding-left: 36px; } .busca svg { position: absolute; left: 11px; top: 10px; color: var(--dim); }
.abas { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); flex-wrap: wrap; }
.abas button { padding: 6px 13px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 600; cursor: pointer; transition: .2s; }
.abas button.on { background: rgba(230,52,88,.14); color: var(--acc-2); }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: .7rem; font-weight: 700; color: var(--c, var(--muted)); background: color-mix(in srgb, var(--c, #fff) 12%, transparent); border: 1px solid color-mix(in srgb, var(--c, #fff) 25%, transparent); white-space: nowrap; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.recebido { --c: var(--c-info); } .pill.em_reparo { --c: var(--c-warn); } .pill.concluida, .pill.entregue, .pill.ok { --c: var(--c-ok); } .pill.cancelada, .pill.atraso { --c: var(--c-bad); } .pill.aberto { --c: var(--c-warn); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 8px; font-size: .7rem; font-weight: 700; background: var(--panel-3); color: var(--muted); }
.tag.loj { color: var(--c-violet); background: rgba(167,139,250,.12); }
.aviso { display: flex; gap: 10px; padding: 11px 14px; border-radius: 12px; background: rgba(245,185,66,.08); border: 1px solid rgba(245,185,66,.25); color: #f3d79a; font-size: .84rem; margin-bottom: 14px; }
.aviso.ok { background: rgba(52,211,153,.08); border-color: rgba(52,211,153,.25); color: #a6efd0; }

/* ===== livro-caixa ===== */
.dia { margin-bottom: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); overflow: hidden; }
.dia > header { display: flex; align-items: center; gap: 14px; padding: 11px 16px; background: var(--panel-2); flex-wrap: wrap; }
.dia > header strong { font-size: .98rem; } .dia > header .sem { color: var(--muted); font-size: .78rem; margin-left: 6px; }
.dia > header .res { margin-left: auto; display: flex; gap: 16px; font-size: .8rem; color: var(--muted); }
.dia .tabela td { padding: 7px 12px; }
.sub { color: var(--muted); font-size: .8rem; }
td.ent { color: var(--din); font-weight: 700; } td.sai, td.des { color: var(--c-bad); font-weight: 600; }

/* ===== modal / toast / datepicker ===== */
.overlay { position: fixed; inset: 0; background: rgba(2,5,8,.72); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; z-index: 50; animation: fade .2s both; }
.modal { background: #1c1a2f; border: 1px solid var(--line-2); border-radius: 20px; padding: 22px; width: min(500px, 100%); max-height: 92vh; overflow: auto; display: grid; gap: 16px; animation: sobe .35s var(--ease) both; }
.modal.largo { width: min(1080px, 100%); }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 200; width: min(420px, calc(100vw - 24px)); }
.toast { background: #262348; border: 1px solid var(--line-2); border-left: 3px solid var(--c-ok); padding: 11px 14px; border-radius: 12px; box-shadow: 0 12px 36px rgba(0,0,0,.6); animation: sobe .3s var(--ease) both; }
.toast.err { border-left-color: var(--c-bad); }
.dp { position: relative; display: flex; align-items: center; min-width: 150px; } .dp input { padding-right: 42px; font-variant-numeric: tabular-nums; }
.dp.invalido input { border-color: var(--c-bad); }
.dp-btn { position: absolute; right: 4px; width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 9px; background: transparent; color: var(--acc); cursor: pointer; }
.dp-btn:hover { background: rgba(230,52,88,.14); }
.dp-pop { position: fixed; z-index: 120; background: #1c1a2f; border: 1px solid var(--line-2); border-radius: 18px; padding: 14px; width: 292px; box-shadow: 0 24px 60px -12px rgba(0,0,0,.85); opacity: 0; transform: translateY(-8px) scale(.97); transform-origin: top left; transition: opacity .15s, transform .22s var(--ease); }
.dp-pop.acima { transform-origin: bottom left; transform: translateY(8px) scale(.97); } .dp-pop.on { opacity: 1; transform: none; }
.dp-topo { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.dp-nav { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); cursor: pointer; }
.dp-nav:hover { border-color: var(--acc); }
.dp-grade { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.dp-sem { text-align: center; color: var(--dim); font-size: .68rem; padding: 4px 0; }
.dp-dia { position: relative; height: 34px; display: grid; place-items: center; border-radius: 10px; border: 1px solid transparent; background: transparent; cursor: pointer; font-weight: 600; font-size: .86rem; padding: 0; }
.dp-dia:hover { background: var(--panel-3); }
.dp-dia.hoje { border-color: rgba(230,52,88,.55); color: var(--acc-2); }
.dp-dia.sel { background: linear-gradient(180deg, #f0486b, #d62b50); color: var(--acc-ink); }
.dp-ponto { display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: var(--acc); } .dp-dia .dp-ponto { position: absolute; bottom: 4px; }
.dp-pe { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--dim); font-size: .72rem; }
.dp-link { background: none; border: 0; color: var(--acc-2); font-weight: 700; cursor: pointer; padding: 4px 6px; border-radius: 8px; }

/* ===== login ===== */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(60% 50% at 50% 0, rgba(230,52,88,.12), transparent); }
.login .card { width: min(380px, 100%); display: grid; gap: 14px; padding: 28px; }
.login .logo { width: min(260px, 70%); margin: 0 auto 4px; display: block; }
.login .card > .marca { margin: 0 auto; width: 54px; height: 54px; }

/* ===== responsivo ===== */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; padding-bottom: 72px; }
  .nav { position: fixed; z-index: 30; top: auto; bottom: 0; left: 0; right: 0; height: auto; flex-direction: row; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); background: #1c1a2f; }
  .brand, .nav .grow, .user, .ind { display: none; }
  .links { display: flex; width: 100%; justify-content: space-between; gap: 0; overflow-x: auto; }
  .links a { flex: 1; min-width: 56px; padding: 6px 2px; font-size: .62rem; }
  .links a.on { background: rgba(230,52,88,.1); }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .topbar .nm { font-weight: 700; display: grid; line-height: 1.2; } .topbar small { color: var(--muted); font-weight: 500; }
  .main { padding: 16px 14px 40px; }
  .grade2 { grid-template-columns: 1fr; }
  .head h1 { font-size: 1.3rem; }
  .cols { grid-template-columns: 1fr; }
  .dia > header .res { margin-left: 0; width: 100%; justify-content: space-between; }
  .stat .v { font-size: 1.3rem; }
  .esconde-m { display: none; }
}
@media (min-width: 1700px) { :root { font-size: 16px; } html, body { font-size: 16px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ===== tela de espera (logo + vidro quebrando) ===== */
.abertura { position: fixed; inset: 0; z-index: 1000; overflow: hidden; cursor: pointer; outline: none; touch-action: manipulation; user-select: none; }
.ab-base { position: absolute; inset: 0; background: radial-gradient(circle at 50% 40%, rgba(230,52,88,.2), transparent 58%), #1c1a2f; }
.ab-cacos, .ab-trincas { position: absolute; inset: 0; pointer-events: none; }
.ab-caco { position: absolute; inset: 0; will-change: transform, opacity; }
.ab-logo { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 22px; pointer-events: none; will-change: transform, opacity; }
.ab-logo img { width: min(78vw, 520px, 62vh); height: auto; filter: drop-shadow(0 12px 40px rgba(230,52,88,.28)); }
.ab-dica { color: var(--muted); font-size: .85rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; opacity: 0; }
.ab-logo.respira img { animation: respira 3.4s ease-in-out infinite; }
.ab-logo.respira .ab-dica { animation: dica 2.4s ease-in-out infinite; }
@keyframes respira { 50% { transform: translateY(-8px) scale(1.02); } }
@keyframes dica { 0%, 100% { opacity: .25; } 50% { opacity: .9; } }

/* apresentação em vídeo (tela cheia) */
.apres { position: fixed; inset: 0; z-index: 2147482000; background: #0b0a17; display: grid; place-items: center; animation: fade .25s both; }
.apres.sai { opacity: 0; transition: opacity .28s; }
.apres-video { width: 100%; height: 100%; object-fit: contain; background: #0b0a17; }
.apres-pular, .apres-som { position: absolute; border: 1px solid rgba(255,255,255,.28); background: rgba(14,12,32,.72); color: #fff; font: 700 .85rem/1 inherit; padding: 11px 16px; border-radius: 12px; cursor: pointer; backdrop-filter: blur(6px); }
.apres-pular { right: 20px; bottom: 24px; }
.apres-som { left: 20px; bottom: 24px; }
.apres-pular:hover, .apres-som:hover { border-color: #e63458; background: rgba(230,52,88,.35); }
.apres-prog { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.12); }
.apres-barra { display: block; height: 100%; width: 0; background: #e63458; }
.apres-link { background: none; border: 0; color: var(--muted); font: inherit; font-size: .85rem; text-decoration: underline; cursor: pointer; justify-self: center; padding: 4px; }
.apres-link:hover { color: var(--text); }
