/* Cerberus — identidade Personalize IT (laranja #EA4100 / grafite #21222B) com a estrutura do UniFi */
:root {
  --bg: #0f1012; --panel: #16171a; --panel-2: #1c1e21; --elev: #282b2f; --hover: rgba(249,250,250,.04);
  --line: rgba(249,250,250,.07); --line-2: rgba(249,250,250,.13);
  --text: #f9fafa; --text-2: rgba(255,255,255,.66); --muted: #8a929c;
  --accent: #EA4100; --accent-2: #ff6a2b; --accent-soft: rgba(234,65,0,.14); --secondary: #21222B;
  --ok: #37be5f; --ok-soft: rgba(55,190,95,.14); --warn: #facc15; --warn-soft: rgba(250,204,21,.14);
  --crit: #ef4444; --crit-soft: rgba(239,68,68,.16); --info: #4797ff;
  --zappy: #4ade80; --carmak: #a78bfa;
  --r: 10px; --r-lg: 18px;
  --font: 'Inter', 'Segoe UI', system-ui, sans-serif; --display: 'Outfit', 'Inter', sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f4f5; --panel: #ffffff; --panel-2: #f7f7f8; --elev: #ececee; --hover: rgba(33,34,43,.04);
  --line: rgba(33,34,43,.08); --line-2: rgba(33,34,43,.16);
  --text: #21222B; --text-2: #51525A; --muted: #7b7d86; --accent-soft: rgba(234,65,0,.10);
  --warn: #c99700; --ok: #1f9d4a; color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); margin: 0; font-weight: 600; letter-spacing: -.01em; }
.hidden { display: none !important; }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Estrutura (barra lateral de ícones estilo UniFi) ---------- */
.app { display: grid; grid-template-columns: 64px 1fr; height: 100vh; }
.rail { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; padding: 12px 0; gap: 4px; }
.rail .logo { width: 38px; height: 38px; margin-bottom: 14px; }
.rail a, .rail button { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); background: none; border: 0; cursor: pointer; position: relative; }
.rail a:hover, .rail button:hover { color: var(--text); background: var(--hover); }
.rail a.on { color: var(--accent); background: var(--accent-soft); }
.rail a.on::before { content: ''; position: absolute; left: -11px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--accent); }
.rail .sep { flex: 1; }
.rail .tip { position: absolute; left: 52px; background: var(--elev); color: var(--text); padding: 4px 9px; border-radius: 6px; font-size: 12px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s; z-index: 50; }
.rail a:hover .tip, .rail button:hover .tip { opacity: 1; }
.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.top { height: 56px; flex: none; display: flex; align-items: center; gap: 14px; padding: 0 20px; border-bottom: 1px solid var(--line); background: var(--panel); }
.top h1 { font-size: 20px; }
.top .brand { font-family: var(--display); font-weight: 700; letter-spacing: .14em; font-size: 12px; color: var(--accent); }
.top .grow { flex: 1; }
.status-dot { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.status-dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.status-dot.err::before { background: var(--crit); box-shadow: 0 0 0 3px var(--crit-soft); }
.me-btn { display: flex; align-items: center; gap: 9px; background: none; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px 4px 4px; cursor: pointer; }
.me-btn:hover { border-color: var(--line-2); }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--secondary); color: var(--accent-2); border: 1px solid var(--line-2); flex: none; }
.avatar.lg { width: 40px; height: 40px; font-size: 14px; }
.view { flex: 1; overflow: auto; padding: 18px 20px 28px; }

/* ---------- Botões (Personalize IT) ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--panel-2); cursor: pointer; font-weight: 600; font-size: 13px; white-space: nowrap; }
.btn:hover { background: var(--elev); }
.btn.primary { background: linear-gradient(180deg, var(--accent-2), var(--accent)); border-color: transparent; color: #fff; box-shadow: 0 6px 18px -6px rgba(234,65,0,.65); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: none; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.danger { color: var(--crit); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.big { height: 44px; border-radius: var(--r-lg); font-size: 15px; }

/* Controle segmentado (UniFi: 1h | 1D | 1S) */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; padding: 2px; background: var(--panel); }
.seg button { border: 0; background: none; padding: 5px 11px; border-radius: 7px; cursor: pointer; color: var(--muted); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--elev); color: var(--text); }

/* Chips de filtro */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--text-2); cursor: pointer; font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.chip:hover { border-color: var(--line-2); color: var(--text); }
.chip .n { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--text); opacity: .8; }
.chip.on { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.chip.zero { opacity: .5; }

/* Campos */
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; color: var(--muted); font-weight: 500; }
.input, select.input, textarea.input { height: 36px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--panel-2); padding: 0 11px; outline: none; width: 100%; }
textarea.input { height: auto; min-height: 70px; padding: 8px 11px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search { position: relative; flex: 1; min-width: 220px; max-width: 520px; }
.search svg { position: absolute; left: 11px; top: 9px; color: var(--muted); }
.search .input { padding-left: 36px; }
.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 22px; background: var(--elev); border: 1px solid var(--line-2); cursor: pointer; transition: .15s; }
.switch span::after { content: ''; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; border-radius: 50%; background: var(--text-2); transition: .15s; }
.switch input:checked + span { background: var(--accent); border-color: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); background: #fff; }

/* ---------- Painéis e KPIs ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.card-h h3 { font-size: 15px; }
.card-b { padding: 14px 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; cursor: default; }
.kpi.click { cursor: pointer; } .kpi.click:hover { border-color: var(--line-2); }
.kpi .v { font-family: var(--display); font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi .l { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.kpi.crit { border-color: rgba(239,68,68,.45); background: linear-gradient(180deg, var(--crit-soft), transparent); } .kpi.crit .v { color: var(--crit); }
.kpi.warn .v { color: var(--warn); } .kpi.ok .v { color: var(--ok); } .kpi.accent .v { color: var(--accent-2); }

/* ---------- Barra de filtros ---------- */
.filters { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.frow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.frow .lbl { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; margin-right: 2px; }
.dd { position: relative; }
.dd-pop { position: absolute; top: 34px; left: 0; z-index: 40; min-width: 240px; max-height: 340px; overflow: auto; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 6px; box-shadow: 0 16px 40px rgba(0,0,0,.45); }
.dd-pop label { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; cursor: pointer; font-size: 13px; }
.dd-pop label:hover { background: var(--hover); }
.dd-pop input { accent-color: var(--accent); }
.dd-pop .dd-search { margin: 2px 2px 6px; height: 30px; }
.hint { font-size: 12px; color: var(--muted); }
.hint code { background: var(--elev); padding: 1px 5px; border-radius: 4px; color: var(--text-2); }

/* ---------- Kanban ---------- */
.alert-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; margin-bottom: 14px; border: 1px solid rgba(239,68,68,.5); background: linear-gradient(90deg, var(--crit-soft), transparent 70%); animation: pulse-b 2s infinite; }
.alert-bar b { color: var(--crit); }
@keyframes pulse-b { 50% { border-color: rgba(239,68,68,.15); } }
/* Grade que quebra linha sozinha: todos os quadros cabem na tela, sem rolar para o lado */
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; align-items: start; padding-bottom: 10px; }
.col { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; max-height: 540px; }
.col-h { padding: 11px 13px; border-bottom: 1px solid var(--line); }
.col-h .t { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.col-h .t .cnt { margin-left: auto; font-family: var(--display); font-size: 16px; }
.col-h .s { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.col-b { padding: 8px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.col.crit { border-color: rgba(239,68,68,.55); }
.col.unassigned .col-h { background: linear-gradient(180deg, rgba(71,151,255,.08), transparent); }
.empty { text-align: center; color: var(--muted); font-size: 12.5px; padding: 18px 8px; }

/* Coluna de ociosos: sempre a primeira, em destaque */
.col.idle { border: 1px solid var(--accent); box-shadow: 0 0 0 1px rgba(234,65,0,.25), 0 10px 30px -10px rgba(234,65,0,.45); background: linear-gradient(180deg, rgba(234,65,0,.10), var(--panel) 120px); }
.col.idle .col-h .t { color: var(--accent-2); }
.idle-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 7px; color: var(--accent-2); font-size: 12.5px; }
.col-h { min-width: 0; } .col-h .t span:not(.avatar):not(.cnt) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.idle-line b { font-family: var(--display); font-size: 17px; font-variant-numeric: tabular-nums; }
.idle-line .btn { margin-left: auto; }
.idle-line svg.i { width: 15px; height: 15px; }
.idle-card { border: 1px solid rgba(234,65,0,.35); background: var(--panel-2); border-radius: 10px; padding: 10px 11px; display: flex; flex-direction: column; gap: 6px; }
.idle-card .row { display: flex; align-items: center; gap: 9px; }
.idle-card .nm { font-weight: 600; }
.idle-card .since { font-family: var(--display); font-size: 20px; font-weight: 600; color: var(--accent-2); font-variant-numeric: tabular-nums; }
.idle-card .meta { font-size: 11.5px; color: var(--muted); }
.idle-card.long { border-color: var(--accent); animation: pulse-o 2.2s infinite; }
@keyframes pulse-o { 50% { box-shadow: 0 0 0 4px rgba(234,65,0,.15); } }

/* Cartão de chamado */
.tk { background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--line-2); border-radius: 10px; padding: 9px 10px 9px 11px; display: flex; flex-direction: column; gap: 5px; }
.tk:hover { border-color: var(--line-2); }
.tk.ok { border-left-color: var(--ok); } .tk.warn { border-left-color: var(--warn); }
.tk.crit { border-left-color: var(--crit); border-color: rgba(239,68,68,.45); background: linear-gradient(180deg, var(--crit-soft), var(--panel-2) 60%); }
.tk .r1 { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.tk .r1 .num { font-variant-numeric: tabular-nums; }
.tk .ttl { font-weight: 600; font-size: 13.5px; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tk .sub { font-size: 12px; color: var(--text-2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tk .pv { font-size: 12px; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tk .pv b { color: var(--text-2); font-weight: 600; }
.tk .r3 { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.tk .r3 .grow { flex: 1; }
.tk .st { font-size: 11px; color: var(--muted); }
.src { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; padding: 1px 6px; border-radius: 5px; text-transform: uppercase; }
.src.zappy { color: var(--zappy); background: rgba(74,222,128,.12); }
.src.carmak { color: var(--carmak); background: rgba(167,139,250,.14); }
.pill { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--elev); color: var(--text-2); white-space: nowrap; }
.pill.crit { background: var(--crit-soft); color: var(--crit); } .pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.accent { background: var(--accent-soft); color: var(--accent-2); }
.pill.info { background: rgba(71,151,255,.14); color: var(--info); }
.timer { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13px; padding: 2px 8px; border-radius: 7px; }
.timer.ok { color: var(--ok); background: var(--ok-soft); } .timer.warn { color: var(--warn); background: var(--warn-soft); }
.timer.crit { color: #fff; background: var(--crit); } .timer.none { color: var(--muted); background: var(--elev); font-weight: 600; }
.intervene { font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: #fff; background: var(--crit); padding: 2px 7px; border-radius: 5px; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .55; } }
.icon-btn { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--panel); cursor: pointer; color: var(--text-2); }
.icon-btn:hover { color: var(--accent-2); border-color: var(--accent); }
.icon-btn svg.i { width: 15px; height: 15px; }

/* ---------- Tabelas (UniFi: linhas finas) ---------- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; cursor: pointer; user-select: none; }
.tbl th.ns { cursor: default; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--hover); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr.click { cursor: pointer; }
.bar { height: 6px; background: var(--elev); border-radius: 6px; overflow: hidden; min-width: 70px; }
.bar > i { display: block; height: 100%; border-radius: 6px; }

/* ---------- Atividade ---------- */
.feed { display: flex; flex-direction: column; }
.ev { display: grid; grid-template-columns: 70px 30px 1fr auto; gap: 10px; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--line); }
.ev:last-child { border-bottom: 0; }
.ev .tm { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; }
.ev .ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--elev); color: var(--text-2); }
.ev .ic svg.i { width: 15px; height: 15px; }
.ev .ic.crit { background: var(--crit-soft); color: var(--crit); } .ev .ic.warn { background: var(--warn-soft); color: var(--warn); }
.ev .ic.ok { background: var(--ok-soft); color: var(--ok); } .ev .ic.accent { background: var(--accent-soft); color: var(--accent-2); }
.ev .ic.info { background: rgba(71,151,255,.14); color: var(--info); }
.ev .tx { min-width: 0; } .ev .tx .d { font-size: 12px; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.day-sep { padding: 8px 14px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; background: var(--panel-2); border-bottom: 1px solid var(--line); }

/* ---------- Meu painel ---------- */
.mine-grid { display: grid; grid-template-columns: 320px 1fr; gap: 14px; }
.ring-card { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 22px 16px; text-align: center; }
.ring { width: 190px; height: 190px; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .c .v { font-family: var(--display); font-size: 40px; font-weight: 700; line-height: 1; }
.ring .c .l { font-size: 11px; color: var(--muted); margin: 4px auto 0; max-width: 110px; line-height: 1.3; }
.cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.cmp div { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.cmp b { display: block; font-family: var(--display); font-size: 18px; }
.cmp span { font-size: 11.5px; color: var(--muted); }
.next { display: flex; flex-direction: column; }
.next-item { display: grid; grid-template-columns: 1fr 210px auto; gap: 14px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.next-item:last-child { border-bottom: 0; }
.next-item .big { font-family: var(--display); font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.track { position: relative; height: 8px; border-radius: 8px; background: linear-gradient(90deg, var(--ok-soft) 0 50%, var(--warn-soft) 50% 100%); overflow: visible; }
.track > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 8px; }
.track .mk { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--line-2); }
.track-lbl { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); margin-top: 4px; }
.hello { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.hello h2 { font-size: 22px; } .hello h2 em { font-style: normal; color: var(--accent-2); }

/* ---------- Configurações ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; cursor: pointer; color: var(--muted); font-weight: 600; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 16px; }
.set-row { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row .tx { flex: 1; } .set-row .tx b { display: block; font-weight: 600; } .set-row .tx span { font-size: 12.5px; color: var(--muted); }
.sla-preview { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px; }
.check-grid label { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 7px; cursor: pointer; }
.check-grid label:hover { background: var(--hover); }
.check-grid input { accent-color: var(--accent); }
.warn-box { border: 1px solid rgba(250,204,21,.35); background: var(--warn-soft); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; color: var(--text-2); }

/* ---------- Modal / toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: grid; place-items: center; z-index: 100; padding: 16px; backdrop-filter: blur(3px); }
.modal { width: min(520px, 100%); background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: 0 30px 80px rgba(0,0,0,.5); max-height: 90vh; overflow: auto; }
.modal .mh { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal .mh h3 { flex: 1; font-size: 17px; }
.modal .mb { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.modal .mf { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.pick { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.pick label { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: 8px; cursor: pointer; }
.pick label:hover { background: var(--hover); }
.pick label.sel { background: var(--accent-soft); }
.pick input { accent-color: var(--accent); }
.pick .grow { flex: 1; }
.toast { position: fixed; bottom: 18px; right: 18px; z-index: 200; background: var(--elev); border: 1px solid var(--line-2); border-left: 3px solid var(--accent); padding: 11px 16px; border-radius: 10px; box-shadow: 0 14px 40px rgba(0,0,0,.45); max-width: 380px; }
.toast.err { border-left-color: var(--crit); } .toast.ok { border-left-color: var(--ok); }
.menu { position: absolute; right: 20px; top: 52px; z-index: 60; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 12px; min-width: 220px; padding: 6px; box-shadow: 0 16px 40px rgba(0,0,0,.45); }
.menu .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu .who small { color: var(--muted); display: block; }
.menu button { display: flex; align-items: center; gap: 9px; width: 100%; background: none; border: 0; padding: 8px 10px; border-radius: 8px; cursor: pointer; text-align: left; }
.menu button:hover { background: var(--hover); }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(800px 500px at 50% 110%, rgba(234,65,0,.22), transparent 70%), #0f1012; }
.login { width: min(400px, 100%); background: linear-gradient(180deg, #1b1c22, #131418); border: 1px solid rgba(249,250,250,.08); border-radius: 28px; padding: 34px 30px 28px; box-shadow: 0 40px 100px rgba(0,0,0,.55); }
.login .logo { width: 74px; height: 74px; display: block; margin: 0 auto 10px; filter: drop-shadow(0 8px 24px rgba(234,65,0,.45)); }
.login h1 { text-align: center; font-size: 30px; letter-spacing: .16em; font-weight: 700; color: #fff; }
.login .tag { text-align: center; color: rgba(255,255,255,.55); font-size: 13px; margin: 4px 0 24px; }
.login .tag b { color: var(--accent-2); font-weight: 600; }
.login form { display: flex; flex-direction: column; gap: 12px; }
.login .err { color: #ff8a8a; font-size: 13px; min-height: 18px; text-align: center; }
.login .foot { text-align: center; margin-top: 18px; font-family: var(--display); font-size: 11px; letter-spacing: .2em; color: rgba(255,255,255,.35); }
.login .foot b { color: var(--accent); font-weight: 700; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .rail { order: 2; flex-direction: row; justify-content: space-around; padding: 6px; border-right: 0; border-top: 1px solid var(--line); }
  .rail .logo, .rail .sep, .rail .tip { display: none; }
  .rail a.on::before { display: none; }
  .main { height: calc(100vh - 56px); }
  .top { padding: 0 12px; } .top .brand { display: none; }
  .view { padding: 12px; }
  .mine-grid { grid-template-columns: 1fr; }
  .next-item { grid-template-columns: 1fr; gap: 8px; }
  .board { grid-template-columns: 1fr; } .col { max-height: 480px; }
  .ev { grid-template-columns: 50px 28px 1fr; } .ev > :last-child { display: none; }
}

.lvc.ok { color: var(--ok); } .lvc.warn { color: var(--warn); } .lvc.crit { color: var(--crit); }

/* ---------- Chamado aberto no Cerberus (painel lateral) ---------- */
.tk.click { cursor: pointer; }
.drawer-bg { place-items: stretch end; padding: 0; }
.drawer { width: min(520px, 100vw); height: 100vh; background: var(--panel); border-left: 1px solid var(--line-2); display: flex; flex-direction: column; box-shadow: -30px 0 80px rgba(0,0,0,.45); animation: dw-in .18s ease-out; }
@keyframes dw-in { from { transform: translateX(40px); opacity: 0; } }
.dw-head { padding: 14px 16px 12px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.dw-head .r1 { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.dw-head .grow { flex: 1; }
.dw-head h3 { font-size: 18px; line-height: 1.3; }
.dw-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; font-size: 12.5px; }
.dw-meta span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.dw-meta b { font-weight: 600; }
.dw-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dw-body { flex: 1; overflow-y: auto; background: var(--bg); }
.chat { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; }
.dw-day { align-self: center; font-size: 11px; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); padding: 2px 10px; border-radius: 999px; margin: 6px 0; }
.msg { max-width: 82%; padding: 7px 10px 8px; border-radius: 12px; font-size: 13px; line-height: 1.4; }
.msg .who { font-size: 11px; color: var(--muted); margin-bottom: 2px; font-weight: 600; }
.msg .tx { white-space: pre-wrap; word-break: break-word; }
.msg .media { font-size: 12px; color: var(--text-2); }
.msg.them { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.me { align-self: flex-end; background: var(--accent-soft); border: 1px solid rgba(234,65,0,.3); border-bottom-right-radius: 4px; }
.msg.me .who { color: var(--accent-2); }
.msg.bot { opacity: .7; border-style: dashed; }
.tl { display: grid; grid-template-columns: 120px 1fr; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); font-size: 13px; }
.tl span { color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { .dw-meta { grid-template-columns: 1fr; } }

/* Mídia nas mensagens */
.mimg { display: block; margin: 2px 0 4px; }
.mimg img { display: block; max-width: 100%; max-height: 260px; border-radius: 8px; border: 1px solid var(--line); background: var(--elev); }
.mvid { display: block; max-width: 100%; max-height: 260px; border-radius: 8px; margin: 2px 0 4px; }
.maud { display: block; width: 260px; max-width: 100%; height: 36px; margin: 2px 0 4px; }
.mdoc { display: inline-flex; gap: 6px; align-items: center; padding: 6px 10px; border-radius: 8px; background: var(--elev); border: 1px solid var(--line); margin: 2px 0 4px; word-break: break-all; }
.mdoc:hover { border-color: var(--accent); }
/* Cartão nunca passa da largura da coluna (sem barra de rolagem lateral) */
.col-b { overflow-x: hidden; }
.tk { min-width: 0; }
.tk .r1 { flex-wrap: wrap; row-gap: 4px; }
.tk .r3 { flex-wrap: wrap; row-gap: 4px; }
.tk .st { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
/* ---------- Modo lista ---------- */
.seg button svg.i { width: 14px; height: 14px; vertical-align: -2px; }
.listview { display: flex; flex-direction: column; gap: 10px; }
.idle-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--accent);
  background: linear-gradient(90deg, rgba(234,65,0,.12), var(--panel) 60%); color: var(--accent-2); box-shadow: 0 8px 24px -12px rgba(234,65,0,.5); }
.idle-chip { display: inline-flex; align-items: center; gap: 7px; padding: 3px 4px 3px 4px; border-radius: 999px; background: var(--panel-2); border: 1px solid rgba(234,65,0,.35); color: var(--text); font-weight: 600; font-size: 12.5px; }
.idle-chip b { color: var(--accent-2); font-variant-numeric: tabular-nums; font-family: var(--display); }
.idle-chip .avatar { width: 22px; height: 22px; font-size: 10px; }
.idle-chip .icon-btn { width: 24px; height: 24px; border-radius: 999px; }
.tbl.lst { table-layout: fixed; }
.tbl.lst th:nth-child(2) { width: 118px; } .tbl.lst th:nth-child(3) { width: 118px; } .tbl.lst th:nth-child(5) { width: 170px; }
.tbl.lst th:nth-child(6) { width: 18%; } .tbl.lst th:nth-child(7) { width: 132px; } .tbl.lst th:nth-child(8) { width: 74px; }
.tbl.lst td { padding: 7px 10px; }
.tbl.lst td.lvbar { padding: 0; width: 4px; }
.tbl.lst tr.lv-crit td.lvbar { background: var(--crit); } .tbl.lst tr.lv-warn td.lvbar { background: var(--warn); } .tbl.lst tr.lv-ok td.lvbar { background: var(--ok); }
.tbl.lst tr.lv-crit td { background: rgba(239,68,68,.06); }
.ttl-cell, .cat-cell { min-width: 0; }
.ttl-cell .t1 { font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ttl-cell .t2, .cat-cell { font-size: 12px; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ttl-cell .t2 b { color: var(--text-2); }
.who-cell { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.who-cell .avatar { width: 22px; height: 22px; font-size: 10px; }
.act-cell { white-space: nowrap; text-align: right; }
.act-cell .icon-btn { display: inline-grid; }
@media (max-width: 900px) { .tbl.lst th:nth-child(6), .tbl.lst td:nth-child(6), .tbl.lst th:nth-child(3), .tbl.lst td:nth-child(3) { display: none; } }
.org-cell div { white-space: nowrap; font-variant-numeric: tabular-nums; font-size: 11.5px; margin-top: 2px; }

/* Follow up (Carmak parado aguardando cliente/fornecedor) */
.pill.fu { background: var(--info); color: #fff; text-transform: uppercase; letter-spacing: .05em; font-weight: 800; font-size: 10.5px; }
.timer.fu { color: var(--info); background: rgba(71,151,255,.14); font-weight: 600; }
.tk:has(.pill.fu) { border-left-color: var(--info); }
.icon-btn.fu-btn { color: var(--info); border-color: rgba(71,151,255,.4); }
.icon-btn.fu-btn:hover { color: #fff; background: var(--info); border-color: var(--info); }