/* ===========================================================================
   RayVault — Design System
   Paleta extraída de farmrayvault.com: dark + ciano elétrico (#00F0FF)
   =========================================================================== */
:root {
  /* superfícies */
  --bg:            #060708;
  --bg-2:          #0b0d10;
  --surface:       rgba(255, 255, 255, 0.022);
  --surface-2:     rgba(255, 255, 255, 0.04);
  --border:        rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  /* texto */
  --text:      #ededed;
  --text-dim:  #8a8a8a;
  --text-mute: #5a5f66;

  /* marca */
  --accent:      #00F0FF;   /* ciano elétrico — assinatura */
  --accent-2:    #011eff;   /* azul elétrico */
  --accent-deep: #1b3e8f;
  --accent-glow: rgba(0, 240, 255, 0.18);

  /* status */
  --ok:    #34D399;
  --warn:  #FFD700;
  --err:   #EF4444;
  --info:  #00F0FF;
  --idle:  #94A3B8;

  --radius:    16px;
  --radius-sm: 10px;
  --shadow:    0 18px 50px -20px rgba(0, 0, 0, 0.8);
  --ring:      0 0 0 1px var(--border), 0 0 0 4px rgba(0, 240, 255, 0.08);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
  overflow-x: hidden;
}

/* brilho ambiente de fundo */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 600px at 78% -8%, rgba(0, 240, 255, 0.10), transparent 60%),
    radial-gradient(800px 600px at 12% 110%, rgba(1, 30, 255, 0.08), transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--accent-glow); color: #fff; }

/* ---------- marca ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .14em; }
.brand .dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px 2px var(--accent-glow), 0 0 0 4px rgba(0, 240, 255, 0.08);
}
.brand .name { font-size: 15px; }
.brand .name b { color: #fff; }
.brand .name span { color: var(--accent); }

/* =========================================================================
   LOGIN
   ========================================================================= */
.auth-wrap {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.015));
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 40px 34px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  animation: rise .5s cubic-bezier(.2,.7,.2,1) both;
}
.auth-card .brand { margin-bottom: 26px; }
.auth-card h1 { font-size: 22px; font-weight: 650; margin-bottom: 6px; letter-spacing: -.01em; }
.auth-card p.sub { color: var(--text-dim); font-size: 13.5px; margin-bottom: 26px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 7px; letter-spacing: .02em; }
.input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14px;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.input::placeholder { color: var(--text-mute); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-glow); background: #07090b; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px; font-weight: 600;
  transition: transform .12s, box-shadow .2s, background .2s, border-color .2s, color .2s;
  user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  width: 100%;
  background: var(--accent);
  color: #00171a;
  box-shadow: 0 8px 30px -8px var(--accent-glow);
}
.btn-primary:hover { box-shadow: 0 10px 40px -6px rgba(0,240,255,.35); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--border-strong); background: var(--surface-2); }
.btn-danger { color: #ffb4b4; }
.btn-danger:hover { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.4); color: #ffd5d5; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.sm { padding: 8px 12px; font-size: 12.5px; border-radius: 9px; }

.auth-err {
  display: none;
  margin-top: 14px; padding: 10px 12px;
  background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.35);
  border-radius: 10px; color: #ffc9c9; font-size: 13px;
}
.auth-foot { margin-top: 22px; font-size: 12px; color: var(--text-mute); text-align: center; }

/* =========================================================================
   APP / DASHBOARD
   ========================================================================= */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 26px;
  border-bottom: 1px solid var(--border);
  background: rgba(6,7,8,.72);
  backdrop-filter: blur(14px);
}
.topbar .who { display: flex; align-items: center; gap: 12px; color: var(--text-dim); font-size: 13px; }
.avatar {
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: linear-gradient(135deg, var(--accent-deep), var(--accent-2));
  color: #cde9ff; border: 1px solid var(--border);
}

.container { max-width: 1180px; margin: 0 auto; padding: 30px 26px 80px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 650; letter-spacing: -.02em; }
.page-head .muted { color: var(--text-dim); font-size: 13.5px; margin-top: 4px; }

/* métricas */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 26px; }
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
}
.stat .k { font-size: 12px; color: var(--text-dim); display: flex; align-items: center; gap: 7px; }
.stat .v { font-size: 28px; font-weight: 680; margin-top: 6px; letter-spacing: -.02em; }
.stat .pip { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
/* card de gastos do mês — clicável, abre o relatório mês a mês (verde, destacado) */
.stat.spend { border-color: rgba(52,211,153,.42); cursor: pointer;
  background: linear-gradient(135deg, rgba(52,211,153,.15), rgba(52,211,153,.04));
  transition: border-color .15s, transform .15s; }
.stat.spend:hover { border-color: rgba(52,211,153,.7); transform: translateY(-1px); }
.stat.spend:focus-visible { outline: 2px solid var(--ok); outline-offset: 2px; }
.stat.spend .v { color: var(--ok); font-weight: 800; }
.stat .sub { font-size: 11px; color: var(--ok); opacity: .85; margin-top: 5px; }
/* "olhinho" que oculta os valores em $ (fica no canto do card Gastos) */
.eye-cost { margin-left: auto; display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; padding: 0; border: 0; border-radius: 6px; cursor: pointer;
  background: transparent; color: var(--text-dim); opacity: .6;
  transition: opacity .15s, color .15s, background .15s; }
.eye-cost:hover { opacity: 1; color: var(--ok); background: rgba(52,211,153,.14); }
.eye-cost:focus-visible { outline: 2px solid var(--ok); outline-offset: 2px; opacity: 1; }

/* filtros */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-dim); border-radius: 999px; padding: 7px 14px; font-size: 12.5px;
  transition: .16s;
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.active { color: #00171a; background: var(--accent); border-color: var(--accent); font-weight: 600; }
.search {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 999px;
  padding: 8px 14px; min-width: 220px;
}
.search input { background: none; border: none; color: var(--text); font-size: 13px; width: 100%; }
.search input:focus { outline: none; }
.search svg { color: var(--text-mute); flex: none; }

/* lista de jobs */
.jobs { display: grid; gap: 12px; }
.job {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px 18px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color .18s, background .18s, transform .12s;
}
.job:hover { border-color: var(--border-strong); background: var(--surface-2); transform: translateY(-1px); }
.job .main { min-width: 0; }
.job .title { display: flex; align-items: center; gap: 10px; }
.job .title .nm { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jobcode { font-family: monospace; font-size: 11px; color: var(--text-dim); background: var(--surface-2); border: 1px solid var(--border); padding: 1px 7px; border-radius: 6px; letter-spacing: .03em; flex: none; }
.job .meta { color: var(--text-dim); font-size: 12.5px; margin-top: 6px; display: flex; gap: 14px; flex-wrap: wrap; }
.job .meta b { color: var(--text); font-weight: 500; }
.job .right { display: flex; align-items: center; gap: 16px; }

/* progress */
.prog { width: 140px; }
.prog .bar { height: 6px; border-radius: 999px; background: rgba(255,255,255,.07); overflow: hidden; }
.prog .bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); box-shadow: 0 0 12px var(--accent-glow); transition: width .5s; }
.prog .pct { font-size: 11.5px; color: var(--text-dim); margin-top: 5px; text-align: right; }

/* status pill */
.pill { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 999px; border: 1px solid transparent; white-space: nowrap; }
.pill .led { width: 7px; height: 7px; border-radius: 50%; }
.pill.rendering { color: var(--accent); background: rgba(0,240,255,.08); border-color: rgba(0,240,255,.25); }
.pill.rendering .led { background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: pulse 1.4s infinite; }
.pill.queued    { color: var(--idle); background: rgba(148,163,184,.08); border-color: rgba(148,163,184,.22); }
.pill.queued .led { background: var(--idle); }
.pill.completed { color: var(--ok); background: rgba(52,211,153,.08); border-color: rgba(52,211,153,.25); }
.pill.completed .led { background: var(--ok); }
.pill.failed    { color: #ff8a8a; background: rgba(239,68,68,.09); border-color: rgba(239,68,68,.3); }
.pill.failed .led { background: var(--err); }
.pill.suspended { color: var(--warn); background: rgba(255,215,0,.08); border-color: rgba(255,215,0,.28); }
.pill.suspended .led { background: var(--warn); }

/* estado vazio */
.empty { text-align: center; padding: 70px 20px; color: var(--text-dim); }
.empty .ico { font-size: 34px; opacity: .5; margin-bottom: 12px; }

/* skeleton */
.skel { background: linear-gradient(90deg, rgba(255,255,255,.03), rgba(255,255,255,.07), rgba(255,255,255,.03)); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }

/* =========================================================================
   WORKSPACE (lista à esquerda + detalhe fixo à direita)
   ========================================================================= */
.workspace { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: 18px; align-items: start; }

/* na coluna estreita, os cards empilham o conteúdo */
.workspace .jobs { display: grid; gap: 10px; }
.workspace .job { grid-template-columns: 1fr; gap: 10px; padding: 14px 16px; }
.workspace .job .meta { gap: 12px; }
.workspace .job .right { justify-content: space-between; gap: 12px; }
.workspace .job .prog { width: auto; flex: 1; }
.job.active { border-color: var(--accent); background: rgba(0,240,255,.05); box-shadow: var(--ring); }

/* painel de detalhe — fixo (sticky), sem fade sobre a lista */
.detail {
  position: sticky; top: 88px;
  height: calc(100dvh - 88px - 26px);
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.005));
  border: 1px solid var(--border); border-radius: var(--radius);
  display: flex; flex-direction: column; overflow: hidden;
}
.detail-empty { margin: auto; text-align: center; color: var(--text-mute); padding: 40px; }
.detail-empty .ico { font-size: 40px; opacity: .35; margin-bottom: 14px; }

.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 24px 18px; border-bottom: 1px solid var(--border); }
.detail-head .dh-info { min-width: 0; }
.detail-head h2 { font-size: 19px; font-weight: 650; line-height: 1.3; word-break: break-word; margin: 10px 0 0; letter-spacing: -.01em; }
.detail-head .dh-sub { display: flex; align-items: center; gap: 10px; margin-top: 9px; color: var(--text-mute); font-size: 12px; flex-wrap: wrap; }
.detail-close { background: var(--surface); border: 1px solid var(--border); color: var(--text-dim); width: 34px; height: 34px; border-radius: 10px; flex: none; display: none; }
.detail-close:hover { color: #fff; border-color: var(--border-strong); }

.detail-scroll { padding: 20px 24px; overflow-y: auto; flex: 1; }
.detail-scroll::-webkit-scrollbar { width: 9px; }
.detail-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
.detail-prog { width: 100%; margin-bottom: 14px; }

/* tempo restante (ETA) — destaque evidente sob a barra de progresso */
.eta { display: flex; align-items: center; gap: 12px; margin: 0 0 22px; padding: 12px 16px; border-radius: 12px;
  background: linear-gradient(90deg, rgba(0,240,255,.10), rgba(1,30,255,.05)); border: 1px solid rgba(0,240,255,.22); }
.eta-ic { font-size: 22px; line-height: 1; filter: drop-shadow(0 0 6px var(--accent-glow)); }
.eta-k { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--text-dim); display: flex; align-items: center; }
.eta-v { font-size: 19px; font-weight: 700; color: var(--text); line-height: 1.2; margin-top: 2px; }
.eta-est { font-size: 9.5px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--accent);
  border: 1px solid rgba(0,240,255,.4); border-radius: 999px; padding: 1px 6px; margin-left: 7px; }

/* custo estimado — tile verde ocupando 2 colunas (cliente sabe quanto gasta) */
.tile.cost { grid-column: span 2; border-color: rgba(52,211,153,.42);
  background: linear-gradient(90deg, rgba(52,211,153,.15), rgba(52,211,153,.04)); }
.tile.cost .tk { color: var(--ok); opacity: .9; }
.tile.cost .tv { color: var(--ok); font-size: 22px; font-weight: 800; }

.detail-actions { padding: 14px 20px; border-top: 1px solid var(--border); display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; background: rgba(0,0,0,.25); }
.detail-actions .btn { padding: 11px 8px; font-size: 13px; }

/* tiles de destaque */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 24px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.tile .tk { font-size: 11px; color: var(--text-mute); text-transform: uppercase; letter-spacing: .05em; }
.tile .tv { font-size: 18px; font-weight: 650; margin-top: 5px; letter-spacing: -.01em; }

.kv { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 9px 16px; margin: 2px 0 24px; }
.kv dt { color: var(--text-dim); font-size: 13px; }
.kv dd { font-size: 13.5px; word-break: break-word; }
.mono { font-family: monospace; font-size: 12px; color: var(--text-dim); }
.muted-inline { color: var(--text-mute); font-size: 12px; }

.sect-title { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-mute); margin: 0 0 12px; }
.taglist { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 24px; }
.tag { font-size: 12px; padding: 5px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim); }
.tag.cyan { color: var(--accent); border-color: rgba(0,240,255,.25); background: rgba(0,240,255,.06); }

.note { border-radius: 10px; padding: 11px 13px; font-size: 12.5px; margin-bottom: 10px; }
.note.warn { background: rgba(255,215,0,.06); border: 1px solid rgba(255,215,0,.25); color: #f3dd9a; }
.note.err  { background: rgba(239,68,68,.07); border: 1px solid rgba(239,68,68,.28); color: #ffb4b4; }

/* alerta em destaque (erros/avisos) — vai pro TOPO do detalhe e chama atenção */
.detail-alert { display: flex; gap: 11px; align-items: flex-start; border-radius: 12px;
  padding: 13px 15px; margin: 0 0 16px; background: rgba(255,215,0,.11);
  border: 1px solid rgba(255,215,0,.45); border-left: 4px solid var(--warn);
  box-shadow: 0 0 0 1px rgba(255,215,0,.05), 0 8px 22px rgba(255,215,0,.06); }
.detail-alert.err { background: rgba(239,68,68,.11); border-color: rgba(239,68,68,.45); border-left-color: #ef4444;
  box-shadow: 0 0 0 1px rgba(239,68,68,.05), 0 8px 22px rgba(239,68,68,.06); }
.detail-alert .da-icon { font-size: 18px; line-height: 1.25; flex: none; }
.detail-alert .da-body { flex: 1; min-width: 0; }
.detail-alert .da-title { font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: #ffe58a; margin: 0 0 6px; }
.detail-alert.err .da-title { color: #ffc2c2; }
.detail-alert .da-line { font-size: 12.5px; color: #f3dd9a; line-height: 1.5; word-break: break-word; }
.detail-alert.err .da-line { color: #ffb4b4; }
.detail-alert .da-line + .da-line { margin-top: 5px; }

.linkout { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); font-size: 13.5px; font-weight: 500; margin-bottom: 8px; }
.linkout:hover { text-decoration: underline; }

/* ajustes do render (prioridade + resolução + câmera) */
.edit-fields { display: grid; gap: 12px; margin-bottom: 4px; }
.edit-fields .ef { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--text-dim); }
.edit-fields .ef-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.edit-fields .input { padding: 9px 11px; font-size: 14px; }
.edit-fields select.input { cursor: pointer; }

/* linha de status do render (Frame - Pass - elapsed/left - %) */
.task-status { margin-top: 9px; font-family: monospace; font-size: 12px; color: var(--accent); background: rgba(0,240,255,.05); border: 1px solid rgba(0,240,255,.18); border-radius: 8px; padding: 7px 10px; line-height: 1.5; word-break: break-word; }

/* lightbox da captura do frame buffer */
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.82); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 24px; animation: rise .2s both; }
.lb-inner { max-width: 96vw; max-height: 92vh; display: flex; flex-direction: column; gap: 10px; }
.lb-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--text); font-size: 13.5px; }
.lb-head .x { background: var(--surface); border: 1px solid var(--border-strong); color: var(--text-dim); width: 32px; height: 32px; border-radius: 9px; flex: none; }
.lb-head .x:hover { color: #fff; }
.lb-inner img { max-width: 96vw; max-height: 84vh; object-fit: contain; border: 1px solid var(--border-strong); border-radius: 10px; background: #000; }

/* relatório de gastos mês a mês (modal, reusa .lightbox) */
.lb-inner.report { width: min(520px, 94vw); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 14px; overflow: hidden; }
.lb-inner.report .lb-head { padding: 14px 18px; border-bottom: 1px solid var(--border); font-weight: 600; }
.lb-inner.report .muted-inline { color: var(--text-dim); font-size: 12px; font-weight: 400; }
.report-body { max-height: 70vh; overflow: auto; }
.report-tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.report-tbl th, .report-tbl td { padding: 11px 18px; text-align: left; border-bottom: 1px solid var(--border); }
.report-tbl th { color: var(--text-dim); font-size: 12px; font-weight: 600; }
.report-tbl td.num, .report-tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.report-tbl td.cost { color: var(--ok); font-weight: 700; }
.report-tbl tr.cur td { background: rgba(52,211,153,.07); }
.report-tbl .tag { font-size: 10px; color: var(--ok); border: 1px solid rgba(52,211,153,.4); border-radius: 999px; padding: 1px 6px; margin-left: 6px; }
.report-tbl tfoot td { font-weight: 700; border-bottom: none; border-top: 1px solid var(--border-strong); }
.report-tbl td.empty { text-align: center; color: var(--text-dim); padding: 28px; }

/* status de render por tarefa (Render Status) */
.tasklist { display: grid; gap: 10px; margin-bottom: 24px; }
.task { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.task-top { display: flex; align-items: center; gap: 10px; }
.task-frame { font-size: 12px; color: var(--text-dim); font-family: monospace; }
.task-info { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 9px; font-size: 12.5px; color: var(--text-dim); align-items: center; }
.task-worker { color: var(--accent); font-weight: 500; }
.task-pct { color: var(--text); font-weight: 600; }
.task-err { color: #ff8a8a; }
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: pulse 1.4s infinite; vertical-align: middle; margin-left: 4px; }

.archive-box { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.archive-box .btn { width: 100%; }
.archive-note { font-size: 11.5px; color: var(--text-mute); margin-top: 8px; text-align: center; }

/* =========================================================================
   GRUPOS / PROJETOS (organização do cliente)
   ========================================================================= */
.head-actions { display: flex; gap: 8px; }

/* seção de um projeto na lista: cabeçalho + cards, arrastável p/ reordenar.
   Ganha um fundo bem de leve na cor do grupo (definido inline por JS). */
.group-section { display: grid; gap: 10px; padding: 8px; border: 1px solid transparent; border-radius: 14px; }
.group-section.dragging { opacity: .5; }
/* alça de arrastar no card de job (soltar dentro de um projeto) */
.job { position: relative; }
.job-grip { position: absolute; left: 2px; top: 50%; transform: translateY(-50%);
  cursor: grab; color: var(--text-mute); font-size: 13px; line-height: 1; padding: 6px 3px;
  opacity: 0; transition: opacity .15s, color .15s; user-select: none; }
.job:hover .job-grip { opacity: .5; }
.job-grip:hover { opacity: 1; color: var(--text); }
.job-grip:active { cursor: grabbing; }
.job.dragging { opacity: .4; }
/* enquanto arrasta um card: seções viram alvos "soltáveis"; a sob o cursor realça */
#jobs.carddrag .group-section { outline: 1px dashed var(--border-strong); outline-offset: -3px; }
#jobs.carddrag .group-section.drop-target { outline: 2px dashed var(--accent); outline-offset: -3px;
  background: rgba(0, 240, 255, 0.06); }
/* cabeçalho recolhível */
.group-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer; user-select: none;
  transition: border-color .15s, background .15s;
}
.group-head:hover { border-color: var(--border-strong); background: var(--surface-2); }
/* alça de arrastar no cabeçalho (o "quadradinho de mexer") */
.group-head .gh-grip { flex: none; cursor: grab; color: var(--text-mute); font-size: 15px; line-height: 1;
  padding: 0 2px; border-radius: 5px; transition: color .15s; }
.group-head .gh-grip:hover { color: var(--text); }
.group-head .gh-grip:active { cursor: grabbing; }
.group-head .gh-chev { color: var(--text-dim); flex: none; transition: transform .18s; }
.group-section.collapsed .gh-chev { transform: rotate(-90deg); }
.group-head .gh-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: 0 0 0 3px rgba(255,255,255,.03); }
.group-head .gh-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.group-head .gh-count { margin-left: auto; font-size: 11.5px; color: var(--text-dim); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px; flex: none; }

/* seletor de projeto no TOPO do painel de detalhe (parte das infos do job) */
.job-group { display: flex; align-items: center; gap: 10px; margin-bottom: 18px;
  padding: 9px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.job-group .jg-label { font-size: 12.5px; color: var(--text-dim); white-space: nowrap; flex: none; }
.job-group select.input { flex: 1; padding: 8px 10px; cursor: pointer; }

/* novidades / what's new (modal reusa .lightbox) */
.wn-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); display: inline-block; margin-left: 5px; vertical-align: middle; }
.lb-inner.whatsnew { width: min(560px, 94vw); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 14px; overflow: hidden; }
.whatsnew .lb-head { padding: 14px 18px; border-bottom: 1px solid var(--border); font-weight: 600; }
.wn-body { padding: 4px 18px; max-height: 62vh; overflow: auto; }
.wn-item { padding: 16px 0; border-bottom: 1px solid var(--border); }
.wn-item:last-child { border-bottom: none; }
.wn-date { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); margin-bottom: 6px; }
.wn-title { font-size: 15px; font-weight: 650; margin-bottom: 10px; letter-spacing: -.01em; }
.wn-note { font-size: 12px; color: var(--text-dim); line-height: 1.5; margin-bottom: 11px; padding: 8px 11px; background: var(--surface-2); border-radius: 8px; }
.wn-list { list-style: none; display: grid; gap: 8px; }
.wn-list li { position: relative; padding-left: 20px; font-size: 13.5px; color: var(--text-dim); line-height: 1.5; }
.wn-list li::before { content: "→"; position: absolute; left: 0; color: var(--accent); }
.wn-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--border); background: rgba(0,0,0,.2); flex-wrap: wrap; }
.wn-optout { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-dim); cursor: pointer; user-select: none; }
.wn-optout input { accent-color: var(--accent); cursor: pointer; }

/* modal de gerenciar grupos (reusa .lightbox) */
.lb-inner.groups-modal { width: min(520px, 94vw); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 14px; overflow: hidden; }
.groups-modal .lb-head { padding: 14px 18px; border-bottom: 1px solid var(--border); font-weight: 600; }
.gm-body { padding: 16px 18px; max-height: 72vh; overflow: auto; }
.gm-new { display: grid; gap: 10px; margin-bottom: 18px; }
.gm-colors { display: flex; flex-wrap: wrap; gap: 7px; }
.gm-sw { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; transition: transform .1s; }
.gm-sw:hover { transform: scale(1.12); }
.gm-sw.on { border-color: #fff; box-shadow: 0 0 0 2px var(--bg-2); }
.gm-list { display: grid; gap: 8px; }
.gm-empty { color: var(--text-dim); font-size: 13px; text-align: center; padding: 16px; }
.gm-row { display: flex; align-items: center; gap: 10px; }
.gm-hint { margin-top: 12px; font-size: 11.5px; color: var(--text-mute); text-align: center; line-height: 1.5; }
.gm-dot { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--border-strong); flex: none; cursor: pointer; padding: 0; }
.gm-name { flex: 1; padding: 8px 10px; font-size: 13.5px; }
.gm-count { font-size: 11.5px; color: var(--text-mute); flex: none; white-space: nowrap; }
.gm-del { background: transparent; border: 1px solid var(--border); border-radius: 8px; width: 32px; height: 32px; flex: none; font-size: 13px; opacity: .8; }
.gm-del:hover { border-color: rgba(239,68,68,.5); background: rgba(239,68,68,.1); opacity: 1; }

/* toast */
.toast-wrap { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #0e1114; border: 1px solid var(--border-strong); border-radius: 12px; padding: 12px 16px; font-size: 13px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 10px; animation: rise .25s both; }
.toast .led { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.toast.ok .led { background: var(--ok); }
.toast.err .led { background: var(--err); }

/* animações */
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* acessibilidade/fluidez: respeita quem pediu menos movimento
   (zera os leds 'pulse' infinitos, o shimmer dos skeletons e as transições) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* responsivo */
@media (max-width: 980px) {
  /* uma coluna: o detalhe vira painel de tela cheia (opaco, sem fade) ao abrir */
  .workspace { grid-template-columns: 1fr; }
  .detail {
    position: fixed; inset: 0; top: 0; height: 100dvh;
    border: none; border-radius: 0; z-index: 60;
    background: var(--bg-2);
    transform: translateX(100%); transition: transform .28s cubic-bezier(.2,.7,.2,1);
  }
  .detail.open { transform: none; }
  .detail-close { display: inline-flex; }
}
@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat.spend { grid-column: span 2; }
  .toolbar { gap: 8px; }
  .search { margin-left: 0; width: 100%; }
  .detail-actions { grid-template-columns: repeat(2, 1fr); }
}
