/* Tema Parzbyte · componentes: números, tabelas, campos, chaves, chips, vazio, miniaturas, escolha de tema, calendário e hora. */
.statbar { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 16px; padding: 0; background: none; box-shadow: none; }
.statbar > * { min-width: 0; padding: 18px 20px; border-radius: var(--r); background: var(--glass); box-shadow: inset 0 0 0 1px var(--rim), var(--shadow); }
.statbar > :first-child { background: var(--tile, var(--sky)); box-shadow: none; }
.statbar > :first-child {
  --text: #14202a; --muted: #14202ac2; --faint: #14202ab3; --well: #14202a14; --line: #14202a1f; --line-2: #14202a33;
  --surface: #ffffffb3; --surface-2: #fff6; --up: #1b5e4a; --up-soft: #ffffff8c; --down: #8f3220; --down-soft: #ffffff8c;
  --primary: #14202a; --primary-ink: #14202a; --c1: #14202a; --c2: #14202a52; --c3: #14202a; --rim: #fff6;
  color: var(--text);
}
:root[data-palette="mono"]:not([data-theme="dark"]) .statbar > :first-child {
  --text: #f3f7f8; --muted: #f3f7f8c7; --faint: #f3f7f8b3; --well: #ffffff1f; --line: #ffffff24; --line-2: #ffffff3d;
  --surface: var(--ocean); --surface-2: #ffffff14; --up: #8fe3c4; --up-soft: #8fe3c429; --down: #ffb3a1; --down-soft: #ffb3a129;
  --primary: #f3f7f8; --primary-ink: #f3f7f8; --c1: var(--oc-1); --c2: var(--oc-2); --c4: var(--oc-3); --rim: #ffffff1a;
  background: var(--ocean); box-shadow: none;
}
.stat { display: grid; gap: 6px; }
.stat__label { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }
.meter { height: 7px; border-radius: 99px; background: var(--well); overflow: hidden; }
.meter__fill { height: 100%; border-radius: inherit; background: var(--primary); transform-origin: 0; }

.table-wrap { margin: 0 -20px -20px; border-radius: 0 0 var(--r) var(--r); overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
.table th { position: sticky; top: 0; padding: 10px 14px; border-block: 1px solid var(--line); background: var(--surface-2); text-align: left; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); white-space: nowrap; }
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child, .table td:last-child { padding-right: 20px; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color .15s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tr[data-href], .table tr[data-id] { cursor: pointer; }
.table .num { text-align: right; }
.mono { letter-spacing: .01em; font-weight: 600; }
.cell-main { display: flex; align-items: center; gap: 10px; }
.cell-main b { font-weight: 600; }
.cell-main small { display: block; font-size: var(--fs-xs); color: var(--faint); }
th button.sort { display: inline-flex; align-items: center; gap: 4px; color: inherit; font-weight: inherit; }
th button.sort .ico { width: 12px; height: 12px; opacity: .5; }
th button.sort[aria-sort] .ico { opacity: 1; color: var(--primary); }

.field { display: grid; gap: 6px; }
.label { font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }
.input, .select, .textarea { width: 100%; height: 40px; padding: 0 14px; border: 0; border-radius: 14px; background: var(--glass-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); transition: box-shadow .2s; }
.textarea { height: auto; min-height: 96px; padding: 10px 14px; line-height: 1.5; resize: vertical; }
.select {
  appearance: none; padding-right: 32px;
  background-image: linear-gradient(45deg, transparent 50%, var(--faint) 50%), linear-gradient(135deg, var(--faint) 50%, transparent 50%);
  background-position: calc(100% - 17px) center, calc(100% - 12px) center; background-repeat: no-repeat; background-size: 5px 5px;
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .select:focus, .textarea:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--text); }
.input-icon { position: relative; }
.input-icon .ico { position: absolute; top: 50%; left: 13px; width: 16px; height: 16px; margin-top: -8px; color: var(--faint); pointer-events: none; }
.input-icon .input { padding-left: 36px; border-radius: 999px; }

.switch { position: relative; display: inline-flex; flex: none; width: 40px; height: 24px; }
.switch input { position: absolute; inset: 0; z-index: 1; margin: 0; opacity: 0; cursor: pointer; }
.switch__track { width: 100%; height: 100%; border-radius: 99px; background: var(--line-2); transition: background-color .25s; }
.switch__knob { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #00000040; transition: transform .35s cubic-bezier(.3, 1.4, .5, 1); }
.switch input:checked ~ .switch__track { background: var(--c3); }
.switch input:checked ~ .switch__knob { transform: translateX(16px); }
.switch input:focus-visible ~ .switch__track { outline: 2px solid var(--text); outline-offset: 2px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--ink-btn); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 32px; padding: 0 13px; border-radius: 999px; background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); font-size: var(--fs-sm); font-weight: 600; transition: background-color .2s, color .2s, box-shadow .2s; }
.chip:hover { color: var(--text); }
.chip[aria-pressed="true"] { background: var(--pill); color: var(--on-pill); box-shadow: none; }

.empty { display: grid; place-items: center; gap: 6px; padding: 40px 16px; text-align: center; color: var(--muted); }
.empty b { font-weight: 600; color: var(--text); }
.float-up { position: fixed; z-index: 70; font-size: var(--fs-md); font-weight: 700; color: var(--up); pointer-events: none; }

.thumb {
  --h: 200; --s: 40px;
  display: inline-grid; flex: none; place-items: center; width: var(--s); height: var(--s); border-radius: calc(var(--s) * .3);
  background: hsl(var(--h) calc(52% * var(--sat)) 85%); color: hsl(var(--h) calc(42% * var(--sat)) 24%);
  font-size: calc(var(--s) * .32); font-weight: 700; letter-spacing: .02em;
}
:root[data-theme="dark"] .thumb { background: hsl(var(--h) calc(30% * var(--sat)) 28%); color: hsl(var(--h) calc(75% * var(--sat)) 88%); }

.pal { display: flex; flex-wrap: wrap; gap: 10px; }
.pal__opt { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 14px 6px 6px; border-radius: 999px; background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--line); font-size: var(--fs-md); font-weight: 600; color: var(--muted); transition: box-shadow .2s, color .2s; }
.pal__opt:hover { color: var(--text); }
.pal__opt[aria-checked="true"] { color: var(--text); box-shadow: inset 0 0 0 2px var(--text); }
.pal__sw { display: grid; flex: none; grid-template-columns: 1fr 1fr; width: 32px; height: 32px; border-radius: 50%; overflow: hidden; box-shadow: inset 0 0 0 1px #00000014; }
.pal__sw i { display: block; }

@media (width <= 1100px) { .statbar { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
@media (width <= 560px) {
  .statbar { gap: 10px; }
  .statbar > * { padding: 16px; }
  .statbar .stat__val { font-size: var(--fs-3xl); }
  .table .t-opt { display: none; }
  .table-wrap { margin: 0 -16px -16px; }
  .table th:first-child, .table td:first-child { padding-left: 16px; }
  .table th:last-child, .table td:last-child { padding-right: 16px; }
}
@media (hover: none) { .table tbody tr:hover { background: none; } }
@media (pointer: coarse) {
  .chip { height: 38px; padding: 0 14px; }
  .input, .select { height: 44px; }
  .switch input { inset: -10px; }
  .check input { width: 20px; height: 20px; }
  .view .chip { min-height: 36px; }
}
@media (pointer: coarse), (width <= 720px) {
  .table th button.sort { display: inline-block; margin-block: -5px; padding-block: 5px; }
}


.cal-btn { display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer; }
.cal-btn .ico { width: 16px; height: 16px; color: var(--faint); }
.cal-btn [data-cal-txt], .cal-btn [data-hr-txt] { flex: 1; font-weight: 600; font-variant-numeric: tabular-nums; }
.cal-btn__seta { transition: rotate .3s var(--ease); }
.cal-btn[aria-expanded="true"] { box-shadow: inset 0 0 0 1.5px var(--text); }
.cal-btn[aria-expanded="true"] .cal-btn__seta { rotate: 180deg; }
.cal { overflow: hidden; margin-top: 8px; padding: 12px; border-radius: var(--r); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.cal[hidden] { display: none; }
.cal__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal__mes { font-size: var(--fs-lg); font-weight: 700; letter-spacing: -.01em; }
.cal__mes::first-letter { text-transform: uppercase; }
.cal__ant { scale: -1 1; }
.cal__sem, .cal__grade { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal__sem span { padding: 4px 0; color: var(--faint); font-size: var(--fs-xs); font-weight: 700; text-align: center; }
.cal__d { position: relative; height: 38px; border-radius: 12px; font-size: var(--fs-md); font-weight: 600; font-variant-numeric: tabular-nums; transition: background-color .15s, color .15s; }
.cal__d:hover:not([disabled]) { background: var(--well); }
.cal__d.is-fora { color: var(--faint); font-weight: 500; }
.cal__d.is-hoje { box-shadow: inset 0 0 0 1.5px var(--line-2); }
.cal__d.is-hoje::after { content: ""; position: absolute; bottom: 5px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor; }
.cal__d.is-sel { background: var(--pill); color: var(--on-pill); box-shadow: none; }
.cal__d[disabled] { opacity: .3; cursor: not-allowed; }
.cal__pe { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.cal__pe .chip { height: 28px; font-size: var(--fs-xs); }

.hr { display: grid; gap: 6px; overflow: hidden; margin-top: 8px; padding: 12px; border-radius: var(--r); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.hr[hidden] { display: none; }
.hr__t { font-size: var(--fs-2xs); font-weight: 700; color: var(--faint); letter-spacing: .04em; text-transform: uppercase; }
.hr__horas { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.hr__min { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.hr__b { height: 32px; border-radius: 10px; font-size: var(--fs-sm); font-weight: 600; font-variant-numeric: tabular-nums; transition: background-color .15s, color .15s; }
.hr__b:hover { background: var(--well); }
.hr__b.is-sel { background: var(--pill); color: var(--on-pill); }

.tema-pop { width: min(380px, 100vw - 24px); padding: 16px; display: grid; gap: 14px; }
.tema-pop__h { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tema-pop__h b { font-size: var(--fs-lg); font-weight: 700; }
.tema-modo { display: grid; grid-template-columns: 1fr 1fr; }
.tema-lista { display: grid; gap: 6px; }
.tema-op {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 12px 8px 8px; border-radius: var(--r-sm);
  background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--line); text-align: left; transition: box-shadow .2s, background-color .2s;
}
.tema-op:hover { background: var(--well); }
.tema-op[aria-checked="true"] { box-shadow: inset 0 0 0 2px var(--text); }
.tema-op .pal__sw { width: 36px; height: 36px; }
.tema-op span:not(.pal__sw) { display: grid; flex: 1; line-height: 1.25; }
.tema-op b { font-size: var(--fs-md); font-weight: 600; }
.tema-op small { color: var(--faint); font-size: var(--fs-xs); }
.tema-op .ico { width: 16px; height: 16px; color: var(--up); opacity: 0; }
.tema-op[aria-checked="true"] .ico { opacity: 1; }
.tema-pop { position: fixed; z-index: 60; border-radius: var(--r); background: var(--float); box-shadow: var(--shadow-pop), inset 0 0 0 1px var(--line); }
.tema-pop[hidden] { display: none; }


/* Ícones animados (animateicons, PulsoIcon, morphicons): mesmo tamanho, traço e cor dos .ico do sprite.
   O <morph-icon> não ocupa caixa própria (display: contents), por isso o tamanho vai numa variável que o desenho herda. */
animate-icons, pulso-icone, morph-icon { --ico-s: 18px; display: inline-grid; flex: none; place-items: center; width: var(--ico-s); height: var(--ico-s); color: currentColor; line-height: 0; }
animate-icons svg, pulso-icone svg, morph-icon svg { width: var(--ico-s); height: var(--ico-s); overflow: visible; }
animate-icons svg :is(path, line, circle, rect, polyline, polygon, ellipse) { stroke-width: 1.8px; }
.btn :is(animate-icons, pulso-icone, morph-icon) { --ico-s: 16px; }
/* Ícone animado com class="ico": o elemento pega o tamanho do .ico do lugar (botão, chip, dock) e o desenho ocupa tudo. */
:is(animate-icons, pulso-icone).ico { display: inline-grid; place-items: center; line-height: 0; }
:is(animate-icons, pulso-icone).ico svg { width: 100%; height: 100%; overflow: visible; }

.dock__btn :is(animate-icons, pulso-icone, morph-icon), .ibtn :is(animate-icons, pulso-icone, morph-icon) { --ico-s: 20px; }

/* Paleta cuja cor de destaque é forte (Rubi, Cobre, Índigo, Turquesa e as paletas de projeto feitas da logo, com
   data-tile-claro no <html>): o primeiro bloco e o .tile--sky ficam na cor, com texto, selos e mini gráficos em branco. */
:root:is([data-palette="rubi"], [data-palette="indigo"], [data-tile-claro]) :is(.statbar > :first-child, .tile--sky) {
  --text: #fff; --muted: #ffffffd1; --faint: #ffffffb8; --well: #ffffff26;
  --line: #ffffff2e; --line-2: #ffffff47; --surface: color-mix(in srgb, var(--sky) 86%, #000); --surface-2: #ffffff1a;
  --up: #fff; --up-soft: #ffffff2e; --down: #fff; --down-soft: #0000002e;
  --primary: #fff; --primary-ink: #fff; --c1: #fff; --c2: #ffffff80; --c3: #fff; --c4: #ffffffb3; --rim: #ffffff26;
  background: var(--sky); color: var(--text); box-shadow: 0 18px 40px -22px color-mix(in srgb, var(--sky) 60%, transparent);
}
.tema-lista { max-height: min(56vh, 470px); overflow-y: auto; margin-right: -6px; padding-right: 6px; scrollbar-width: thin; }
