@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700&family=Alegreya+Sans:wght@400;500;700;800&family=Alegreya+Sans+SC:wght@500;700&display=swap');

/* Tema dos sites oficiais (castelobruxorp.com.br e o Currículo de Hogwarts): noite + ouro. */
:root {
  --bg: #0b0e14; --topo: #080d17; --surface: #141924; --surface-2: #1d2331; --col: #111622; --line: #2b2f3a; --line-ouro: rgba(233, 196, 106, .28);
  --text: #f0e7d3; --text-dim: #cfc3ac; --text-faint: #9c937f;
  --accent: #e9c46a; --accent-2: #c9a65a; --accent-ink: #1b1508; --blue: #8fa8e0; --ok: #3fa56b; --err: #e0625a;
  --p-baixa: #6b7a99; --p-media: #c9a65a; --p-alta: #e8913a; --p-urgente: #c8372d;
  --c0: #9b7be0; --c1: #3fa56b; --c2: #e0625a; --c3: #d85ca0; --c4: #e9c46a;
  --sombra: 0 10px 30px rgba(0, 0, 0, .45);
  --f-display: 'Cinzel', Georgia, serif; --f-ui: 'Alegreya Sans', system-ui, sans-serif; --f-label: 'Alegreya Sans SC', system-ui, sans-serif;
}
:root[data-tema="claro"] {
  --bg: #ecdcb4; --topo: #e3cd9b; --surface: #fbf3df; --surface-2: #f1e4c2; --col: #f5e9cb; --line: #c9b285; --line-ouro: rgba(167, 125, 67, .45);
  --text: #24170c; --text-dim: #3a2412; --text-faint: #6b4524;
  --accent: #8e5f1e; --accent-2: #a77d43; --accent-ink: #fff8e6; --blue: #1d2a4a; --ok: #2f7a4f; --err: #a8322a;
  --p-baixa: #7c8aa5; --p-media: #a77d43; --p-alta: #a85d12; --p-urgente: #8e1f1a;
  --c0: #6b4fb8; --c1: #2f7a4f; --c2: #a8322a; --c3: #a63f7a; --c4: #a77d43;
  --sombra: 0 8px 24px rgba(58, 36, 18, .2);
}
* { box-sizing: border-box; }
html, body, #app { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 var(--f-ui); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue); }
.oculto { display: none !important; }
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---- botões e campos ---- */
.btn { border: 1px solid var(--line); background: var(--surface-2); padding: 6px 12px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn.pri { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.btn.perigo { color: var(--err); }
.btn.fino { padding: 3px 9px; font-size: 13.5px; }
.btn:disabled { opacity: .5; cursor: default; }
button:focus-visible, .card:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input, select, textarea { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; min-width: 0; }
textarea { width: 100%; min-height: 110px; resize: vertical; }
label.campo { display: flex; flex-direction: column; gap: 4px; font: 13px var(--f-label); color: var(--text-faint); letter-spacing: .04em; }
label.campo > * { font: 15px var(--f-ui); color: var(--text); letter-spacing: normal; }

/* ---- login ---- */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse 900px 420px at 50% -10%, rgba(233, 196, 106, .16), transparent), var(--bg); }
.login-box { background: var(--surface); border: 1px solid var(--line-ouro); border-radius: 14px; padding: 32px; max-width: 400px; width: 100%; text-align: center; box-shadow: var(--sombra); }
.login-box img { width: 100%; max-width: 300px; height: auto; display: block; margin: 0 auto; }
.login-box h1 { font-family: var(--f-display); font-weight: 700; font-size: 26px; line-height: 1.2; margin: 12px 0 4px; letter-spacing: .04em; }
.login-box h1 span { color: var(--accent); }
.login-box p { color: var(--text-dim); margin: 8px 0 20px; }
.btn-discord { display: inline-flex; align-items: center; gap: 10px; background: #5865f2; color: #fff; border: 0; border-radius: 8px; padding: 11px 20px; font-weight: 700; text-decoration: none; }
.btn-discord:hover { filter: brightness(1.08); }
.erro { color: var(--err); background: color-mix(in srgb, var(--err) 12%, transparent); border: 1px solid color-mix(in srgb, var(--err) 40%, transparent); border-radius: 8px; padding: 8px 12px; margin: 0 0 16px; font-size: 14px; }

/* ---- estrutura: topo + menu lateral + conteúdo ---- */
.app { display: grid; grid-template: 'topo topo' 60px 'lateral main' 1fr / 64px 1fr; height: 100%; }
.topo { grid-area: topo; display: flex; align-items: center; gap: 12px; padding: 0 16px 0 8px; background: var(--topo); border-bottom: 1px solid var(--line); min-width: 0; }
.lado-toggle, .redondo { border: 1px solid var(--line); background: transparent; color: var(--text-dim); width: 38px; height: 38px; border-radius: 50%; cursor: pointer; display: inline-grid; place-items: center; flex: none; }
.lado-toggle { display: none; border-color: transparent; border-radius: 8px; }
.redondo:hover, .lado-toggle:hover { color: var(--accent); border-color: var(--line-ouro); }
.marca { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); padding-left: 6px; min-width: 0; }
.marca img { height: 40px; width: auto; display: block; }
.marca-nome { font-family: var(--f-display); font-weight: 700; font-size: 19px; letter-spacing: .04em; color: var(--accent); white-space: nowrap; }
.marca-sub { padding-left: 10px; border-left: 1px solid var(--line-ouro); font-family: var(--f-display); font-weight: 600; font-size: 15px; letter-spacing: .08em; text-transform: uppercase; color: var(--text); }
.topo .quadro-sel { max-width: 200px; font-weight: 700; background: var(--surface); margin-left: 8px; }
.espaco { flex: 1; }
.relogio { display: inline-flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-variant-numeric: tabular-nums; color: var(--text-faint); white-space: nowrap; }
.relogio b { color: var(--text); letter-spacing: .03em; }
.eu { display: flex; align-items: center; gap: 10px; padding-left: 12px; border-left: 1px solid var(--line); min-width: 0; }
.eu-txt { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.eu-txt b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.eu-txt small { font: 12px var(--f-label); letter-spacing: .12em; color: var(--text-faint); text-transform: uppercase; }
.avatar.iniciais { background: var(--accent); color: var(--accent-ink); border: 2px solid var(--accent-2); font-weight: 800; }

.lateral { grid-area: lateral; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 0 14px; background: var(--topo); border-right: 1px solid var(--line); }
.lado-btn { width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--text-faint); cursor: pointer; display: grid; place-items: center; }
.lado-btn:hover { color: var(--accent); background: var(--surface); }
.lado-btn.ativo { background: var(--accent); color: var(--accent-ink); }
.lado-btn.sair { color: var(--err); border: 1px solid color-mix(in srgb, var(--err) 35%, transparent); }
.lado-btn.sair:hover { background: color-mix(in srgb, var(--err) 14%, transparent); }

.principal { grid-area: main; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.busca-linha { display: flex; justify-content: center; padding: 22px 16px 4px; }
.busca { width: min(480px, 100%); padding: 10px 16px; border-radius: 10px; background: var(--surface); border-color: var(--line); }
.busca::placeholder { color: var(--text-faint); }

/* ---- quadro e colunas ---- */
.quadro { flex: 1; min-height: 0; display: flex; gap: 20px; align-items: flex-start; overflow-x: auto; padding: 16px 24px 20px; }
.coluna { --cor: var(--c0); flex: 0 0 310px; max-height: 100%; display: flex; flex-direction: column; background: var(--col); border: 1px solid var(--line); border-radius: 12px; padding: 0 16px 16px; }
.coluna.cor1 { --cor: var(--c1); } .coluna.cor2 { --cor: var(--c2); } .coluna.cor3 { --cor: var(--c3); } .coluna.cor4 { --cor: var(--c4); }
.coluna.alvo { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.coluna-topo { display: flex; align-items: center; gap: 8px; padding: 16px 0 10px; margin-bottom: 14px; border-bottom: 2px solid var(--cor); }
.coluna-nome { font-family: var(--f-display); font-weight: 700; font-size: 15px; letter-spacing: .03em; flex: 1; overflow-wrap: anywhere; }
.contador { font-size: 12px; font-weight: 800; min-width: 24px; text-align: center; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-dim); font-variant-numeric: tabular-nums; }
.menu-btn { border: 0; background: transparent; cursor: pointer; color: var(--text-faint); padding: 2px 6px; border-radius: 4px; font-size: 18px; line-height: 1; }
.menu-btn:hover { background: var(--surface-2); color: var(--text); }
.cards { flex: 1 1 auto; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; min-height: 40px; padding: 8px 4px 2px 10px; margin: -8px -6px 0 -10px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.sem-tarefas { border: 1px dashed var(--line); border-radius: 8px; padding: 24px 8px; text-align: center; font-style: italic; color: var(--text-faint); }
.coluna.alvo .sem-tarefas { display: none; }
.mais { margin-top: 12px; width: 100%; border: 1px solid var(--line); background: transparent; color: var(--accent); border-radius: 8px; padding: 8px; cursor: pointer; font-size: 14px; }
.mais:hover { background: var(--surface); border-color: var(--line-ouro); }
.coluna-pe { padding-top: 10px; }
.add-card { width: 100%; text-align: left; border: 0; background: transparent; color: var(--text-faint); padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.add-card:hover { background: var(--surface); color: var(--accent); }
.nova-coluna { flex: 0 0 260px; }
.nova-coluna .coluna-topo { display: none; }
.nova-coluna .coluna-pe { padding-top: 16px; }
.form-inline { display: flex; flex-direction: column; gap: 6px; }
.form-inline .linha { display: flex; gap: 6px; }

/* ---- cartão ---- */
.card { position: relative; flex: none; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--p-media); border-radius: 8px; padding: 14px 14px 12px 16px; cursor: pointer; }
.card:hover { border-color: var(--line-ouro); border-left-color: var(--accent); }
.card.p-baixa { border-left-color: var(--p-baixa); }
.card.p-alta { border-left-color: var(--p-alta); }
.card.p-urgente { border-left-color: var(--p-urgente); }
.coluna.feito .card { border-left-color: var(--ok); }
.card.arrastando { opacity: .4; }
.card-titulo { font-weight: 800; line-height: 1.3; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.feito-selo { position: absolute; top: -7px; left: -9px; width: 22px; height: 22px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 3px var(--col); }
.feito-selo .ico { width: 14px; height: 14px; stroke-width: 3; }
.card-info { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 12px 0 0; font-size: 13px; }
.card-info dt { color: var(--text-faint); font-weight: 700; }
.card-info dd { margin: 0; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-info .vencido { color: var(--err); font-weight: 700; }
.card-pe { display: flex; align-items: center; gap: 6px 8px; margin-top: 10px; font-size: 12.5px; color: var(--text-faint); flex-wrap: wrap; }
.pri-tag { font: 12px var(--f-label); letter-spacing: .06em; color: var(--p-alta); }
.card.p-urgente .pri-tag { color: var(--err); }
.etiquetas { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 5px; }
.etq { font-size: 11.5px; font-weight: 700; padding: 0 8px; border-radius: 999px; color: #14100a; }
.avatares { display: flex; margin-left: auto; }
.avatar { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--surface); background: var(--surface-2); object-fit: cover; margin-left: -6px; display: inline-grid; place-items: center; font-size: 10px; font-weight: 700; color: var(--text); flex: none; }
.avatar.g { width: 38px; height: 38px; margin: 0; font-size: 13px; }
.placeholder { border: 2px dashed var(--accent); border-radius: 8px; min-height: 40px; opacity: .6; flex: none; }

/* ---- menus ---- */
.menu { position: fixed; z-index: 50; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--sombra); padding: 4px; min-width: 200px; }
.menu button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 7px 10px; border-radius: 6px; cursor: pointer; }
.menu button:hover { background: var(--surface-2); }
.menu button.perigo { color: var(--err); }

/* ---- modal ---- */
.fundo { position: fixed; inset: 0; z-index: 40; background: rgba(5, 8, 15, .7); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow-y: auto; }
.modal { background: var(--surface); border: 1px solid var(--line-ouro); border-radius: 14px; width: 100%; max-width: 860px; box-shadow: var(--sombra); }
.modal-topo { display: flex; align-items: flex-start; gap: 10px; padding: 16px 18px 6px; }
.modal-topo .titulo { flex: 1; font-size: 20px; font-weight: 800; border-color: transparent; background: transparent; padding: 4px 6px; }
.modal-topo .titulo:hover, .modal-topo .titulo:focus { border-color: var(--line); background: var(--bg); }
.fechar { border: 0; background: transparent; font-size: 24px; line-height: 1; cursor: pointer; color: var(--text-faint); padding: 2px 8px; }
.modal-corpo { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 22px; padding: 10px 20px 20px; }
@media (max-width: 720px) { .modal-corpo { grid-template-columns: 1fr; } }
.modal .lado { display: flex; flex-direction: column; gap: 14px; padding: 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; align-self: start; }
.modal .lado select, .modal .lado input:not([type=checkbox]) { width: 100%; }
.modal-corpo textarea { min-height: 120px; }
.secao > input:not([type=checkbox]) { width: 100%; }
.secao h3 { font: 700 14px var(--f-label); letter-spacing: .08em; color: var(--accent); margin: 16px 0 8px; }
.secao:first-child h3 { margin-top: 0; }
.resp-lista { display: flex; flex-direction: column; gap: 4px; max-height: 190px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: var(--bg); }
.resp-lista label { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 2px 4px; border-radius: 4px; }
.resp-lista label:hover { background: var(--surface-2); }
.checklist { display: flex; flex-direction: column; gap: 4px; }
.checklist .item { display: flex; align-items: center; gap: 8px; }
.checklist .item input[type=text] { flex: 1; border-color: transparent; background: transparent; }
.checklist .item input[type=text]:focus { border-color: var(--line); background: var(--bg); }
.checklist .item.feito input[type=text] { text-decoration: line-through; color: var(--text-faint); }
.barra { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; margin-bottom: 8px; }
.barra > div { height: 100%; background: var(--ok); width: 0; transition: width .2s; }
.barra .w0 { width: 0; } .barra .w10 { width: 10%; } .barra .w20 { width: 20%; } .barra .w30 { width: 30%; } .barra .w40 { width: 40%; }
.barra .w50 { width: 50%; } .barra .w60 { width: 60%; } .barra .w70 { width: 70%; } .barra .w80 { width: 80%; } .barra .w90 { width: 90%; } .barra .w100 { width: 100%; }
.comentario, .hist { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.comentario .txt { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-dim); }
.quem { font-weight: 700; color: var(--text); }
.quando { font-size: 12px; color: var(--text-faint); margin-left: 6px; }
.hist { font-size: 13.5px; color: var(--text-dim); padding: 5px 0; }
.modal-pe { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; padding: 12px 18px 16px; border-top: 1px solid var(--line); }
.modal-pe .espaco { flex: 1; }
.modal.pequeno { max-width: 520px; }
.lista-arq { display: flex; flex-direction: column; gap: 6px; padding: 0 18px 18px; }
.lista-arq .linha { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.lista-arq .linha span { flex: 1; overflow-wrap: anywhere; }
.vazio { color: var(--text-faint); padding: 8px 0; }

/* ---- aviso flutuante ---- */
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 60; background: var(--surface); border: 1px solid var(--line-ouro); border-radius: 10px; padding: 9px 16px; box-shadow: var(--sombra); max-width: calc(100vw - 32px); }
.toast.erro-t { border-color: var(--err); color: var(--err); }

@media (max-width: 900px) {
  .relogio .data, .eu-txt { display: none; }
}
@media (max-width: 640px) {
  .app { grid-template: 'topo' 56px 'main' 1fr / 1fr; }
  .lado-toggle { display: inline-grid; }
  .lateral { display: none; position: fixed; top: 56px; bottom: 0; left: 0; width: 64px; z-index: 30; }
  .app.lado-aberto .lateral { display: flex; }
  .marca-sub, .relogio, .topo .redondo { display: none; }
  .topo { gap: 8px; padding: 0 12px 0 4px; }
  .topo .quadro-sel { max-width: 40vw; margin-left: 0; }
  .eu { padding-left: 0; border: 0; }
  .busca-linha { padding: 14px 16px 0; }
  .quadro { padding: 12px 16px; gap: 14px; }
  .coluna { flex-basis: 84vw; }
}

.etq.c0 { background: #e9c46a; } .etq.c1 { background: #8fa8e0; } .etq.c2 { background: #6cc28f; } .etq.c3 { background: #e78c84; }
.etq.c4 { background: #b9a0ee; } .etq.c5 { background: #7ad6d1; } .etq.c6 { background: #f0a868; } .etq.c7 { background: #cfc3ac; }
