/* ==========================================================================
   Portal One4Ret — sistema de design
   Tema escuro unico (padrao One4). Sem dependências externas.
   ========================================================================== */

/* ---- Tokens ---- */
:root {
  color-scheme: dark;   /* controles nativos, scrollbar e autofill em escuro */

  /* Marca One4, amostrada do logo oficial (one4.com.br/.../one4tech.png):
     "ONE" = #10769a, "4" e "tech" = #34b096. */
  --navy:       #041422;
  --one4-blue:  #10769a;
  --one4-green: #34b096;

  --brand-50:  #07302c;
  --brand-100: #0a413b;
  --brand-200: #125d54;
  --brand-500: #2fd0bd;
  --brand-600: #16b8a6;
  --brand-700: #7fe0d4;
  --accent:    #17a55c;

  --bg:        #041422;
  --bg-tint:   #082030;
  --surface:   #0b2434;
  --surface-2: #071c2a;
  --line:      #16394a;
  --line-strong:#234c5e;

  --ink:       #e8edf6;
  --ink-2:     #aeb9cc;
  --muted:     #8b98ae;
  --faint:     #66738c;
  --on-brand:  #ffffff;

  --ok:   #34d399; --ok-bg:   #06371f; --ok-soft:   #0c2418;
  --rev:  #fbbf24; --rev-bg:  #43300a; --rev-soft:  #2a1f08;
  --nok:  #f87171; --nok-bg:  #431618; --nok-soft:  #2a1113;
  --info: #60a5fa; --info-bg: #10233f;
  --wait: #9fb0c9; --wait-bg: #172032;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 6px 16px rgba(0,0,0,.45);
  --shadow-lg: 0 16px 40px rgba(0,0,0,.55);
  --ring: 0 0 0 3px rgba(22,184,166,.45);

  /* Raios mais fechados, como no clinicai (0.35–0.5rem) em vez dos 8–22px antigos. */
  --r-sm: 6px; --r-md: 8px; --r-lg: 10px; --r-xl: 14px; --r-full: 999px;
  --maxw: 1140px;
  /* IBM Plex Sans e a fonte declarada nos outros portais One4. Nao ha webfont
     carregada aqui (o CSS deste portal nao usa dependencia externa), entao quem
     nao a tiver instalada cai no mesmo fallback que o clinicai ja usa hoje. */
  --font: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: "SF Mono", "Cascadia Code", "Consolas", ui-monospace, monospace;
}

/* ---- Base ---- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; font-weight: 700; }
svg.ico { width: 1.15em; height: 1.15em; flex: none; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-sm); }

/* ---- Top bar ---- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px clamp(16px, 4vw, 36px);
  /* Navbar One4: degrade navy -> verde da marca, igual ao clinicai/tax. */
  background: linear-gradient(100deg, var(--navy) 0%, var(--navy) 48%, var(--one4-green) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, .18);
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; font-size: 16px; }
.brand:hover { text-decoration: none; }
/* Logo One4 (PNG branco) no lugar da antiga marca-escudo. */
.brand-mark { display: flex; align-items: center; flex: none; }
.brand-mark img { height: 27px; width: auto; display: block; }
.brand small { display: block; font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .02em; margin-top: -2px; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav-link {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; border-radius: var(--r-sm); color: var(--ink-2);
  font-weight: 600; font-size: 14px;
}
.nav-link:hover { background: var(--bg-tint); color: var(--ink); text-decoration: none; }
.nav-link.active { background: var(--brand-50); color: var(--brand-700); }
.nav-sep { flex: 1; }
.user-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 6px 5px 12px;
  border: 1px solid var(--line); border-radius: var(--r-full); font-size: 13px; color: var(--ink-2);
}
.user-chip .avatar {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-600); color: #fff; font-size: 12px; font-weight: 700;
}
.user-chip .role { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--brand-700); background: var(--brand-50); padding: 2px 6px; border-radius: var(--r-full); }
.icon-btn {
  width: 38px; height: 38px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); display: grid; place-items: center; cursor: pointer;
}
.icon-btn:hover { background: var(--bg-tint); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }
/* Conteudo da navbar: sempre sobre o degrade escuro, nos dois temas. Por isso
   estas regras nao usam os tokens de tinta (--ink/--ink-2), que invertem. */
.topbar .brand, .topbar .brand:hover { color: #fff; }
.topbar .brand small { color: rgba(255, 255, 255, .72); }
.topbar .nav-link { color: rgba(255, 255, 255, .82); }
.topbar .nav-link:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.topbar .nav-link.active { background: rgba(255, 255, 255, .18); color: #fff; }
/* Scrim navy atras dos controles da direita: eles caem sobre a ponta verde do
   gradiente (--one4-green, #34b096), onde texto branco da 2.69:1 -- abaixo do
   minimo AA de 4.5:1. Com o scrim a 45% sobe para ~6.4:1, sem alterar a cor da
   marca no gradiente. */
.topbar .icon-btn {
  background: rgba(4, 20, 34, .45); border-color: rgba(255, 255, 255, .28); color: #fff;
}
.topbar .icon-btn:hover { background: rgba(4, 20, 34, .62); color: #fff; }
.topbar .user-chip {
  color: #fff; background: rgba(4, 20, 34, .45); border-color: rgba(255, 255, 255, .28);
}
.topbar .user-chip .avatar { background: #16b8a6; color: #041422; }
.topbar .user-chip .role { color: #041422; background: rgba(255, 255, 255, .85); }
.topbar :focus-visible { box-shadow: 0 0 0 3px rgba(255, 255, 255, .45); }

/* ---- Layout ---- */
.container { max-width: var(--maxw); margin: 0 auto; padding: 28px clamp(16px, 4vw, 36px) 60px; }
/* align-items:center centraliza a acao da direita contra o bloco de titulo.
   Vale para todas as paginas que tem acao no cabecalho (painel, detalhe do
   cliente, frota, detalhe do job), deixando as quatro consistentes. */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-title { font-size: 24px; }
.page-sub { color: var(--muted); font-size: 14px; margin-top: 3px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.back-link:hover { color: var(--brand-600); text-decoration: none; }

/* ---- Cards ---- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 20px; box-shadow: var(--shadow-sm); margin-bottom: 18px;
}
.card-narrow { max-width: 430px; }
.card-title { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.card-title svg { width: 15px; height: 15px; color: var(--faint); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border: 1px solid transparent; border-radius: var(--r-sm);
  font: inherit; font-size: 14px; font-weight: 650; cursor: pointer; white-space: nowrap;
  background: linear-gradient(180deg, var(--brand-500), var(--brand-600)); color: var(--on-brand);
  box-shadow: 0 1px 2px rgba(15,23,42,.12), inset 0 1px 0 rgba(255,255,255,.15);
  transition: transform .06s ease, filter .15s ease, box-shadow .15s ease;
}
.btn:hover { filter: brightness(1.06); text-decoration: none; box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--bg-tint); filter: none; }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: var(--r-sm);
  color: var(--ink-2); font-size: 13px; font-weight: 600; border: 1px solid var(--line); background: var(--surface);
}
.btn-ghost:hover { border-color: var(--brand-500); color: var(--brand-700); text-decoration: none; }
.btn-ghost svg { width: 16px; height: 16px; }
.btn-block { width: 100%; }

/* ---- Badges (status) — sempre com ícone + rótulo ---- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 8px;
  border-radius: var(--r-full); font-size: 12px; font-weight: 700; line-height: 1.4;
  border: 1px solid transparent;
}
.badge svg { width: 13px; height: 13px; }
.badge-ok  { background: var(--ok-bg);  color: var(--ok);  }
.badge-rev { background: var(--rev-bg); color: var(--rev); }
.badge-nok { background: var(--nok-bg); color: var(--nok); }
.badge-wait{ background: var(--wait-bg);color: var(--wait);}
.badge-run { background: var(--info-bg);color: var(--info);}
.badge-run .live-dot { width: 7px; height: 7px; }

/* ---- Progress ---- */
.progress { height: 8px; background: var(--wait-bg); border-radius: var(--r-full); overflow: hidden; min-width: 90px; }
.progress .bar { height: 100%; border-radius: var(--r-full); background: linear-gradient(90deg, var(--brand-500), var(--accent)); transition: width .5s cubic-bezier(.4,0,.2,1); }
.progress.lg { height: 12px; }
.progress-row { display: flex; align-items: center; gap: 12px; }
.progress-row .progress { flex: 1; }

/* ---- Stat tiles (placar) ---- */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.stat {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 15px 16px; box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease; overflow: hidden;
}
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--faint); }
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--wait-bg); color: var(--wait); }
.stat-ico svg { width: 17px; height: 17px; }
.stat-num { font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1; margin-top: 12px; }
.stat-lbl { font-size: 12px; color: var(--muted); margin-top: 5px; font-weight: 600; }
.stat.is-ok::before  { background: var(--ok); }   .stat.is-ok  .stat-ico { background: var(--ok-soft);  color: var(--ok); }
.stat.is-rev::before { background: var(--rev); }  .stat.is-rev .stat-ico { background: var(--rev-soft); color: var(--rev); }
.stat.is-nok::before { background: var(--nok); }  .stat.is-nok .stat-ico { background: var(--nok-soft); color: var(--nok); }
.stat.is-total::before { background: var(--brand-600); } .stat.is-total .stat-ico { background: var(--brand-50); color: var(--brand-700); }
.stats.four { grid-template-columns: repeat(4, 1fr); margin-bottom: 20px; }
.stat.mini { padding: 13px 15px; }
.stat.mini .stat-num { font-size: 23px; margin-top: 9px; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background .12s ease; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table.compact td, .table.compact th { padding: 8px 10px; font-size: 13px; }
.mono { font-family: var(--mono); font-size: .92em; }

/* ---- Timeline (log amigável) ---- */
.timeline { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow-y: auto; }
.timeline li { position: relative; padding: 0 0 16px 26px; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 16px; bottom: -2px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.tl-dot { position: absolute; left: 0; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--faint); }
.tl-info .tl-dot { border-color: var(--info); }
.tl-ok   .tl-dot { border-color: var(--ok); }
.tl-warn .tl-dot { border-color: var(--rev); }
.tl-erro .tl-dot { border-color: var(--nok); }
.tl-time { font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
.tl-msg { font-size: 13.5px; color: var(--ink); margin-top: 1px; }
.tl-ok   .tl-msg { color: var(--ok); }
.tl-warn .tl-msg { color: var(--rev); }
.tl-erro .tl-msg { color: var(--nok); }

/* ---- Forms ---- */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
input[type=email], input[type=password], input[type=text], input[type=search], select {
  width: 100%; padding: 11px 13px; font: inherit; font-size: 14px; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus { outline: none; border-color: var(--brand-500); box-shadow: var(--ring); background: var(--surface); }
.hint { font-size: 12px; color: var(--muted); }
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  padding: 26px; border: 2px dashed var(--line-strong); border-radius: var(--r-md);
  background: var(--surface-2); color: var(--muted); cursor: pointer; transition: all .15s ease;
}
.dropzone:hover, .dropzone.drag { border-color: var(--brand-500); background: var(--brand-50); color: var(--brand-700); }
.dropzone svg { width: 30px; height: 30px; color: var(--brand-500); }
.dropzone input { display: none; }
.dropzone b { color: var(--ink); font-weight: 700; }
.dropzone .fname { font-weight: 700; color: var(--brand-700); }

/* ---- Alerts ---- */
.alert { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: var(--r-sm); font-size: 14px; }
.alert svg { width: 18px; height: 18px; flex: none; }
.alert-error { background: var(--nok-soft); color: var(--nok); border: 1px solid color-mix(in srgb, var(--nok) 22%, transparent); }

/* ---- Empty state ---- */
.empty { text-align: center; padding: 48px 24px; }
.empty-ico { width: 60px; height: 60px; border-radius: var(--r-lg); background: var(--brand-50); color: var(--brand-600); display: grid; place-items: center; margin: 0 auto 16px; }
.empty-ico svg { width: 30px; height: 30px; }
.empty h3 { font-size: 17px; }
.empty p { color: var(--muted); margin: 6px 0 18px; }

/* ---- Live status bar (job detail) ---- */
.status-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.meta-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-full); padding: 4px 11px; }
.chip svg { width: 13px; height: 13px; color: var(--faint); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 currentColor; animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---- Auth (login) ----------------------------------------------------------
   Portado da tela de login do clinicai para manter as duas identicas. Os
   valores em rem e as cores literais sao os de lá de proposito: divergir dos
   tokens do portal aqui e o que garante que as telas batam pixel a pixel.
   -------------------------------------------------------------------------- */
.login-main {
  min-height: 100vh; overflow: hidden; padding: 0;
  background: radial-gradient(circle at 50% 28%, rgba(22, 184, 166, .16), transparent 20rem),
              radial-gradient(circle at 50% 78%, rgba(204, 51, 102, .08), transparent 24rem),
              var(--navy);
}
.login-screen {
  position: relative; min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2.2rem; padding: 2rem; color: #fff;
}
/* Grade sutil de fundo, atenuada por mascara radial nas bordas. */
.login-screen::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .45;
  background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 2rem 2rem;
  -webkit-mask-image: radial-gradient(circle at center, black 0, transparent 72%);
  mask-image: radial-gradient(circle at center, black 0, transparent 72%);
}
.login-brand, .login-form { position: relative; z-index: 1; }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: .9rem; text-align: center; }
.login-brand__logo { display: block; max-width: 14rem; width: min(14rem, 58vw); }
.login-brand strong { color: #fff; font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 700; line-height: 1; }
.login-form { display: grid; gap: 1.1rem; max-width: 28rem; width: min(28rem, 100%); }
.login-error {
  background: rgba(204, 51, 102, .14); border: 1px solid rgba(255, 98, 139, .45);
  border-radius: .45rem; color: #ffdbe5; font-size: .9rem; padding: .8rem .95rem;
}
.login-field { display: grid; gap: .45rem; }
.login-field span { color: rgba(255, 255, 255, .86); font-size: .95rem; font-weight: 600; }
.login-field input {
  width: 100%; min-height: 3.65rem; padding: 0 1rem; font: inherit; color: #fff; outline: 0;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .28);
  border-radius: .45rem;
  transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}
.login-field input:focus {
  background: rgba(255, 255, 255, .08); border-color: #16b8a6;
  box-shadow: 0 0 0 .18rem rgba(22, 184, 166, .18);
}
.login-submit {
  min-height: 3.65rem; padding: 0 1rem; border: 0; border-radius: .45rem;
  font: inherit; font-weight: 700; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, #20c6bb 0%, #0a9f92 100%);
  transition: transform 120ms ease, filter 120ms ease;
}
.login-submit:hover, .login-submit:focus { filter: brightness(1.05); transform: translateY(-1px); }
.login-submit:disabled { cursor: wait; opacity: .72; transform: none; }

/* ---- Grid & utils ---- */
.grid-2 { display: grid; grid-template-columns: 1.05fr .95fr; gap: 18px; align-items: start; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }
.results-cta { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  background: linear-gradient(120deg, var(--brand-50), var(--surface)); border: 1px solid var(--brand-100); }
.results-cta .r-txt b { display: block; font-size: 15px; color: var(--ink); }
.results-cta .r-txt span { font-size: 13px; color: var(--muted); }

/* ---- Skeleton (carregando) ---- */
.skeleton { background: linear-gradient(100deg, var(--surface-2) 30%, var(--bg-tint) 50%, var(--surface-2) 70%);
  background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: var(--r-sm); }
@keyframes shimmer { to { background-position: -200% 0; } }
.sk-tiles { display: grid; grid-template-columns: repeat(5,1fr); gap: 12px; margin-bottom: 18px; }
.sk-tile { height: 96px; border-radius: var(--r-md); }
.fade-in { animation: fadein .35s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---- Responsivo ---- */
@media (max-width: 860px) {
  .grid-2 { grid-template-columns: 1fr; }
  .stats, .sk-tiles { grid-template-columns: repeat(2, 1fr); }
  .brand small { display: none; }
  .user-chip .uname { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---- Busca ---- */
.search { position: relative; display: flex; align-items: center; }
.search > svg { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--faint); pointer-events: none; }
/* Largura explicita: o seletor base da o width:100% a todo input/select, o que
   esticaria a busca pela linha inteira igual ao select. Aqui ela fica fixa.
   O padding vertical de 9px acompanha o de .filters select, senao os dois
   controles ficam com alturas diferentes um em cima do outro. */
.search input { padding: 9px 12px 9px 36px; width: 340px; max-width: 100%; }
.search .clear { position: absolute; right: 8px; color: var(--muted); font-size: 12px; }
@media (max-width: 640px) { .search input { min-width: 0; width: 100%; } }

/* ---- Grade de clientes ---- */
.clientes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.cli-card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow-sm); transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.cli-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--brand-200); text-decoration: none; }
.cli-top { display: flex; align-items: center; gap: 11px; margin-bottom: 15px; }
.cli-avatar { width: 42px; height: 42px; border-radius: 12px; flex: none; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--brand-500), var(--accent)); }
.cli-name { font-weight: 700; color: var(--ink); font-size: 15px; }
.cli-cnpj { font-size: 12px; color: var(--muted); }
.cli-metrics { display: flex; gap: 20px; }
.cli-metric b { display: block; font-size: 21px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.cli-metric span { font-size: 11px; color: var(--muted); }
.cli-metric.ok b { color: var(--ok); }

/* ---- Tempo / prazo ---- */
.time-card { display: flex; align-items: center; gap: 16px; background: linear-gradient(120deg, var(--brand-50), var(--surface)); border: 1px solid var(--brand-100); }
.time-ico { width: 44px; height: 44px; border-radius: 12px; flex: none; display: grid; place-items: center; background: var(--surface); color: var(--brand-600); border: 1px solid var(--brand-100); }
.time-ico svg { width: 22px; height: 22px; }
.time-main b { font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.time-main span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.time-chips { display: flex; gap: 22px; margin-left: auto; flex-wrap: wrap; }
.tm { text-align: right; }
.tm b { font-size: 15px; font-variant-numeric: tabular-nums; display: block; }
.tm span { font-size: 11px; color: var(--muted); }
.time-inline { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.time-inline svg { width: 13px; height: 13px; color: var(--faint); }
@media (max-width: 640px) { .time-card { flex-wrap: wrap; } .time-chips { margin-left: 0; } }

/* ---- Chip de usuário clicável ---- */
.user-chip:hover { text-decoration: none; border-color: var(--brand-200); background: var(--bg-tint); }

/* ---- Status do agente ---- */
.agent-status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }
.dot.off { background: var(--nok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--nok) 22%, transparent); }
.agent-card { display: flex; align-items: center; gap: 13px; }
.agent-ico { width: 42px; height: 42px; border-radius: 12px; flex: none; display: grid; place-items: center; background: var(--bg-tint); color: var(--muted); }
.agent-ico svg { width: 21px; height: 21px; }
.agent-card .a-name { font-weight: 700; font-size: 14px; }

/* ---- Filtros + paginação ---- */
/* Faixa propria abaixo do cabecalho, alinhada a esquerda com o titulo. Usada so
   no painel. Antes vivia dentro do .page-head e quebrava linha por falta de
   espaco, empilhando busca e select. */
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.filters select { min-width: 160px; padding: 9px 12px; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.pagination .pg { display: flex; gap: 8px; align-items: center; }
.pagination .btn-ghost[aria-disabled="true"] { opacity: .45; pointer-events: none; }

/* ---- Admin / formulários inline ---- */
.form-inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.form-inline .field { gap: 5px; }
.form-inline .field > span { font-size: 12px; }
.form-inline input, .form-inline select { min-width: 150px; }
.token { font-family: var(--mono); font-size: 12px; background: var(--bg-tint); padding: 3px 8px; border-radius: 6px; word-break: break-all; }

/* ---- Ações do job ---- */
.job-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.alert-ok { background: var(--ok-soft); color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 22%, transparent); }

/* ---- Frota (ops / saúde das máquinas) ---- */
.fleet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.fleet-card {
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--faint);
  border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 10px;
}
.fleet-card.lvl-ok { border-left-color: var(--ok); }
.fleet-card.lvl-degradado { border-left-color: var(--rev); }
.fleet-card.lvl-offline { border-left-color: var(--nok); opacity: .82; }
.fleet-head { display: flex; align-items: center; gap: 11px; }
.fleet-head .a-name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fleet-hb { font-variant-numeric: tabular-nums; }
.fleet-job { display: flex; align-items: center; gap: 10px; }
.fleet-job:hover { text-decoration: none; }
.fleet-idle { display: inline-flex; align-items: center; gap: 6px; }
.fleet-idle svg { width: 13px; height: 13px; color: var(--faint); }
.fleet-flags { display: flex; gap: 6px; flex-wrap: wrap; }
.flag {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600;
  padding: 3px 9px; border-radius: var(--r-full); border: 1px solid transparent;
}
.flag svg { width: 12px; height: 12px; }
.flag.f-on  { background: var(--ok-soft);  color: var(--ok); }
.flag.f-off { background: var(--nok-soft); color: var(--nok); }
.flag.f-na  { background: var(--wait-bg);  color: var(--muted); }
.fleet-foot { display: flex; gap: 14px; flex-wrap: wrap; }
.fleet-err {
  display: flex; align-items: flex-start; gap: 7px; font-size: 12.5px; color: var(--nok);
  background: var(--nok-soft); border: 1px solid color-mix(in srgb, var(--nok) 20%, transparent);
  border-radius: var(--r-sm); padding: 8px 10px;
}
.fleet-err svg { width: 14px; height: 14px; flex: none; margin-top: 1px; }
