/* 23/10/2026 - Claude: painel de licenças do Mastix. Claro/escuro conforme o sistema; funciona no celular. */
:root {
  --bg: #f4f6fa; --panel: #ffffff; --panel-2: #eef1f6; --line: #dde2ea;
  --text: #182033; --muted: #66718a; --accent: #2f8cff; --accent-2: #1f6fd6;
  --gold: #a87c00;   /* 24/10/2026 - Claude: cor dos MACs (amarelo dourado) */
  --ok: #1a9b5b; --warn: #c27a00; --danger: #d93a3a; --info: #6b5bd6;
  --shadow: 0 1px 3px rgba(20, 30, 50, .08);
  color-scheme: light dark;   /* 24/10/2026 - Claude: barras de rolagem e campos seguem o tema claro/escuro */
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f17; --panel: #141a26; --panel-2: #1b2232; --line: #263047;
    --text: #e8ecf3; --muted: #93a0b8; --accent: #3b93ff; --accent-2: #5aa6ff;
    --gold: #e6b62e;
    --ok: #34c27c; --warn: #f0a92e; --danger: #f06262; --info: #9a8cf5;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
/* 24/10/2026 - Claude: fonte Inter Tight em todo o painel; Google Sans Code nos MACs (fonts.css, hospedadas aqui) */
body { font: 15px/1.45 "Inter Tight", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--danger); min-height: 1.4em; margin: 8px 0 0; }

/* 25/10/2026 - Claude: logotipo em imagem (vertical no login, horizontal no topo) */
.brand { margin: 0; line-height: 0; display: flex; justify-content: center; }
.brand img { display: block; height: 84px; width: auto; }

/* Botões e campos */
.btn { font: inherit; font-size: 14px; font-weight: 400; padding: 9px 16px;   /* 24/10/2026 - Claude: 1 ponto menor e sem negrito (era 15px/600) */
   border-radius: 9px; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.danger { color: var(--danger); }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
/* 31/10/2026 - Claude: botão aguardando o servidor (ex.: envio do código de login por e-mail), com um círculo girando */
.btn.busy:disabled { opacity: .85; cursor: progress; }
.btn.busy::before { content: ''; display: inline-block; width: 13px; height: 13px; margin-right: 8px; vertical-align: -2px;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: btn-spin .7s linear infinite; }
@keyframes btn-spin { to { transform: rotate(360deg); } }
input, textarea, select { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; width: 100%; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
label { display: block; font-weight: 600; font-size: 14px; color: var(--muted); }
/* 24/10/2026 - Claude: mesmo espaço (6px) entre qualquer título e o seu campo */
label input, label textarea { margin-top: 4px; font-weight: 400; }

/* Login */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-box { width: 100%; max-width: 360px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 32px 28px; box-shadow: var(--shadow); display: grid; gap: 14px; text-align: center; }
.login-box label { text-align: left; }
.login-box .muted { margin: -8px 0 6px; }
/* 25/10/2026 - Claude: versão centralizada na altura do espaço abaixo do "Entrar" (desloca sem mudar o tamanho
   da caixa; enquanto aparece uma mensagem de erro nesse espaço, a versão fica escondida) */
.login-version { margin-top: -4px; position: relative; top: 33px; color: var(--muted); font-size: 12px; }
.login-box:has(.error:not(:empty)) .login-version { visibility: hidden; }

/* 25/10/2026 - Claude: menu lateral (aberto: logo + nomes; recolhido: símbolo + ícones) e topo com o usuário */
.app { display: flex; min-height: 100vh; }
.side { flex: none; width: 220px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px;
  padding: 16px 12px; background: var(--panel); border-right: 1px solid var(--line); transition: width .15s; z-index: 6; }
.side-logo { display: flex; align-items: center; height: 40px; padding: 0 8px; }
.side-logo img { display: block; height: 28px; width: auto; }
.side-logo .logo-full img { height: 34px; }   /* 07/11/2026 - Claude: logo da Mastix (mais largo e com o "PLAYER" embaixo) */
.side-logo .logo-mark { display: none; }
.side-logo .logo-mark img { height: 30px; }
.side-nav { display: grid; gap: 4px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 9px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.side-nav a:hover { color: var(--text); background: var(--panel-2); }
.side-nav a.active { color: var(--text); background: var(--panel-2); }
.side-nav svg { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.app.collapsed .side { width: 68px; }
.app.collapsed .side-logo { justify-content: center; padding: 0; }
.app.collapsed .side-logo .logo-full, .app.collapsed .side-nav span { display: none; }
.app.collapsed .side-logo .logo-mark { display: block; }
.app.collapsed .side-nav a { justify-content: center; padding: 10px 0; }
.content { flex: 1; min-width: 0; }
.top { display: flex; align-items: center; gap: 18px; padding: 10px 20px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top-user { flex: 1; text-align: right; color: var(--muted); font-size: 14px; }
/* 25/10/2026 - Claude: título da página (menu selecionado) no centro do topo, no azul do tema */
.top-title { position: absolute; left: 50%; transform: translateX(-50%); margin: 0; font-size: 18px; font-weight: 700; color: var(--accent); white-space: nowrap; pointer-events: none; }
main { max-width: 1100px; margin: 0 auto; padding: 20px; }

/* Resumo */
.stats { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin-bottom: 18px; }   /* 28/10/2026 - Claude: + Com Futebol */
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; text-align: left; font: inherit; color: var(--text); box-shadow: var(--shadow); }
.stat b { display: block; font-size: 26px; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 13px; }
.stat.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

/* Busca e lista */
.toolbar { display: flex; gap: 10px; margin-bottom: 12px; }
.toolbar input { flex: 1; }
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 13px; color: var(--muted); background: var(--panel-2); }   /* 24/10/2026 - Claude: só a 1ª letra maiúscula (era tudo maiúsculo) */
/* 24/10/2026 - Claude: coluna Ação (bloquear/excluir) */
.col-act { width: 1%; white-space: nowrap; }
.row-actions { display: inline-flex; gap: 4px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { border-color: var(--line); color: var(--text); background: var(--panel); }
.icon-btn.danger:hover { color: var(--danger); }
.icon-btn.warn:hover { color: var(--warn); }   /* 24/10/2026 - Claude: bloquear fica amarelo ao passar o mouse */
/* 24/10/2026 - Claude: colunas Situação, Vencimento e Ação centralizadas */
th.center, td.center { text-align: center; }
/* 24/10/2026 - Claude: campo de data vazio não mostra o "dd/mm/aaaa" (fora do foco) */
input[type="date"].empty:not(:focus)::-webkit-datetime-edit { color: transparent; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--panel-2); }
tbody tr:last-child td { border-bottom: 0; }
.mac { font-family: "Google Sans Code", ui-monospace, "Cascadia Mono", Consolas, monospace; font-weight: 600; color: var(--gold); }
.note-cell { color: var(--muted); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { padding: 30px; text-align: center; color: var(--muted); }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; color: var(--muted); }

.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge.trial { color: var(--info); background: color-mix(in srgb, var(--info) 14%, transparent); }
.badge.active { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.badge.expired { color: var(--muted); background: var(--panel-2); }
.badge.blocked { color: var(--danger); background: color-mix(in srgb, var(--danger) 14%, transparent); }
.badge.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 16%, transparent); }
/* 28/10/2026 - Claude: módulo Futebol (selo da lista e linha da licença) */
.badge.football { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); padding: 2px 5px; vertical-align: middle; }
/* 31/10/2026 - Claude: coluna Situação da lista: 3 colunas fixas (Futebol, situação, vencendo); os selos ocupam a largura da coluna */
.state-cell { display: inline-grid; grid-template-columns: 24px 80px 92px; gap: 6px; align-items: center; vertical-align: middle; }
.state-cell .badge { text-align: center; }
.state-cell .badge.football { justify-self: center; }
/* 01/11/2026 - Claude: bola desligada (cinza) e bola clicável na lista */
.badge.football.off { color: var(--muted); background: var(--panel-2); opacity: .6; }
button.badge.football { border: 0; font: inherit; cursor: pointer; }
button.badge.football:hover { opacity: 1; box-shadow: 0 0 0 1px currentColor; }
.badge.football svg { width: 14px; height: 14px; display: block; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.football-row { display: flex; align-items: center; gap: 12px; }
.football-row > div { flex: 1; }
.football-row .hint { margin: 0; }
.fb-ico svg { width: 28px; height: 28px; display: block; fill: none; stroke: var(--ok); stroke-width: 1.8; stroke-linejoin: round; }

/* Detalhe do aparelho */
.back { display: inline-block; margin-bottom: 12px; font-weight: 600; }
/* 24/10/2026 - Claude: detalhe em grade: dados + observação ao lado de "Liberar licença" (observação cresce até a altura dele);
   Histórico e Acessos na mesma linha, com a mesma altura */
.detail { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); grid-template-rows: auto 1fr auto; gap: 16px;
  grid-template-areas: "info actions" "notes actions" "history claims"; }
.detail > div { display: contents; }
.detail .card + .card { margin-top: 0; }
.c-info { grid-area: info; } .c-actions { grid-area: actions; } .c-notes { grid-area: notes; } .c-history { grid-area: history; } .c-claims { grid-area: claims; }
.c-notes { display: flex; flex-direction: column; }
.c-notes textarea { flex: 1; min-height: 90px; resize: none; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; box-shadow: var(--shadow); }
.card h2 { font-size: 16px; margin: 0 0 4px; }
.actions > h2 { margin-bottom: -8px; }   /* o gap de 12px da grade já separa: 12 - 8 = 4 */
/* 24/10/2026 - Claude: linha entre o título e as linhas do Histórico e dos Acessos */
.c-history h2, .c-claims h2 { padding-bottom: 10px; margin-bottom: 0; border-bottom: 1px solid var(--line); }
/* 24/10/2026 - Claude: "Salvando.../Salvo" na linha do título; a caixa da observação vai até o fim do cartão */
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.save-status { font-size: 13px; color: var(--muted); text-align: right; }
.save-status.error { color: var(--danger); }
.card + .card { margin-top: 16px; }
.dev-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.dev-head .mac { font-size: 22px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.facts dt { color: var(--muted); text-align: right; }   /* 24/10/2026 - Claude: rótulos alinhados à direita */
.facts dd { margin: 0; font-weight: 600; }
.actions { display: grid; gap: 12px; }
.row { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.row > label { flex: 1; min-width: 150px; }
/* 24/10/2026 - Claude: "Liberar" e "Salvar" com a mesma largura: a data do vencimento termina junto com "Outro prazo" */
#renew-custom, #set-exp { flex: none; width: 96px; font-weight: 400; }   /* 24/10/2026 - Claude: sem negrito */
.mt { margin-top: 8px; }
.row.end { justify-content: flex-end; }
.hint { font-size: 13px; color: var(--muted); margin: 4px 0 0; }
.sep { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
/* 24/10/2026 - Claude: cada registro com 2 linhas de altura fixa; a lista mostra 3 e rola o resto */
.history { list-style: none; margin: 0; padding: 0 4px 0 0; height: 174px; overflow-y: auto; }
.history li { height: 58px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.history li > div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history li:last-child { border-bottom: 0; }
.history .when { color: var(--muted); font-size: 12px; }
.alert { padding: 10px 12px; border-radius: 9px; background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--text); font-size: 14px; }

/* Configurações */
.settings { max-width: 640px; margin: 0 auto; display: grid; gap: 14px; }   /* 25/10/2026 - Claude: centralizada na página */

/* 30/10/2026 - Claude: versões do app (envio do APK e lista das publicadas) */
.releases { max-width: 900px; margin: 0 auto; }
.releases .settings { max-width: none; }
.releases code { font-family: "Google Sans Code", ui-monospace, Consolas, monospace; font-size: 12px; padding: 1px 5px; border-radius: 5px; background: var(--panel-2); }
.progress { height: 8px; border-radius: 99px; background: var(--panel-2); overflow: hidden; }
.progress > div { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.table-wrap.flat { box-shadow: none; margin-top: 12px; }
.rel-table tbody tr { cursor: default; }
.rel-table a.icon-btn svg { pointer-events: none; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 10px; font-weight: 600; z-index: 20; max-width: calc(100% - 32px); }
.toast.error { background: var(--danger); color: #fff; }

/* Celular */
@media (max-width: 760px) {
  .top { gap: 8px 12px; padding: 10px 16px; }
  /* 25/10/2026 - Claude: no celular o menu aberto fica por cima do conteúdo; recolhido, ocupa só a faixa dos ícones */
  .app:not(.collapsed) .side { position: fixed; left: 0; box-shadow: 0 0 24px rgba(0, 0, 0, .35); }
  /* 01/11/2026 - Claude: recolhido, o menu some de vez (o botão do topo abre por cima); a faixa dos ícones tomava 68 px da tela */
  .app.collapsed .side { width: 0; padding: 0; border: 0; overflow: hidden; }
  /* 25/10/2026 - Claude: título ocupa o espaço livre do topo (não passa por cima do usuário) */
  .top-title { position: static; transform: none; flex: 1; min-width: 0; text-align: center; font-size: 16px; overflow: hidden; text-overflow: ellipsis; }
  .top-user { flex: none; }
  main { padding: 14px 16px; }
  /* 23/10/2026 - Claude: no celular, "Liberar licença" logo depois dos dados do aparelho */
  .detail { display: flex; flex-direction: column; gap: 16px; }
  .c-info { order: 1; } .c-actions { order: 2; } .c-notes { order: 3; } .c-history { order: 4; } .c-claims { order: 5; }
  .col-platform, .col-seen, .col-note { display: none; }
  th, td { padding: 10px; }
  .dev-head .mac { font-size: 18px; }

  /* 01/11/2026 - Claude: painel instalado no celular. Os totais ficam numa grade compacta de 4 colunas (tudo visível,
     sem rolar) e as outras tabelas rolam dentro do cartão, sem alargar a página */
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 14px; }
  .stat { padding: 7px 4px; text-align: center; box-shadow: none; border-radius: 10px; }
  .stat b { font-size: 19px; }
  .stat span { display: block; font-size: 11px; line-height: 1.2; }
  .table-wrap { overflow-x: auto; }

  /* 01/11/2026 - Claude: lista de aparelhos em cartões: MAC e ações em cima, selos no meio, vencimento e observação embaixo */
  .dev-table thead { display: none; }
  .dev-table, .dev-table tbody { display: block; }
  .dev-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "mac act" "state state" "exp exp" "note note";
    align-items: center; gap: 6px 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .dev-table tbody tr:last-child { border-bottom: 0; }
  .dev-table td { display: block; padding: 0; border: 0; text-align: left; }
  .dev-table td.mac { grid-area: mac; font-size: 15px; }
  .dev-table td.col-act { grid-area: act; width: auto; }
  .dev-table td.col-state { grid-area: state; }
  .dev-table td.col-exp { grid-area: exp; font-size: 13px; color: var(--muted); }
  .dev-table td.col-exp::before { content: 'Vencimento: '; }
  .dev-table td.col-exp:empty { display: none; }
  .dev-table td.col-note { grid-area: note; display: block; max-width: none; font-size: 13px; }
  .dev-table td.col-note:empty, .dev-table td.col-platform, .dev-table td.col-seen { display: none; }
  .dev-table td.empty { grid-column: 1 / -1; padding: 20px 0; text-align: center; }
  .dev-table .state-cell { grid-template-columns: 24px 80px auto; }
}
