/* Organizador Freelance – limpo, mas acolhedor (v3) */
@font-face { font-family: "Nunito"; font-style: normal; font-display: swap; font-weight: 200 1000;
  src: url(../fonts/nunito-latin-wght-normal.woff2) format("woff2-variations"), url(../fonts/nunito-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Nunito"; font-style: normal; font-display: swap; font-weight: 200 1000;
  src: url(../fonts/nunito-latin-ext-wght-normal.woff2) format("woff2-variations"), url(../fonts/nunito-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

:root {
  --bg: #f6f4f0; --sup: #ffffff; --sup2: #efebe5; --txt: #1f1d1b; --txt2: #6f6a63; --txt3: #a7a199; --linha: #ebe7e0;
  --acc: #4a63e6; --acc-txt: #ffffff; --acc-link: #4a63e6;
  --acc-suave: color-mix(in srgb, var(--acc) 11%, transparent); --acc-fundo: color-mix(in srgb, var(--acc) 8%, var(--sup));
  --pago: #3f9a5f; --aguardar: #d38b2a; --porfazer: #b9b2a8; --perigo: #d0533f;
  --sombra: 0 1px 2px rgba(60,45,30,.04), 0 6px 18px rgba(60,45,30,.05);
  --r: 18px; --tabs-h: 58px; color-scheme: light;
  --fonte: ui-rounded, "SF Pro Rounded", "Nunito", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}
html[data-tema="escuro"] {
  --bg: #141312; --sup: #1e1c1b; --sup2: #292725; --txt: #f3f0eb; --txt2: #a6a098; --txt3: #6e6963; --linha: #2f2c29;
  --acc-fundo: color-mix(in srgb, var(--acc) 16%, var(--sup));
  --pago: #6cc48a; --aguardar: #f0b357; --porfazer: #6e6963; --perigo: #f0806e;
  --sombra: none; color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--txt); }
body { font: 16px/1.45 var(--fonte); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; overscroll-behavior-y: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
svg.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

#vista { padding: calc(env(safe-area-inset-top) + 14px) 18px calc(var(--tabs-h) + env(safe-area-inset-bottom) + 32px); max-width: 640px; margin: 0 auto; }

/* cabeçalhos */
.cab { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 10px 2px 4px; min-height: 40px; }
.cab h1 { font-size: 30px; font-weight: 800; letter-spacing: -.01em; margin: 0; }
.cab .acoes { display: flex; gap: 6px; }
.sub { color: var(--txt2); font-size: 15px; margin: 0 2px 18px; }
h2 { font-size: 14px; font-weight: 700; color: var(--txt2); margin: 28px 4px 8px; display: flex; justify-content: space-between; align-items: baseline; }
h2 .link { font-size: 14px; }
.icone-btn { width: 40px; height: 40px; border: 0; background: var(--sup); box-shadow: var(--sombra); color: var(--txt); display: grid; place-items: center; border-radius: 50%; padding: 0; }
.icone-btn:active { transform: scale(.94); }
.icone-btn.ativo { background: var(--acc); color: var(--acc-txt); }
.link { border: 0; background: none; color: var(--acc-link); font-weight: 700; padding: 4px 0; font-size: 15px; }
.rot { font-size: 13px; color: var(--txt2); }

/* cartões */
.cartao, .lista, .kvs { background: var(--sup); border-radius: var(--r); box-shadow: var(--sombra); }
.cartao { padding: 16px; margin-bottom: 12px; }
.resumo { background: var(--acc-fundo); border-radius: 22px; padding: 18px 18px 16px; margin-bottom: 12px; }
.resumo .rot { margin-bottom: 2px; }
.grande { font-size: 38px; font-weight: 800; letter-spacing: -.02em; line-height: 1.12; margin: 2px 0 4px; }
.nota { font-size: 13px; color: var(--txt2); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.stats > div { background: var(--sup); border-radius: 14px; padding: 10px 8px 10px 11px; min-width: 0; container-type: inline-size; }
.stats .v { font-size: clamp(11px, 15.5cqi, 15px); font-weight: 800; letter-spacing: -0.2px; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* listas */
.lista { padding: 0 16px; margin-bottom: 10px; }
.item { display: flex; align-items: center; gap: 12px; padding: 13px 0; border: 0; background: none; width: 100%; text-align: left; }
.item + .item { border-top: 1px solid var(--linha); }
.item:active { opacity: .6; }
.item .meio { flex: 1; min-width: 0; }
.item .t1 { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .t2 { font-size: 13px; color: var(--txt2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.item .dir { text-align: right; flex-shrink: 0; }
.item .valor { font-size: 15px; font-weight: 700; }
.item .seta { color: var(--txt3); }
.marca { width: 4px; align-self: stretch; border-radius: 4px; background: var(--c, var(--linha)); flex-shrink: 0; margin: 2px 0; }
.bolinha { width: 30px; height: 30px; border-radius: 10px; background: var(--c, var(--sup2)); color: var(--ct, var(--txt2)); display: grid; place-items: center; font-size: 13px; font-weight: 800; flex-shrink: 0; }
.ponto { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--txt3)); flex-shrink: 0; }
.grupo { font-size: 14px; font-weight: 700; color: var(--txt2); margin: 22px 4px 8px; display: flex; justify-content: space-between; }

/* estado */
.estado { font-size: 12px; font-weight: 700; color: var(--txt2); display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; margin-top: 3px;
  padding: 2px 8px 2px 7px; border-radius: 999px; background: color-mix(in srgb, var(--porfazer) 22%, transparent); }
.estado::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--porfazer); }
.e-pago { color: var(--pago); background: color-mix(in srgb, var(--pago) 14%, transparent); } .e-pago::before { background: var(--pago); }
.e-a-aguardar-pagamento { color: color-mix(in srgb, var(--aguardar) 80%, var(--txt)); background: color-mix(in srgb, var(--aguardar) 16%, transparent); } .e-a-aguardar-pagamento::before { background: var(--aguardar); }
.atrasado { color: var(--perigo); font-weight: 700; }

/* pesquisa, filtros, segmentos */
.pesquisa { display: flex; align-items: center; gap: 8px; background: var(--sup); box-shadow: var(--sombra); border-radius: 14px; padding: 0 14px; margin: 12px 0; color: var(--txt3); }
.pesquisa input { border: 0; background: none; outline: 0; padding: 11px 0; flex: 1; font-size: 16px; color: var(--txt); }
.pesquisa input::placeholder { color: var(--txt3); }
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -18px 4px; padding: 2px 18px 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { border: 0; background: var(--sup); box-shadow: var(--sombra); padding: 7px 14px; border-radius: 999px; font-size: 14px; font-weight: 700; white-space: nowrap; color: var(--txt2); }
.chip.on { background: var(--acc); color: var(--acc-txt); }
.seg { display: flex; background: var(--sup2); border-radius: 14px; padding: 3px; margin: 12px 0; }
.seg button { flex: 1; border: 0; background: none; padding: 8px 4px; border-radius: 11px; font-size: 14px; font-weight: 700; color: var(--txt2); }
.seg button.on { background: var(--sup); color: var(--txt); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 14px; padding: 14px 16px; font-weight: 800; background: var(--acc); color: var(--acc-txt); width: 100%; font-size: 16px; }
.btn.sec { background: var(--sup); color: var(--txt); box-shadow: var(--sombra); }
.btn.perigo { background: color-mix(in srgb, var(--perigo) 10%, var(--sup)); color: var(--perigo); }
.btn:active { transform: scale(.98); opacity: .85; }
.btns { display: grid; gap: 10px; margin-top: 20px; }
.btns.dois { grid-template-columns: 1fr 1fr; }
.btns + .btns { margin-top: 10px; }

/* separadores */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around; background: color-mix(in srgb, var(--sup) 90%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%); border-top: 1px solid var(--linha); padding: 6px 6px calc(env(safe-area-inset-bottom) + 4px); z-index: 10; }
.tab { flex: 1; border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 10.5px; font-weight: 700; color: var(--txt3); padding: 2px 0; }
.tab .ic { width: 24px; height: 24px; }
.tab.on { color: var(--acc-link); }

/* folhas */
.folha-fundo { position: fixed; inset: 0; background: rgba(20,15,10,.3); z-index: 20; display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.folha { background: var(--bg); width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto; border-radius: 26px 26px 0 0; padding: 6px 18px calc(env(safe-area-inset-bottom) + 24px); animation: sobe .28s cubic-bezier(.2,.8,.2,1); }
.pega { width: 38px; height: 5px; border-radius: 3px; background: var(--linha); margin: 4px auto 6px; }
.folha-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: sticky; top: -6px; background: var(--bg); padding: 8px 2px 12px; z-index: 2; margin-bottom: 6px; }
.folha-cab h3 { margin: 0; font-size: 17px; font-weight: 800; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes sobe { from { transform: translateY(30px); opacity: .5; } }
@keyframes fade { from { opacity: 0; } }
.titulo-folha { display: flex; gap: 12px; align-items: stretch; margin: 2px 0 16px; }
.titulo-folha .marca { width: 5px; }
.titulo-folha .t { font-size: 22px; font-weight: 800; line-height: 1.2; }

/* formulários */
.campo { display: block; margin-bottom: 14px; }
.campo > span { display: block; font-size: 13px; font-weight: 700; color: var(--txt2); margin: 0 4px 6px; }
.campo input, .campo select, .campo textarea { width: 100%; border: 1px solid var(--linha); background: var(--sup); border-radius: 13px; padding: 11px 13px; font-size: 16px; outline: 0; min-height: 46px; -webkit-appearance: none; appearance: none; }
.campo textarea { min-height: 86px; resize: vertical; }
.campo input:focus, .campo select:focus, .campo textarea:focus { border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-suave); }
.linha2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.linha2 > * { min-width: 0; }
.interruptor { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--sup); border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; box-shadow: var(--sombra); }
.interruptor input { width: 48px; height: 28px; -webkit-appearance: none; appearance: none; background: var(--sup2); border-radius: 14px; position: relative; transition: background .2s; margin: 0; flex-shrink: 0; }
.interruptor input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.interruptor input:checked { background: var(--acc); }
.interruptor input:checked::after { transform: translateX(20px); }
.ajuda { font-size: 13px; color: var(--txt2); margin: 8px 4px 0; }
.erro-txt { color: var(--perigo); font-size: 14px; font-weight: 700; margin: 6px 4px; }

/* seletor de cor */
.cor-campo { margin-bottom: 16px; }
.cor-campo > span { display: block; font-size: 13px; font-weight: 700; color: var(--txt2); margin: 0 4px 8px; }
.amostras { display: flex; flex-wrap: wrap; gap: 9px; }
.amostra { width: 30px; height: 30px; border-radius: 50%; border: 0; padding: 0; background: var(--c); box-shadow: 0 0 0 2px var(--bg); position: relative; }
.amostra.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--txt); }
.amostra.nenhuma { background: var(--sup); border: 1.5px dashed var(--txt3); }
.amostra.roda-btn { background: conic-gradient(from 90deg, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); }
.amostra.roda-btn::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--sup); }
.amostra.roda-btn.on::after { background: var(--c); }
.recentes-rot { font-size: 12px; color: var(--txt3); margin: 10px 4px 6px; font-weight: 700; }
.roda-painel { background: var(--sup); border-radius: 20px; box-shadow: var(--sombra); padding: 16px; margin-top: 12px; }
.roda-caixa { position: relative; width: 240px; height: 240px; margin: 0 auto; touch-action: none; }
.roda-caixa canvas { width: 240px; height: 240px; display: block; border-radius: 50%; }
.roda-marca { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); background: var(--c); pointer-events: none; }
.brilho { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; border-radius: 14px; margin: 18px 0 12px; background: linear-gradient(90deg, #000, var(--puro, #fff)); outline: 0; }
.brilho::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.brilho::-moz-range-thumb { width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 0; }
.cor-prev { display: flex; align-items: center; gap: 12px; }
.cor-prev .grande-amostra { width: 44px; height: 44px; border-radius: 13px; background: var(--c); color: var(--ct); display: grid; place-items: center; font-size: 12px; font-weight: 800; flex-shrink: 0; }
.cor-prev input { flex: 1; border: 1px solid var(--linha); background: var(--bg); border-radius: 12px; padding: 10px 12px; font-size: 16px; font-family: ui-monospace, Menlo, monospace; text-transform: uppercase; outline: 0; min-width: 0; }

/* tabelas, pares chave/valor */
.tabela { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabela th { text-align: left; font-size: 12px; color: var(--txt3); font-weight: 700; padding: 10px 0 6px; }
.tabela td { padding: 10px 0; border-top: 1px solid var(--linha); }
.tabela .n { text-align: right; white-space: nowrap; padding-left: 8px; }
.cartao.tab-c { padding: 4px 16px 6px; }
.kvs { padding: 0 16px; margin-bottom: 10px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; font-size: 15px; }
.kv + .kv { border-top: 1px solid var(--linha); }
.kv .k { color: var(--txt2); flex: 1 1 auto; min-width: 0; } .kv .v { text-align: right; word-break: break-word; flex-shrink: 0; max-width: 62%; font-weight: 600; }
.kv.forte .v, .kv.forte .k { font-weight: 800; color: var(--txt); }
.texto { white-space: pre-wrap; font-size: 15px; }

.barras { display: flex; align-items: flex-end; gap: 6px; height: 104px; }
.barra { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.barra i { display: block; width: 100%; max-width: 16px; border-radius: 6px; background: color-mix(in srgb, var(--acc) 30%, var(--sup2)); min-height: 2px; }
.barra.atual i { background: var(--acc); }
.barra small { font-size: 10px; font-weight: 700; color: var(--txt3); }

.check { display: flex; align-items: center; gap: 12px; padding: 11px 0; }
.check + .check { border-top: 1px solid var(--linha); }
.check input[type=checkbox] { width: 21px; height: 21px; accent-color: var(--acc); flex-shrink: 0; margin: 0; }
.check.feito span { text-decoration: line-through; color: var(--txt3); }
.check input[type=text] { flex: 1; border: 0; background: none; padding: 2px 0; font-size: 16px; outline: 0; }
.check .mais { width: 21px; text-align: center; color: var(--txt3); font-weight: 800; }

.recibo { white-space: pre-wrap; font: 13.5px/1.6 ui-monospace, "SF Mono", Menlo, monospace; border-radius: 16px; padding: 16px; user-select: text; -webkit-user-select: text; background: var(--sup); box-shadow: var(--sombra); }
.alerta { background: color-mix(in srgb, var(--aguardar) 13%, var(--sup)); border-radius: 14px; padding: 11px 14px; font-size: 14px; color: var(--txt); margin: 10px 0; }
.info { background: var(--sup); border-radius: 16px; box-shadow: var(--sombra); font-size: 14px; color: var(--txt2); padding: 13px 16px; margin-bottom: 10px; }

.aviso { position: fixed; left: 18px; right: 18px; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 14px); max-width: 600px; margin: 0 auto; background: var(--txt); color: var(--bg);
  padding: 12px 16px; border-radius: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; z-index: 40; animation: sobe .2s; font-size: 14px; font-weight: 600; }
.aviso button { border: 0; background: none; color: var(--bg); font-weight: 800; padding: 4px; text-decoration: underline; }

.boasvindas { min-height: 82vh; display: flex; flex-direction: column; justify-content: center; padding: 20px 4px; }
.boasvindas .logo { width: 72px; height: 72px; border-radius: 18px; margin-bottom: 24px; box-shadow: var(--sombra); }
.boasvindas h1 { font-size: 30px; font-weight: 800; margin: 0 0 10px; }
.boasvindas p { color: var(--txt2); margin: 0 0 10px; }
.vazio { background: var(--sup); border-radius: var(--r); box-shadow: var(--sombra); color: var(--txt3); padding: 18px 16px; font-size: 15px; margin-bottom: 10px; }
.embreve { font-size: 14px; color: var(--txt3); margin: 22px 4px 0; }

/* ---------- Agenda ---------- */
.cal-cab { display: flex; align-items: center; justify-content: space-between; margin: 10px 2px 12px; }
.cal-cab h1 { font-size: 26px; font-weight: 800; margin: 0; white-space: nowrap; }
.cal-cab h1 small { font-weight: 600; color: var(--txt3); margin-left: 7px; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-nav .icone-btn { width: 36px; height: 36px; }
.cal-nav .hoje { border: 0; background: var(--acc-suave); color: var(--acc-link); font-weight: 800; border-radius: 999px; padding: 7px 13px; font-size: 14px; }
.cal { margin: 0 -10px; background: var(--sup); border-radius: 22px; box-shadow: var(--sombra); padding: 8px 4px 6px; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.cal-dias { display: grid; grid-template-columns: repeat(7, 1fr); font-size: 11px; font-weight: 800; color: var(--txt3); text-align: center; padding: 2px 0 6px; }
.cal-sem { display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--linha); }
.cal-dia { min-height: 76px; padding: 4px 0; border: 0; background: none; display: flex; flex-direction: column; align-items: stretch; gap: 2px; min-width: 0; border-radius: 12px; }
.cal-dia .n { font-size: 13px; font-weight: 700; width: 25px; height: 25px; line-height: 25px; text-align: center; border-radius: 50%; margin: 0 auto 2px; }
.cal-dia.fora .n { color: var(--txt3); font-weight: 600; }
.cal-dia.fds .n { color: var(--txt2); }
.cal-dia.fora.fds .n { color: var(--txt3); }
.cal-dia.hoje .n { background: var(--acc); color: var(--acc-txt); font-weight: 800; }
.cal-dia.sel { background: var(--acc-suave); }
.ev { display: block; font-size: 10px; font-weight: 750; line-height: 16px; height: 16px; padding: 0 4px; margin: 0 2px; border-radius: 5px; white-space: nowrap; overflow: hidden;
  background: var(--c); color: var(--ct); }
.ev.cont { margin-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.ev.segue { margin-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.ev.vazio-txt { color: transparent; }
.ev.espaco { background: none; }
.cal-mais { font-size: 10px; font-weight: 800; color: var(--txt3); text-align: center; line-height: 12px; }
.dia-cab { margin: 22px 4px 8px; font-size: 13px; color: var(--txt2); display: flex; justify-content: space-between; align-items: baseline; }
.dia-cab b { color: var(--txt); font-weight: 800; font-size: 16px; }
.hora { font-size: 13px; font-weight: 700; color: var(--txt2); width: 44px; flex-shrink: 0; }
