/* Partners A-Z Padel — back office. Imagem A-Z: preto e branco, Archivo, botões em pílula, sem emojis. */
@font-face { font-family: 'Archivo'; src: url('/assets/Archivo-VariableFont.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --black: #000; --ink: #111; --muted: #777; --line: #e6e6e6; --soft: #f5f5f5; --white: #fff;
  --blue: #097ffd; --red: #dc2626; --red-soft: #fdecec; --amber: #92600a; --amber-soft: #fdf3dc; --green: #0f7a43; --green-soft: #e4f5ec;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: var(--ink); background: var(--white); font-size: 15px; line-height: 1.45; }
h1 { font-size: 26px; margin: 0; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 17px; margin: 0 0 12px; font-weight: 700; }
h3 { font-size: 13px; margin: 0 0 8px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
p { margin: 0 0 10px; }
a { color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }

/* Estrutura */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100%; }
.side { background: var(--black); color: var(--white); padding: 24px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 22px; font-weight: 600; letter-spacing: 0.08em; font-size: 12px; text-transform: uppercase; color: #bbb; }
.side .brand img { height: 30px; }
.side a.nav { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: 10px; color: #cfcfcf; text-decoration: none; font-weight: 500; }
.side a.nav:hover { background: #1c1c1c; color: var(--white); }
.side a.nav.on { background: var(--white); color: var(--black); font-weight: 600; }
.side .count { background: var(--white); color: var(--black); border-radius: 999px; font-size: 12px; font-weight: 700; padding: 1px 8px; }
.side a.nav.on .count { background: var(--black); color: var(--white); }
.side .foot { margin-top: auto; padding: 12px; font-size: 13px; color: #9a9a9a; border-top: 1px solid #262626; }
.side .foot b { color: var(--white); font-weight: 600; display: block; }
.side .foot button { background: none; border: 0; color: #cfcfcf; padding: 0; margin-top: 6px; font: inherit; cursor: pointer; text-decoration: underline; }
.main { padding: 30px 36px 60px; min-width: 0; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.head .sub { color: var(--muted); margin-top: 4px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Botões e campos */
.btn { font: inherit; font-weight: 600; border-radius: 999px; padding: 9px 18px; border: 1.5px solid var(--black); background: var(--black); color: var(--white); cursor: pointer; white-space: nowrap; text-decoration: none; display: inline-block; }
.btn:hover { background: #2a2a2a; }
.btn.ghost { background: var(--white); color: var(--black); }
.btn.ghost:hover { background: var(--soft); }
.btn.danger { background: var(--white); color: var(--red); border-color: var(--red); }
.btn.danger:hover { background: var(--red-soft); }
.btn.sm { padding: 5px 12px; font-size: 13px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
label.field { display: block; font-size: 13px; font-weight: 600; margin-bottom: 12px; }
label.field span.hint { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=month], input[type=number], select, textarea {
  font: inherit; width: 100%; padding: 9px 11px; border: 1.5px solid #cfcfcf; border-radius: 8px; background: var(--white); color: var(--ink); margin-top: 4px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--black); }
textarea { min-height: 110px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 14px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 14px; margin: 6px 0 14px; }
.checks label, label.check { font-weight: 500; font-size: 14px; display: flex; gap: 8px; align-items: center; }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: #000; margin: 0; }

/* Filtros */
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; background: var(--soft); border-radius: 12px; padding: 14px 16px; margin-bottom: 22px; }
.filters label.field { margin: 0; min-width: 150px; }
.seg { display: inline-flex; border: 1.5px solid var(--black); border-radius: 999px; overflow: hidden; }
.seg button { font: inherit; font-weight: 600; font-size: 13px; background: var(--white); border: 0; padding: 7px 14px; cursor: pointer; }
.seg button.on { background: var(--black); color: var(--white); }

/* Cartões e tabelas */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 26px; }
.kpi { background: var(--soft); border-radius: 12px; padding: 16px 18px; }
.kpi .v { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: 13px; }
.kpi.dark { background: var(--black); color: var(--white); }
.kpi.dark .l { color: #bbb; }
.card { border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; margin-bottom: 20px; }
.tablewrap { border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; margin-bottom: 24px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; padding: 11px 14px; border-bottom: 1px solid var(--line); background: #fafafa; white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid #f0f0f0; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr.sub td { background: #fafafa; color: #444; font-size: 13px; padding-top: 7px; padding-bottom: 7px; }
tr.sub td:first-child { padding-left: 30px; }
tr.total td { font-weight: 700; border-top: 1.5px solid var(--black); background: var(--white); }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--soft); }
.empty { padding: 34px; text-align: center; color: var(--muted); }
.tag { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; background: var(--soft); color: #444; white-space: nowrap; }
.tag.ok { background: var(--green-soft); color: var(--green); }
.tag.warn { background: var(--amber-soft); color: var(--amber); }
.tag.bad { background: var(--red-soft); color: var(--red); }
.tag.dark { background: var(--black); color: var(--white); }

/* Fatura por validar */
.review { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(380px, 1fr); gap: 24px; align-items: start; }
.doc { position: sticky; top: 20px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--soft); height: calc(100vh - 150px); min-height: 480px; }
.doc iframe { width: 100%; height: 100%; border: 0; display: block; }
.doc .imgwrap { height: 100%; overflow: auto; }
.doc img { width: 100%; display: block; }
.doc .nodoc { display: grid; place-items: center; height: 100%; color: var(--muted); }
.note { border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; font-size: 14px; }
.note.bad { background: var(--red-soft); color: #8f1414; }
.note.warn { background: var(--amber-soft); color: #6b4706; }
.note.info { background: var(--soft); color: #333; }
.calc { background: var(--black); color: var(--white); border-radius: 12px; padding: 16px 18px; margin: 4px 0 16px; }
.calc .row { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; color: #cfcfcf; }
.calc .row.big { color: var(--white); font-size: 20px; font-weight: 700; border-top: 1px solid #333; margin-top: 8px; padding-top: 10px; }
pre.mail { white-space: pre-wrap; word-break: break-word; font: inherit; font-size: 13px; background: var(--soft); border-radius: 10px; padding: 12px 14px; margin: 0; max-height: 200px; overflow: auto; }
.replies { display: grid; gap: 6px; margin-bottom: 12px; }
.replies label { display: flex; gap: 10px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 10px; padding: 9px 12px; cursor: pointer; font-size: 14px; }
.replies label:has(input:checked) { border-color: var(--black); background: var(--soft); }
.replies input { margin-top: 3px; }

/* Diálogos, avisos, login */
dialog { border: 0; border-radius: 16px; padding: 0; width: min(620px, calc(100vw - 32px)); max-height: calc(100vh - 40px); box-shadow: 0 20px 60px rgba(0,0,0,.3); color: var(--ink); }
dialog::backdrop { background: rgba(0,0,0,.45); }
dialog form { padding: 24px 26px; }
dialog h2 { font-size: 20px; margin-bottom: 16px; }
dialog .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.err { color: var(--red); font-size: 14px; min-height: 20px; margin-top: 6px; }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--black); color: var(--white); padding: 11px 20px; border-radius: 999px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; }
#toast.bad { background: var(--red); }
.login { min-height: 100vh; display: grid; place-items: center; background: var(--black); padding: 20px; }
.login form { background: var(--white); border-radius: 18px; padding: 34px 32px; width: min(400px, 100%); }
.login img { height: 38px; margin-bottom: 18px; }
.login h1 { margin-bottom: 4px; }
.login .btn { width: 100%; margin-top: 6px; padding: 12px; }
.weekhead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 26px 0 10px; flex-wrap: wrap; }
.weekhead h2 { margin: 0; }

@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; padding: 12px; align-items: center; }
  .side .brand { padding: 0 8px 0 4px; }
  .side .brand span { display: none; }
  .side a.nav { padding: 7px 11px; gap: 6px; font-size: 14px; }
  .side .foot { margin: 0 0 0 auto; border: 0; padding: 0 6px; }
  .side .foot b { display: none; }
  .main { padding: 20px 16px 50px; }
  .review { grid-template-columns: 1fr; }
  .doc { position: static; height: 70vh; }
  .grid3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
