/* ═══════════════════════════════════════════════════════════════════
   AUTOMYX GESTÃO — Design System v5 "FLIGHT DECK"
   Reescrito do zero. Identidade automyx.com.br:
   cyan #00d4e8 · purple #8b5cf6 · magenta #c084fc · dark #05060b
   Painéis flutuantes · bordas-gradiente · tipografia display
   ═══════════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Sora:wght@600;700;800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  --bg: #05060b;
  --bg-2: #090a13;
  --panel: #0b0c17;
  --panel-2: #10121f;
  --card: #0b0c17;
  --card-solid: #0d0e1b;
  --card-hover: #12142400;
  --line: #1b1e33;
  --line-2: #262a47;
  --border: #1b1e33;
  --border-2: rgba(0, 212, 232, .35);
  --cyan: #00d4e8;
  --purple: #8b5cf6;
  --magenta: #c084fc;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --text: #f2f4fb;
  --text-2: #9aa3c2;
  --text-3: #59607f;
  --grad: linear-gradient(135deg, #00d4e8, #8b5cf6 55%, #c084fc);
  --grad-soft: linear-gradient(135deg, rgba(0,212,232,.12), rgba(139,92,246,.12));
  --font-d: 'Space Grotesk', 'Sora', sans-serif;   /* display */
  --font-h: 'Sora', sans-serif;                     /* labels marca */
  --font-b: 'Inter', sans-serif;
  --font-m: 'JetBrains Mono', monospace;
  --r: 18px;
  --r-lg: 24px;
  --shadow: 0 24px 70px rgba(0, 0, 0, .55);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, .4);
  --glow-cyan: 0 0 30px rgba(0, 212, 232, .25);
  --sidebar-w: 264px;
  --ease: cubic-bezier(.22, .9, .28, 1);
  --radius: var(--r); /* compat */
}

* { margin: 0; padding: 0; box-sizing: border-box; }
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-thumb { background: #232742; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #343a60; }
::-webkit-scrollbar-track { background: transparent; }
html { scrollbar-color: #232742 var(--bg); }
::selection { background: rgba(0, 212, 232, .35); }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-b);
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
/* fundo: matriz de pontos + horizonte aurora */
body::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(rgba(154, 163, 194, .13) 1px, transparent 1.3px);
  background-size: 26px 26px;
  mask-image: radial-gradient(1100px 700px at 50% -10%, #000 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(1100px 700px at 50% -10%, #000 20%, transparent 80%);
}
body::after {
  content: ''; position: fixed; inset: -25%; z-index: 0; pointer-events: none;
  background:
    radial-gradient(900px 460px at 78% -8%, rgba(139, 92, 246, .16), transparent 60%),
    radial-gradient(820px 420px at 12% -6%, rgba(0, 212, 232, .13), transparent 60%),
    radial-gradient(700px 520px at 50% 115%, rgba(192, 132, 252, .07), transparent 60%);
  animation: aurora 30s ease-in-out infinite alternate;
}
@keyframes aurora {
  0%   { transform: translate(0,0) scale(1); }
  100% { transform: translate(-2.5%, 1.8%) scale(1.07); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

a { color: var(--cyan); text-decoration: none; }
h1, h2, h3, .h { font-family: var(--font-d); letter-spacing: -.03em; }
.mono { font-family: var(--font-m); font-size: .92em; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow {
  font-family: var(--font-h); font-size: 10.5px; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase; color: var(--cyan);
}
.eyebrow::before { content: '// '; opacity: .7; }

/* ── Shell: sidebar flutuante ───────────────────────────────── */
.shell { display: flex; min-height: 100vh; position: relative; z-index: 1; }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  position: fixed; top: 14px; bottom: 14px; left: 14px; z-index: 50;
  background: linear-gradient(180deg, #0c0d19, #08090f);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  display: flex; flex-direction: column;
  padding: 22px 14px 14px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.sidebar::before { /* fio de luz no topo */
  content: ''; position: absolute; top: 0; left: 18%; right: 18%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,212,232,.7), rgba(139,92,246,.7), transparent);
}
.main {
  flex: 1; margin-left: calc(var(--sidebar-w) + 28px);
  padding: 0 30px 70px 4px; min-width: 0;
  animation: pageIn .45s var(--ease);
}
@keyframes pageIn { from { opacity: 0; transform: translateY(12px); } }

.logo { display: flex; align-items: center; gap: 12px; padding: 2px 8px 20px; }
.logo-mark {
  width: 40px; height: 40px; border-radius: 13px; background: var(--grad);
  display: grid; place-items: center; font-family: var(--font-h); font-weight: 800;
  font-size: 15px; color: #05060d; box-shadow: var(--glow-cyan);
  position: relative; overflow: hidden;
}
.logo-mark::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%);
  transform: translateX(-110%); animation: shine 6s ease-in-out infinite;
}
@keyframes shine { 12% { transform: translateX(110%); } 100% { transform: translateX(110%); } }
.logo-name { font-family: var(--font-d); font-weight: 700; font-size: 17px; letter-spacing: -.02em; }
.logo-name small { display: block; font-family: var(--font-b); font-weight: 600; font-size: 9.5px; color: var(--text-3); letter-spacing: .17em; text-transform: uppercase; margin-top: 2px; }

.nav { display: flex; flex-direction: column; gap: 3px; margin-top: 2px; flex: 1; overflow-y: auto; padding: 2px; }
.nav-label { font-size: 9.5px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--text-3); padding: 18px 12px 7px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 13px;
  color: var(--text-2); font-weight: 500; font-size: 13.5px;
  transition: all .18s var(--ease); border: 1px solid transparent; position: relative;
}
.nav .nav-ico {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  font-size: 14px; background: rgba(255,255,255,.025); border: 1px solid var(--line);
  transition: all .18s var(--ease); flex-shrink: 0;
}
.nav a:hover { color: var(--text); background: rgba(139, 92, 246, .07); }
.nav a:hover .nav-ico { border-color: var(--line-2); transform: scale(1.06); }
.nav a.active {
  color: var(--text); background: linear-gradient(90deg, rgba(0,212,232,.13), rgba(139,92,246,.08) 70%, transparent);
  border-color: rgba(0, 212, 232, .22);
}
.nav a.active .nav-ico { background: var(--grad); color: #05060d; border: none; box-shadow: var(--glow-cyan); }
.nav a.active::after {
  content: ''; position: absolute; right: 10px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan); box-shadow: 0 0 10px var(--cyan);
}
.nav .nv-badge { margin-left: auto; font-size: 10px; font-weight: 700; color: var(--cyan); background: rgba(0,212,232,.1); border: 1px solid rgba(0,212,232,.25); padding: 1px 7px; border-radius: 999px; }

.sidebar-foot { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 13px; transition: background .15s; }
.user-chip:hover { background: rgba(255,255,255,.03); }
.user-avatar {
  width: 36px; height: 36px; border-radius: 12px; background: var(--grad);
  display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #05060d;
}
.user-chip .un { font-weight: 600; font-size: 13px; }
.user-chip .ur { font-size: 10.5px; color: var(--text-3); text-transform: capitalize; }
.btn-logout { margin-left: auto; background: none; border: none; color: var(--text-3); cursor: pointer; font-size: 15px; padding: 7px; border-radius: 9px; transition: all .15s; }
.btn-logout:hover { color: var(--red); background: rgba(248, 113, 113, .1); }

/* ── Topbar flutuante ───────────────────────────────────────── */
.topbar {
  position: sticky; top: 14px; z-index: 40;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; margin: 14px 0 26px;
  background: rgba(9, 10, 19, .82); backdrop-filter: blur(16px);
  border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-sm);
}
.crumb { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-3); font-weight: 500; white-space: nowrap; }
.crumb b { color: var(--text); font-weight: 600; font-family: var(--font-d); }
.crumb .sep { opacity: .45; }
.topbar-search {
  margin-left: auto; display: flex; align-items: center; gap: 9px;
  background: rgba(5, 6, 11, .7); border: 1px solid var(--line);
  border-radius: 12px; padding: 8px 13px; width: 300px; max-width: 34vw; cursor: pointer;
  color: var(--text-3); font-size: 12.5px; transition: all .18s var(--ease);
  white-space: nowrap; overflow: hidden;
}
.topbar-search > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; }
.topbar-search:hover { border-color: var(--border-2); color: var(--text-2); box-shadow: var(--glow-cyan); }
.topbar-search kbd {
  margin-left: auto; font-family: var(--font-m); font-size: 10px; color: var(--text-3);
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px;
}
.icon-btn {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(5, 6, 11, .7); border: 1px solid var(--line); color: var(--text-2);
  cursor: pointer; font-size: 15px; transition: all .16s; position: relative; flex-shrink: 0;
}
.icon-btn:hover { border-color: var(--border-2); color: var(--text); transform: translateY(-1px); }
.icon-btn .ndot {
  position: absolute; top: 6px; right: 7px; min-width: 15px; height: 15px; border-radius: 999px;
  background: var(--grad); color: #05060d; font-size: 9px; font-weight: 800;
  display: grid; place-items: center; padding: 0 3px; border: 2px solid var(--bg);
}
.live-pill {
  display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700;
  color: var(--green); background: rgba(52,211,153,.08); border: 1px solid rgba(52,211,153,.3);
  border-radius: 999px; padding: 6px 13px; white-space: nowrap; letter-spacing: .03em;
}

/* ── Notificações ───────────────────────────────────────────── */
.notif-panel {
  position: absolute; top: 48px; right: 0; width: 390px; max-height: 480px; overflow-y: auto;
  background: var(--card-solid); border: 1px solid var(--line-2); border-radius: 18px;
  box-shadow: var(--shadow); padding: 8px; display: none; z-index: 60;
}
.notif-panel.open { display: block; animation: dropIn .22s var(--ease); }
@keyframes dropIn { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px 8px; font-family: var(--font-d); font-weight: 700; font-size: 13.5px; }

/* ── Command palette ────────────────────────────────────────── */
.cmdk-bg { position: fixed; inset: 0; background: rgba(2, 3, 8, .75); backdrop-filter: blur(10px); z-index: 150; display: none; padding: 11vh 20px 0; justify-content: center; align-items: flex-start; }
.cmdk-bg.open { display: flex; animation: fadeIn .15s; }
.cmdk {
  width: 100%; max-width: 600px; background: var(--card-solid);
  border: 1px solid var(--line-2); border-radius: 20px;
  box-shadow: var(--shadow), var(--glow-cyan);
  overflow: hidden; animation: slideUp .25s var(--ease); position: relative;
}
.cmdk::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: linear-gradient(140deg, rgba(0,212,232,.5), rgba(139,92,246,.2) 45%, transparent 70%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.cmdk input {
  width: 100%; background: transparent; border: none; outline: none; color: var(--text);
  font-family: var(--font-b); font-size: 16px; padding: 19px 22px;
  border-bottom: 1px solid var(--line);
}
.cmdk-list { max-height: 390px; overflow-y: auto; padding: 8px; }
.cmdk-group { font-size: 10px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; color: var(--text-3); padding: 10px 14px 4px; }
.cmdk-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; cursor: pointer; font-size: 13.5px; color: var(--text-2); }
.cmdk-item:hover, .cmdk-item.sel { background: var(--grad-soft); color: var(--text); }
.cmdk-item .ci-meta { margin-left: auto; font-size: 11px; color: var(--text-3); }

/* ── Page header ────────────────────────────────────────────── */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head h1 { font-size: 34px; font-weight: 700; margin-top: 7px; letter-spacing: -.035em; }
.page-head .sub { color: var(--text-2); font-size: 13.5px; margin-top: 5px; max-width: 640px; }

/* ── Botões ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px;
  border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255,255,255,.02);
  color: var(--text); font-family: var(--font-b); font-weight: 600; font-size: 13px;
  cursor: pointer; transition: all .16s var(--ease); white-space: nowrap; position: relative; overflow: hidden;
}
.btn:hover { border-color: var(--border-2); background: rgba(0, 212, 232, .07); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0) scale(.98); }
.btn-primary { background: var(--grad); color: #05060d; border: none; box-shadow: var(--glow-cyan); font-weight: 700; }
.btn-primary::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.5) 50%, transparent 65%); transform: translateX(-120%); transition: transform .5s; }
.btn-primary:hover::after { transform: translateX(120%); }
.btn-primary:hover { filter: brightness(1.12); box-shadow: 0 0 38px rgba(0, 212, 232, .45); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover { color: var(--text); background: rgba(139, 92, 246, .09); box-shadow: none; }
.btn-sm { padding: 6px 13px; font-size: 12px; }
.btn-danger { border-color: rgba(248,113,113,.4); color: var(--red); background: rgba(248,113,113,.05); }
.btn-danger:hover { background: rgba(248,113,113,.13); border-color: var(--red); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn:focus-visible, .input:focus-visible, .icon-btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.seg { display: inline-flex; background: rgba(5,6,11,.8); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { border: none; background: transparent; color: var(--text-3); font-family: var(--font-b); font-weight: 600; font-size: 12px; padding: 7px 15px; border-radius: 999px; cursor: pointer; transition: all .15s; }
.seg button:hover { color: var(--text-2); }
.seg button.on { background: var(--grad-soft); color: var(--cyan); border: 1px solid rgba(0,212,232,.3); padding: 6px 14px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(5,6,11,.6); color: var(--text-2);
  font-size: 12px; font-weight: 600; cursor: pointer; transition: all .15s;
}
.chip:hover { border-color: var(--border-2); color: var(--text); }
.chip.on { background: var(--grad-soft); border-color: var(--border-2); color: var(--cyan); }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 20px 22px; position: relative;
}
.card-glow::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: linear-gradient(140deg, rgba(0,212,232,.5), rgba(139,92,246,.15) 40%, transparent 70%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.card.hoverable { transition: all .22s var(--ease); cursor: pointer; }
.card.hoverable:hover { transform: translateY(-4px); border-color: var(--line-2); box-shadow: var(--shadow), 0 0 0 1px rgba(0,212,232,.18); }
.card.hoverable:hover .arrow-go { opacity: 1; transform: translateX(0); }
.arrow-go { opacity: 0; transform: translateX(-6px); transition: all .2s var(--ease); color: var(--cyan); }

.stagger > * { animation: stIn .5s var(--ease) backwards; }
.stagger > *:nth-child(1) { animation-delay: .02s; } .stagger > *:nth-child(2) { animation-delay: .06s; }
.stagger > *:nth-child(3) { animation-delay: .1s; }  .stagger > *:nth-child(4) { animation-delay: .14s; }
.stagger > *:nth-child(5) { animation-delay: .18s; } .stagger > *:nth-child(6) { animation-delay: .22s; }
.stagger > *:nth-child(7) { animation-delay: .26s; } .stagger > *:nth-child(8) { animation-delay: .3s; }
.stagger > *:nth-child(n+9) { animation-delay: .34s; }
@keyframes stIn { from { opacity: 0; transform: translateY(16px); } }

/* ── KPI ────────────────────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi { padding: 18px 20px 15px; overflow: hidden; transition: all .22s var(--ease); }
.kpi::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2.5px; background: var(--grad); }
.kpi.green::before { background: linear-gradient(90deg, #34d399, #00d4e8); }
.kpi.amber::before { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.kpi.purple::before { background: linear-gradient(90deg, #8b5cf6, #c084fc); }
.kpi:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: var(--shadow-sm), 0 0 28px rgba(0,212,232,.08); }
.kpi-label { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); display: flex; justify-content: space-between; align-items: center; }
.kpi-value { font-family: var(--font-d); font-size: 38px; font-weight: 700; letter-spacing: -.045em; margin-top: 4px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.kpi-meta { font-size: 11.5px; color: var(--text-2); margin-top: 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.delta { font-size: 10.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.delta.up { color: var(--green); background: rgba(52,211,153,.1); }
.delta.flat { color: var(--text-3); background: rgba(89,96,127,.12); }

.donut {
  --p1: 0; --p2: 0;
  width: 62px; height: 62px; border-radius: 50%;
  background: conic-gradient(var(--green) 0 calc(var(--p1) * 1%),
              var(--amber) calc(var(--p1) * 1%) calc((var(--p1) + var(--p2)) * 1%),
              #2a2e4d calc((var(--p1) + var(--p2)) * 1%) 100%);
  display: grid; place-items: center; position: relative; flex-shrink: 0;
}
.donut::before { content: ''; position: absolute; inset: 7px; border-radius: 50%; background: var(--card-solid); }
.donut span { position: relative; font-family: var(--font-d); font-weight: 700; font-size: 12.5px; }

.section-title { display: flex; align-items: center; justify-content: space-between; margin: 26px 0 14px; }
.section-title h2 { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.section-title .hint { font-size: 11.5px; color: var(--text-3); font-weight: 400; }

/* ── Badges / status ────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3.5px 11px;
  border-radius: 999px; font-size: 11px; font-weight: 600; border: 1px solid var(--line);
  background: rgba(139, 92, 246, .07); color: var(--text-2); white-space: nowrap;
}
.badge.cyan { color: var(--cyan); border-color: rgba(0,212,232,.32); background: rgba(0,212,232,.08); }
.badge.green { color: var(--green); border-color: rgba(52,211,153,.32); background: rgba(52,211,153,.08); }
.badge.amber { color: var(--amber); border-color: rgba(251,191,36,.32); background: rgba(251,191,36,.08); }
.badge.red { color: var(--red); border-color: rgba(248,113,113,.32); background: rgba(248,113,113,.08); }
.badge.purple { color: var(--magenta); border-color: rgba(192,132,252,.32); background: rgba(139,92,246,.1); }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot.active { background: var(--green); animation: pulse 1.8s infinite; }
.dot.idle { background: var(--amber); }
.dot.offline, .dot.error { background: var(--text-3); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .55); }
  70% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

[data-tip] { position: relative; }
[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: #171a30; border: 1px solid var(--line-2); color: var(--text); font-size: 11px; font-weight: 500;
  padding: 6px 11px; border-radius: 9px; white-space: nowrap; z-index: 80; box-shadow: var(--shadow-sm);
  animation: fadeIn .15s; pointer-events: none;
}

/* ── Forms ──────────────────────────────────────────────────── */
label.fl { display: block; font-size: 11.5px; font-weight: 600; color: var(--text-2); margin: 14px 0 6px; letter-spacing: .04em; }
.input, select.input, textarea.input {
  width: 100%; padding: 11px 15px; background: rgba(5, 6, 11, .8); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px; font-family: var(--font-b);
  font-size: 13.5px; transition: all .18s; outline: none;
}
.input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0, 212, 232, .12), var(--glow-cyan); }
.input::placeholder { color: var(--text-3); }
textarea.input { resize: vertical; min-height: 88px; line-height: 1.6; }
select.input option, select.input optgroup { background: var(--card-solid); }

/* ── Modal ──────────────────────────────────────────────────── */
.modal-bg {
  position: fixed; inset: 0; background: rgba(2, 3, 8, .8); backdrop-filter: blur(8px);
  display: none; align-items: flex-start; justify-content: center; z-index: 100;
  padding: 6vh 20px 40px; overflow-y: auto;
}
.modal-bg.open { display: flex; animation: fadeIn .18s; }
.modal {
  background: var(--card-solid); border: 1px solid var(--line-2); border-radius: 22px;
  width: 100%; max-width: 560px; padding: 28px 30px; box-shadow: var(--shadow);
  animation: slideUp .3s var(--ease); position: relative;
}
.modal::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: linear-gradient(140deg, rgba(0,212,232,.45), transparent 45%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.modal.wide { max-width: 820px; }
.modal h3 { font-size: 20px; margin-bottom: 4px; }
.modal .msub { color: var(--text-2); font-size: 12.5px; line-height: 1.6; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(22px) scale(.97); } }

/* ── Toast ──────────────────────────────────────────────────── */
#toasts { position: fixed; bottom: 24px; right: 24px; z-index: 220; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--card-solid); border: 1px solid var(--line-2); border-left: 3px solid var(--cyan);
  padding: 13px 18px; border-radius: 14px; box-shadow: var(--shadow); font-size: 13px;
  max-width: 380px; animation: toastIn .32s var(--ease); display: flex; gap: 10px; align-items: center;
}
.toast.error { border-left-color: var(--red); }
.toast.success { border-left-color: var(--green); }
@keyframes toastIn { from { opacity: 0; transform: translateX(46px); } }

/* ── Tabelas ────────────────────────────────────────────────── */
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); padding: 10px 14px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 12px 14px; border-bottom: 1px solid rgba(27, 30, 51, .6); font-size: 13px; }
.tbl tr { transition: background .14s; }
.tbl tr:hover td { background: rgba(0, 212, 232, .04); }
.tbl tr:last-child td { border-bottom: none; }

/* ── Kanban ─────────────────────────────────────────────────── */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(276px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 16px; align-items: start; }
.kcol {
  background: linear-gradient(180deg, rgba(16,18,31,.85), rgba(11,12,23,.9));
  border: 1px solid var(--line); border-radius: var(--r); padding: 12px; min-height: 240px;
  position: relative; transition: all .18s; overflow: hidden;
}
.kcol::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2.5px; background: var(--kc, var(--text-3)); opacity: .9; }
.kcol[data-col="draft"] { --kc: #59607f; } .kcol[data-col="open"] { --kc: #00d4e8; }
.kcol[data-col="in_review"] { --kc: #8b5cf6; } .kcol[data-col="in_rework"] { --kc: #fbbf24; }
.kcol[data-col="waiting"] { --kc: #c084fc; } .kcol[data-col="resolved"] { --kc: #34d399; }
.kcol-head { display: flex; align-items: center; justify-content: space-between; padding: 5px 6px 11px; }
.kcol-head .kt { font-family: var(--font-d); font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.kcol-head .kt::before { content: ''; width: 8px; height: 8px; border-radius: 3px; background: var(--kc); box-shadow: 0 0 10px var(--kc); }
.kcol-head .kc { font-family: var(--font-m); font-size: 10.5px; color: var(--text-3); background: rgba(5,6,11,.8); border-radius: 999px; padding: 2px 9px; border: 1px solid var(--line); }
.kcol.dragover { border-color: var(--kc); box-shadow: inset 0 0 36px color-mix(in srgb, var(--kc) 13%, transparent), 0 0 0 1px var(--kc); }
.kcard {
  background: var(--card-solid); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; margin-bottom: 9px; cursor: grab; transition: all .17s var(--ease); position: relative;
}
.kcard:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.kcard.dragging { opacity: .4; transform: rotate(2.5deg) scale(.97); }
.kcard .kc-title { font-weight: 600; font-size: 13px; line-height: 1.45; }
.kcard .kc-meta { display: flex; align-items: center; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
.kcard .kc-agent { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-2); margin-left: auto; }
.prio { width: 4px; align-self: stretch; border-radius: 4px; flex-shrink: 0; }
.prio-critical { background: var(--red); box-shadow: 0 0 8px rgba(248,113,113,.5); }
.prio-high { background: var(--amber); } .prio-medium { background: var(--cyan); } .prio-low { background: var(--text-3); }
.kadd { width: 100%; border: 1px dashed rgba(139,92,246,.3); background: transparent; color: var(--text-3); border-radius: 12px; padding: 9px; font-size: 12px; cursor: pointer; font-family: var(--font-b); transition: all .15s; }
.kadd:hover { color: var(--cyan); border-color: var(--border-2); background: rgba(0,212,232,.04); }

/* ── Feed ───────────────────────────────────────────────────── */
.feed { display: flex; flex-direction: column; max-height: 520px; overflow-y: auto; }
.feed-item { display: flex; gap: 13px; padding: 12px 6px; border-bottom: 1px solid rgba(27,30,51,.55); animation: feedIn .35s var(--ease); }
.feed-item:last-child { border-bottom: none; }
@keyframes feedIn { from { opacity: 0; transform: translateY(-8px); } }
.feed-ico {
  width: 36px; height: 36px; border-radius: 11px; background: var(--grad-soft);
  border: 1px solid var(--line); display: grid; place-items: center; font-size: 14px; flex-shrink: 0;
}
.feed-body { min-width: 0; flex: 1; }
.feed-title { font-size: 12.5px; font-weight: 600; line-height: 1.4; }
.feed-detail { font-size: 11.5px; color: var(--text-2); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.feed-time { font-size: 10.5px; color: var(--text-3); margin-top: 3px; display: flex; gap: 6px; align-items: center; }
.feed-day {
  font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--cyan);
  padding: 16px 6px 7px; display: flex; align-items: center; gap: 10px;
}
.feed-day::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-2), transparent); }

/* ── Agent cards ────────────────────────────────────────────── */
.agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(256px, 1fr)); gap: 14px; }
.agent-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 11px; border-top: 2px solid transparent; }
.agent-card.lv-C-Level { border-top-color: var(--cyan); }
.agent-card.lv-Diretor { border-top-color: var(--purple); }
.agent-card.lv-Gerente { border-top-color: var(--magenta); }
.agent-card.lv-Especialista { border-top-color: var(--green); }
.agent-card.lv-Analista { border-top-color: #3a4063; }
.agent-card .ac-top { display: flex; gap: 11px; align-items: center; }
.agent-ava {
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center;
  background: rgba(5,6,11,.75); border: 1px solid rgba(0,212,232,.3); flex-shrink: 0;
}
.agent-card .ac-name { font-weight: 700; font-size: 13.5px; font-family: var(--font-d); letter-spacing: -.02em; }
.agent-card .ac-role { font-size: 11px; color: var(--text-3); }
.agent-card .ac-stats { display: flex; gap: 12px; font-size: 11px; color: var(--text-2); border-top: 1px solid rgba(27,30,51,.6); padding-top: 10px; align-items: center; }

.ava-stack { display: flex; align-items: center; }
.ava-stack > * { margin-left: -9px; border-radius: 10px; border: 2px solid var(--card-solid); background: var(--bg-2); transition: transform .15s; }
.ava-stack > *:first-child { margin-left: 0; }
.ava-stack > *:hover { transform: translateY(-3px) scale(1.12); z-index: 2; }
.ava-more { width: 26px; height: 26px; display: grid; place-items: center; font-size: 9.5px; font-weight: 700; color: var(--text-2); }

.ring-wrap { position: relative; display: grid; place-items: center; }
.ring-wrap .ring-label { position: absolute; font-family: var(--font-d); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ── Organograma ────────────────────────────────────────────── */
.org-wrap { background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; position: relative; height: calc(100vh - 235px); min-height: 480px; }
.org-svg { width: 100%; height: 100%; cursor: grab; }
.org-svg:active { cursor: grabbing; }
.org-controls { position: absolute; top: 14px; right: 14px; display: flex; gap: 8px; z-index: 5; }
.org-legend { position: absolute; left: 14px; bottom: 14px; display: flex; gap: 8px; z-index: 5; flex-wrap: wrap; }
.org-node-card { transition: filter .15s; cursor: pointer; }
.org-node-card:hover { filter: brightness(1.35) drop-shadow(0 0 6px rgba(0,212,232,.4)); }

/* ── Login ──────────────────────────────────────────────────── */
.login-shell { display: grid; grid-template-columns: 1.15fr 1fr; min-height: 100vh; position: relative; z-index: 1; }
.login-brand {
  background:
    radial-gradient(700px 500px at 20% 110%, rgba(0,212,232,.13), transparent 60%),
    radial-gradient(600px 460px at 90% -10%, rgba(139,92,246,.18), transparent 60%),
    linear-gradient(155deg, #07080f 0%, #0c0d1c 55%, #131030 100%);
  display: flex; flex-direction: column; justify-content: space-between; padding: 52px 58px;
  position: relative; overflow: hidden; border-right: 1px solid var(--line);
}
.login-brand::before {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(154,163,194,.14) 1px, transparent 1.3px);
  background-size: 26px 26px;
  mask-image: radial-gradient(700px 600px at 35% 35%, #000 10%, transparent 75%);
  -webkit-mask-image: radial-gradient(700px 600px at 35% 35%, #000 10%, transparent 75%);
}
.login-form-side { display: flex; align-items: center; justify-content: center; padding: 40px; }
.login-card { width: 100%; max-width: 410px; }
@media (max-width: 880px) { .login-shell { grid-template-columns: 1fr; } .login-brand { display: none; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-26px); } }

/* ── CHAT v5 — cockpit ──────────────────────────────────────── */
.chat-layout { display: grid; grid-template-columns: 320px 1fr; gap: 16px; height: calc(100vh - 165px); min-height: 480px; }
.chat-side { display: flex; flex-direction: column; min-height: 0; padding: 14px !important; }
.chat-side .cs-search { margin-bottom: 10px; }
.chat-roster { overflow-y: auto; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 4px; }
.cs-group { font-size: 9.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); padding: 12px 8px 5px; }
.cs-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 13px;
  cursor: pointer; transition: all .15s; border: 1px solid transparent;
}
.cs-item:hover { background: rgba(139,92,246,.07); }
.cs-item.sel { background: linear-gradient(90deg, rgba(0,212,232,.13), rgba(139,92,246,.07)); border-color: rgba(0,212,232,.25); }
.cs-item .csi-name { font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-item .csi-sub { font-size: 10.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-item .csi-ava { width: 34px; height: 34px; border-radius: 10px; background: rgba(5,6,11,.7); border: 1px solid var(--line); display: grid; place-items: center; flex-shrink: 0; }

.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 0 !important; overflow: hidden; }
.chat-head {
  padding: 14px 22px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 13px;
  background: rgba(9,10,19,.6);
}
.chat-head .ch-name { font-family: var(--font-d); font-weight: 700; font-size: 15px; }
.chat-head .ch-sub { font-size: 11px; color: var(--text-3); }
.chat-msgs { flex: 1; overflow-y: auto; padding: 26px 28px; display: flex; flex-direction: column; min-height: 0; }
.chat-day { align-self: center; font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); background: rgba(5,6,11,.8); border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px; margin: 14px 0 6px; }
.msg-row { display: flex; gap: 11px; margin-top: 16px; animation: feedIn .25s var(--ease); max-width: 100%; }
.msg-row.user { flex-direction: row-reverse; }
.msg {
  max-width: 72%; padding: 13px 17px; border-radius: 18px; font-size: 13.5px; line-height: 1.65;
  white-space: pre-wrap; word-break: break-word; position: relative;
}
.msg-row.user .msg {
  background: linear-gradient(135deg, rgba(0,212,232,.16), rgba(139,92,246,.18));
  border: 1px solid rgba(0,212,232,.3); border-bottom-right-radius: 6px;
}
.msg-row.assistant .msg { background: var(--card-solid); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg b, .msg strong { color: var(--cyan); font-weight: 600; }
.msg code { font-family: var(--font-m); font-size: .88em; background: rgba(0,212,232,.08); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }
.msg pre { background: rgba(2,3,8,.8); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; overflow-x: auto; margin: 8px 0; font-family: var(--font-m); font-size: 12px; }
.msg pre code { background: none; border: none; padding: 0; }
.msg-time { font-size: 9.5px; color: var(--text-3); margin-top: 5px; }
.msg-row.user .msg-time { text-align: right; }
.chat-ava { width: 32px; height: 32px; border-radius: 10px; background: rgba(5,6,11,.7); border: 1px solid var(--line); display: grid; place-items: center; flex-shrink: 0; align-self: flex-end; font-weight: 700; font-size: 12px; color: var(--cyan); }
.chat-input-row { display: flex; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line); align-items: flex-end; background: rgba(9,10,19,.6); }
.chat-input-row .input { border-radius: 16px; }
.chat-hints { display: flex; gap: 8px; padding: 0 28px 14px; flex-wrap: wrap; }
.typing { display: inline-flex; gap: 4px; padding: 6px 2px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); animation: tp 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .18s; } .typing i:nth-child(3) { animation-delay: .36s; }
@keyframes tp { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-5px); opacity: 1; } }
.chat-list { overflow-y: auto; } /* compat v4 */

/* ── Misc ───────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-31 { display: grid; grid-template-columns: 2.05fr 1fr; gap: 16px; }
@media (max-width: 1150px) { .grid-2, .grid-31 { grid-template-columns: 1fr; } }
.empty { text-align: center; color: var(--text-3); padding: 46px 20px; font-size: 13px; line-height: 1.7; }
.empty .e-ico { font-size: 34px; display: block; margin-bottom: 10px; opacity: .55; }
.skel { background: linear-gradient(90deg, rgba(16,18,31,.7) 25%, rgba(24,27,48,.8) 50%, rgba(16,18,31,.7) 75%); background-size: 200% 100%; animation: skel 1.4s infinite; border-radius: 14px; border: 1px solid var(--line); }
@keyframes skel { to { background-position: -200% 0; } }
.spin { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(0,212,232,.25); border-top-color: var(--cyan); border-radius: 50%; animation: rot .7s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
.drawer {
  position: fixed; top: 14px; right: -620px; bottom: 14px; width: 570px; max-width: 94vw;
  background: var(--card-solid); border: 1px solid var(--line-2); border-radius: var(--r-lg); z-index: 90;
  transition: right .34s var(--ease); overflow-y: auto; padding: 26px 28px;
  box-shadow: -24px 0 70px rgba(0, 0, 0, .6);
}
.drawer.open { right: 14px; }
.drawer-bg { position: fixed; inset: 0; z-index: 85; background: rgba(2,3,8,.5); display: none; }
.drawer-bg.open { display: block; animation: fadeIn .2s; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 16px 0 15px; }
.tab { padding: 9px 15px; font-size: 12.5px; font-weight: 600; color: var(--text-2); cursor: pointer; border: none; background: none; border-bottom: 2px solid transparent; margin-bottom: -1px; font-family: var(--font-b); transition: all .15s; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--cyan); border-bottom-color: var(--cyan); }
.bar-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-size: 12px; }
.bar-row .bl { width: 112px; color: var(--text-2); flex-shrink: 0; text-align: right; }
.bar-row .bar { flex: 1; height: 9px; background: rgba(5,6,11,.9); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.bar-row .bar > i { display: block; height: 100%; background: var(--grad); border-radius: 99px; transition: width .9s var(--ease); box-shadow: 0 0 10px rgba(0,212,232,.35); }
.bar-row .bn { width: 38px; color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--line-2), transparent); margin: 18px 0; border: none; }
kbd.k { font-family: var(--font-m); font-size: 10px; color: var(--text-2); background: var(--bg-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }
