/* ==========================================================================
   Lexcred Prospecção — estilos
   Cores da marca: troque --brand / --accent quando tiver o manual da marca.
   ========================================================================== */
:root {
  --brand-900: #0b2140;
  --brand: #0e2a4f;
  --brand-700: #173b6c;
  --brand-600: #1f4f8f;
  --brand-50: #eef3fa;
  --brand-100: #dde7f4;
  --accent: #c9a24a;
  --accent-soft: #f8f1e1;

  --bg: #edf0f4;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e3e8f0;
  --border-strong: #cfd7e3;
  --text: #172033;
  --text-2: #3b4659;
  --muted: #6b778c;

  --green: #15803d;  --green-soft: #e6f5ec;
  --amber: #b45309;  --amber-soft: #fdf2e1;
  --red: #b91c1c;    --red-soft: #fdeceb;
  --blue: #1d4ed8;   --blue-soft: #e8eeff;
  --purple: #7e22ce; --purple-soft: #f3e8ff;
  --cyan: #0e7490;   --cyan-soft: #e0f3f7;
  --gray: #475569;   --gray-soft: #eef1f5;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 2px 3px rgba(20, 37, 61, .03), 0 8px 22px -12px rgba(20, 37, 61, .2), inset 0 1px 0 #fff;
  --shadow-lg: 0 24px 60px -16px rgba(16, 32, 54, .3), 0 4px 12px rgba(16, 32, 54, .08);
  --sidebar-w: 266px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; color: var(--text); }
p { margin: 0; }
code { font-family: var(--mono); font-size: .9em; background: var(--gray-soft); padding: 1px 5px; border-radius: 4px; }
.icon { flex-shrink: 0; vertical-align: middle; }
[hidden] { display: none !important; }

/* ---------- utilitários ---------- */
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.strong { font-weight: 650; }
.mono { font-family: var(--mono); font-size: 13px; letter-spacing: -.01em; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.upper { text-transform: uppercase; }
.spacer { flex: 1; }
.text-amber { color: var(--amber); }
.text-navy { color: var(--brand-600); font-weight: 600; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.hint { color: var(--muted); font-size: 12.5px; display: block; }
.hint > .icon:first-child { margin-right: 4px; vertical-align: -2px; }
.hint.center { text-align: center; }
.link-sm { font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: background .18s, border-color .18s, color .18s, box-shadow .18s, transform .18s;
  text-decoration: none !important;
}
:focus-visible { outline: 3px solid #557fb5; outline-offset: 4px; }
.btn:focus-visible, .icon-btn:focus-visible, .nav-item:focus-visible { outline: 3px solid #557fb5; outline-offset: 3px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: linear-gradient(165deg, #294b73, #102b4e 75%); color: #fff; border-color: #18385e; box-shadow: inset 0 1px 0 #ffffff29, 0 2px 0 #081c34, 0 5px 9px -4px #132f5966; }
.btn-primary:hover:not(:disabled) { background: linear-gradient(165deg, #355e8b, #193a60 75%); transform: translateY(-1px); box-shadow: inset 0 1px 0 #ffffff36, 0 2px 0 #081c34, 0 8px 14px -5px #132f5966; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-primary-soft { background: var(--brand-50); color: var(--brand); }
.btn-primary-soft:hover { background: var(--brand-100); }
.btn-ghost { background: linear-gradient(#fff, #f6f8fa); color: var(--text-2); border-color: var(--border-strong); box-shadow: 0 2px 2px #152b4510, inset 0 1px 0 #fff; }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--muted); }
.btn-danger-ghost { background: transparent; color: var(--red); border-color: #f3c4c1; }
.btn-danger-ghost:hover { background: var(--red-soft); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; gap: 6px; }
.btn-block { width: 100%; }
.btn-microsoft { background: #fff; color: #1f1f1f; border-color: #8c8c8c; height: 44px; font-size: 15px; }
.btn-microsoft:hover:not(:disabled) { background: #f3f3f3; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--radius-sm);
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--gray-soft); color: var(--text); }

/* ---------- formulários ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 9px 12px; width: 100%; min-width: 0;
  box-shadow: inset 0 2px 3px #152b4506;
  transition: border-color .15s, box-shadow .15s;
}
select { padding-right: 30px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b778c' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-600); box-shadow: 0 0 0 3px var(--brand-100); }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--brand); }
.check-field { flex-direction: row; align-items: center; gap: 8px; padding-top: 22px; }
.check-field span { font-weight: 500 !important; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .span-2, .dl-grid .span-2 { grid-column: span 2; }
.form-section { border: 0; padding: 0; margin: 0 0 18px; }
.form-section legend { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.form-error { color: var(--red); font-size: 13px; }

/* ---------- alertas / toast ---------- */
.alert { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13.5px; border: 1px solid; }
.alert span { flex: 1; }
.alert-success { background: var(--green-soft); border-color: #bfe5cc; color: #14532d; }
.alert-error { background: var(--red-soft); border-color: #f5c6c2; color: #7f1d1d; }
.alert-info { background: var(--blue-soft); border-color: #c9d6fb; color: #1e3a8a; }
.alert-close { border: 0; background: transparent; color: inherit; opacity: .6; cursor: pointer; padding: 2px; display: grid; }
.alert-close:hover { opacity: 1; }
.flashes { display: flex; flex-direction: column; gap: 8px; padding: 16px 28px 0; }
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--brand-900); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 13.5px;
  box-shadow: var(--shadow-lg); transition: all .2s; z-index: 100;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--red); }

/* ---------- badges / tags ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-gray { background: var(--gray-soft); color: var(--gray); }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.tag { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--gray-soft); color: var(--text-2); white-space: nowrap; }
.tag-navy { background: var(--brand-50); color: var(--brand-600); }
.tag-soft { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); font-weight: 500; }
.tag-muted { opacity: .7; }
.tag-red { background: var(--red-soft); color: var(--red); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.pill-amber { background: var(--amber-soft); color: var(--amber); }
.pill-green { background: var(--green-soft); color: var(--green); }
.dot-pulse { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; animation: pulse 1.2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* etapas do funil */
.stage-novo        { --stage: var(--gray);   --stage-soft: var(--gray-soft); }
.stage-tentativa   { --stage: var(--amber);  --stage-soft: var(--amber-soft); }
.stage-contato     { --stage: var(--blue);   --stage-soft: var(--blue-soft); }
.stage-sem_retorno { --stage: var(--purple); --stage-soft: var(--purple-soft); }
.stage-negociacao  { --stage: var(--cyan);   --stage-soft: var(--cyan-soft); }
.stage-fechado     { --stage: var(--green);  --stage-soft: var(--green-soft); }
.stage-perdido     { --stage: var(--red);    --stage-soft: var(--red-soft); }
.badge[class*="stage-"] { background: var(--stage-soft); color: var(--stage); }
.stage-bg-novo { background: #94a3b8; } .stage-bg-tentativa { background: #f59e0b; } .stage-bg-contato { background: #3b82f6; }
.stage-bg-sem_retorno { background: #a855f7; } .stage-bg-negociacao { background: #06b6d4; } .stage-bg-fechado { background: #22c55e; } .stage-bg-perdido { background: #ef4444; }
.stage-border-novo { border-top-color: #94a3b8 !important; } .stage-border-tentativa { border-top-color: #f59e0b !important; } .stage-border-contato { border-top-color: #3b82f6 !important; }
.stage-border-sem_retorno { border-top-color: #a855f7 !important; } .stage-border-negociacao { border-top-color: #06b6d4 !important; } .stage-border-fechado { border-top-color: #22c55e !important; } .stage-border-perdido { border-top-color: #ef4444 !important; }

/* ---------- avatar ---------- */
.avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; font-size: 13px; flex-shrink: 0; letter-spacing: .02em; }
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-soft { background: var(--brand-50); color: var(--brand); }

/* ==========================================================================
   Login
   ========================================================================== */
.login-page { background: var(--surface); }
.login-shell { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; }
.login-brand {
  position: relative; overflow: hidden; color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(circle at 85% 15%, rgba(201, 162, 74, .22), transparent 40%),
    radial-gradient(circle at 10% 90%, rgba(31, 79, 143, .55), transparent 45%),
    linear-gradient(160deg, var(--brand-900), var(--brand) 60%, var(--brand-700));
}
.login-brand::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .07;
  background-image: linear-gradient(rgba(255,255,255,.6) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.6) 1px, transparent 1px);
  background-size: 44px 44px;
}
.login-brand-inner { position: relative; z-index: 1; max-width: 460px; margin-top: auto; margin-bottom: auto; }
.login-brand-mark { width: 60px; height: 60px; border-radius: 16px; display: grid; place-items: center; background: rgba(201, 162, 74, .16); color: var(--accent); border: 1px solid rgba(201, 162, 74, .4); margin-bottom: 28px; }
.login-brand h2 { color: #fff; font-size: 34px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 14px; }
.login-brand p { color: rgba(255, 255, 255, .78); font-size: 16px; }
.login-points { list-style: none; padding: 0; margin: 30px 0 0; display: grid; gap: 12px; }
.login-points li { display: flex; align-items: center; gap: 10px; color: rgba(255, 255, 255, .9); }
.login-points .icon { color: var(--accent); }
.login-brand-foot { position: relative; z-index: 1; font-size: 13px; color: rgba(255, 255, 255, .55); letter-spacing: .04em; }
.login-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; gap: 22px; }
.login-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px; }
.login-logo { width: 246px; max-width: 100%; align-self: flex-start; margin-bottom: 12px; }
.login-card h1 { font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; margin: 6px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.login-legal { font-size: 12px; color: var(--muted); text-align: center; max-width: 380px; }

/* ==========================================================================
   Layout do app
   ========================================================================== */
.app { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--surface);
  border-right: 1px solid var(--border); display: flex; flex-direction: column; z-index: 40;
}
.sidebar-logo { display: flex; align-items: center; padding: 22px 22px 18px; }
.sidebar-logo .brand-logo { width: 100%; }
/* Frame the supplied 2000px square image around its wordmark. The source stays untouched. */
.brand-logo { display: block; position: relative; overflow: hidden; flex-shrink: 0; width: 246px; max-width: 100%; aspect-ratio: 1360 / 370; border-radius: 10px; background: #002438; }
.brand-logo > img { display: block; position: absolute; width: 147.058824%; max-width: none; height: auto; left: -22.058824%; top: -224.324324%; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 6px 12px; flex: 1; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 550; text-decoration: none !important; position: relative;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item .icon { color: var(--muted); }
.nav-item.active { background: var(--brand-50); color: var(--brand); font-weight: 650; }
.nav-item.active .icon { color: var(--brand); }
.nav-item.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav-badge { margin-left: auto; font-style: normal; background: var(--amber); color: #fff; font-size: 11px; font-weight: 700; padding: 0 7px; border-radius: 999px; line-height: 18px; }
.nav-section { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; padding: 16px 12px 6px; }
.sidebar-clock { margin: 0 12px 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.digital-time { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--brand); letter-spacing: .02em; }
.digital-date { font-size: 12px; color: var(--muted); }
.digital-date::first-letter, .clock-digital .js-date::first-letter { text-transform: uppercase; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 14px 14px 16px; border-top: 1px solid var(--border); }
.sidebar-user-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sidebar-user-info strong { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-info span { font-size: 12px; color: var(--muted); }
.sidebar-backdrop { display: none; }

.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 22px 28px 0; flex-wrap: wrap;
}
.topbar-title { flex: 1; min-width: 200px; }
.topbar-title h1 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.topbar-title p { margin-top: 2px; font-size: 13.5px; }
.topbar-title p::first-letter { text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.topbar-actions form { display: contents; }
.menu-btn { display: none; }
.content { padding: 20px 28px 40px; flex: 1; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.card-flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { font-size: 15.5px; font-weight: 650; }
.card-head p { font-size: 12.5px; margin-top: 2px; }
.sub-title { font-size: 13px; font-weight: 650; margin: 18px 0 8px; color: var(--text-2); }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 22px 10px; color: var(--muted); }
.empty strong { color: var(--text-2); font-size: 14px; }
.empty p { font-size: 13px; max-width: 320px; }
.empty-icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--gray-soft); color: var(--muted); margin-bottom: 4px; }
.empty-icon.tone-red { background: var(--red-soft); color: var(--red); }

/* ---------- tabelas ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2); }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.card:not(.card-flush) .table th { background: transparent; }
.card:not(.card-flush) .table th:first-child, .card:not(.card-flush) .table td:first-child { padding-left: 0; }
.card:not(.card-flush) .table th:last-child, .card:not(.card-flush) .table td:last-child { padding-right: 0; }
.row-link { cursor: pointer; }
.row-link:hover td { background: var(--surface-2); }
.row-muted td { opacity: .55; }
.table-compact td { padding: 8px 12px; font-size: 13.5px; }
.cell-person { display: flex; align-items: center; gap: 10px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 14px; border-top: 1px solid var(--border); }

/* ---------- toolbar ---------- */
.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar-group { display: flex; gap: 10px; flex-wrap: wrap; }
.toolbar select { width: auto; min-width: 190px; }
.search-box { flex: 1; min-width: 240px; position: relative; display: flex; align-items: center; }
.search-box .icon { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.search-box input { padding-left: 36px; }

/* ==========================================================================
   Dashboard
   ========================================================================== */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; color: inherit; text-decoration: none !important; transition: border-color .15s, transform .15s; }
.kpi:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.kpi > div:last-child { display: flex; flex-direction: column; min-width: 0; }
.kpi-icon { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.tone-blue { background: var(--blue-soft); color: var(--blue); }
.tone-amber { background: var(--amber-soft); color: var(--amber); }
.tone-navy { background: var(--brand-50); color: var(--brand); }
.tone-green { background: var(--green-soft); color: var(--green); }
.kpi-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.kpi-value { font-size: 28px; font-weight: 750; line-height: 1.15; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12px; color: var(--muted); }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.dash-main, .dash-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

.queue { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.queue-item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--border); border-left: 3px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); }
.queue-item.prio-2 { border-left-color: #f59e0b; }
.queue-item.prio-3 { border-left-color: #ef4444; background: #fffafa; }
.queue-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.queue-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.queue-meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.queue-note { font-style: italic; color: var(--text-2); }
.queue-side { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.consulta-side .queue-item { flex-direction: column; align-items: stretch; gap: 10px; }
.consulta-side .queue-side { justify-content: space-between; }
.consulta-side .queue-side form:first-child { flex: 1; }
.consulta-side .queue-side form:first-child .btn { width: 100%; }

.funnel-bars { display: flex; flex-direction: column; gap: 8px; }
.funnel-row { display: grid; grid-template-columns: 160px minmax(0, 1fr) 36px; align-items: center; gap: 12px; color: inherit; padding: 3px 0; text-decoration: none !important; }
.funnel-label { font-size: 13px; color: var(--text-2); font-weight: 550; }
.funnel-track { height: 12px; background: var(--gray-soft); border-radius: 999px; overflow: hidden; }
.funnel-fill { display: block; height: 100%; border-radius: 999px; min-width: 0; transition: width .4s; }
.funnel-count { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.funnel-row:hover .funnel-label { color: var(--brand); }

/* relógio */
.clock-card { display: flex; flex-direction: column; gap: 16px; }
.clock-wrap { display: flex; align-items: center; gap: 16px; }
.clock-wrap-col { flex-direction: column; }
.clock-digital { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.clock-digital.center { align-items: center; }
.clock-digital .js-date { font-size: 12.5px; display: block; }
.digital-time-lg { font-size: 26px; font-weight: 750; font-variant-numeric: tabular-nums; color: var(--brand); letter-spacing: .01em; }
.analog-clock { display: block; flex-shrink: 0; }
.clock-face { fill: var(--surface-2); stroke: var(--brand); stroke-width: 4; }
.clock-tick { stroke: var(--border-strong); stroke-width: 1.5; stroke-linecap: round; }
.clock-tick.major { stroke: var(--brand); stroke-width: 3; }
.clock-num { font-size: 15px; font-weight: 700; fill: var(--brand); text-anchor: middle; font-family: var(--font); }
.clock-hand { stroke-linecap: round; transform-origin: 100px 100px; }
.clock-hand.hour { stroke: var(--brand); stroke-width: 6; }
.clock-hand.minute { stroke: var(--brand-600); stroke-width: 4; }
.clock-hand.second { stroke: var(--accent); stroke-width: 2; }
.clock-center { fill: var(--accent); stroke: var(--brand); stroke-width: 2; }

/* mini calendário */
.minical-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.minical table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.minical th { font-size: 11px; color: var(--muted); font-weight: 700; padding: 4px 0; }
.minical td { text-align: center; padding: 2px 0; }
.minical td a { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-size: 12.5px; color: var(--text); font-variant-numeric: tabular-nums; position: relative; text-decoration: none !important; }
.minical td a:hover { background: var(--gray-soft); }
.minical td a.other { color: #b4bccb; }
.minical td a.today { background: var(--brand); color: #fff; font-weight: 700; }
.minical td a.has-event::after { content: ""; position: absolute; bottom: 3px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }

/* lista de agenda */
.agenda-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.agenda-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.agenda-list li:last-child { border-bottom: 0; }
.agenda-list li.clickable { cursor: pointer; border-radius: 6px; }
.agenda-list li.clickable:hover { background: var(--surface-2); }
.agenda-date { width: 44px; height: 46px; border-radius: 10px; background: var(--brand-50); color: var(--brand); display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; line-height: 1.1; }
.agenda-date strong { font-size: 17px; }
.agenda-date span { font-size: 11px; text-transform: uppercase; font-weight: 600; }
.agenda-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.agenda-info strong { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kind-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.kind-dot.kind-reuniao { background: var(--brand-600); }
.kind-dot.kind-ligacao { background: #22c55e; }
.kind-dot.kind-retorno { background: #f59e0b; }
.kind-dot.kind-outro { background: #94a3b8; }

/* timeline */
.timeline { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.timeline li { display: flex; gap: 10px; font-size: 13px; line-height: 1.45; }
.timeline-icon { width: 26px; height: 26px; border-radius: 50%; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; flex-shrink: 0; }
.timeline-lg li { padding-bottom: 12px; border-bottom: 1px dashed var(--border); }
.timeline-lg li:last-child { border-bottom: 0; padding-bottom: 0; }
.timeline-text { margin: 4px 0; color: var(--text-2); white-space: pre-line; }
.timeline .kind-etapa .timeline-icon { background: var(--purple-soft); color: var(--purple); }
.timeline .kind-sistema .timeline-icon { background: var(--accent-soft); color: #8a6a1f; }
.timeline .kind-ligacao .timeline-icon, .timeline .kind-whatsapp .timeline-icon { background: var(--green-soft); color: var(--green); }
.outcome { font-weight: 600; }
.outcome-atendeu, .outcome-interessado { color: var(--green); }
.outcome-nao_atendeu, .outcome-caixa_postal, .outcome-sem_retorno, .outcome-pediu_retorno { color: var(--amber); }
.outcome-numero_invalido, .outcome-sem_interesse { color: var(--red); }

/* ==========================================================================
   Funil (kanban)
   ========================================================================== */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.kanban-col { background: #eceff5; border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - 210px); min-height: 260px; }
.kanban-head { padding: 12px 14px 10px; border-top: 3px solid transparent; border-radius: var(--radius) var(--radius) 0 0; display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.kanban-head h3 { font-size: 13.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.kanban-head p { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.kanban-count { background: var(--surface); color: var(--text-2); border-radius: 999px; padding: 0 8px; font-size: 12px; line-height: 20px; }
.kanban-total { font-size: 11.5px; font-weight: 700; color: var(--text-2); white-space: nowrap; }
.kanban-list { flex: 1; overflow-y: auto; padding: 4px 10px 12px; display: flex; flex-direction: column; gap: 8px; border-radius: 0 0 var(--radius) var(--radius); transition: background .15s; }
.kanban-list.drag-over { background: rgba(31, 79, 143, .08); outline: 2px dashed var(--brand-600); outline-offset: -6px; }
.kanban-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 11px 12px; box-shadow: var(--shadow); cursor: grab; display: flex; flex-direction: column; gap: 6px; }
.kanban-card:hover { border-color: var(--border-strong); }
.kanban-card.dragging { opacity: .45; cursor: grabbing; }
.kanban-card-title { font-weight: 650; color: var(--text); font-size: 13.5px; }
.kanban-value { font-weight: 700; color: var(--brand); font-size: 13px; font-variant-numeric: tabular-nums; }
.kanban-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.kanban-meta .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.kanban-empty { display: none; text-align: center; color: var(--muted); font-size: 12px; padding: 20px 6px; border: 1px dashed var(--border-strong); border-radius: 10px; }
.kanban-list:not(:has(.kanban-card:not([hidden]))) .kanban-empty { display: block; }

/* ==========================================================================
   Diálogos
   ========================================================================== */
.dialog { border: 0; padding: 0; border-radius: 14px; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 40px); box-shadow: var(--shadow-lg); color: var(--text); }
.dialog-lg { width: min(780px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(11, 33, 64, .45); backdrop-filter: blur(2px); }
.dialog form { display: flex; flex-direction: column; max-height: calc(100vh - 40px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.dialog-head h2 { font-size: 17px; }
.dialog-body { padding: 20px 22px; overflow-y: auto; }
.dialog-foot { display: flex; gap: 10px; justify-content: flex-end; align-items: center; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); }

/* ==========================================================================
   Agenda
   ========================================================================== */
.agenda-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.agenda-side { display: flex; flex-direction: column; gap: 20px; }
.cal-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-title { font-size: 18px; font-weight: 700; min-width: 190px; text-align: center; text-transform: capitalize; }
.cal-grid-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-grid-head div { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; padding: 6px 8px; letter-spacing: .05em; }
.cal-grid { border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.cal-day { min-height: 108px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 6px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; min-width: 0; transition: background .12s; }
.cal-day:hover { background: var(--surface-2); }
.cal-day.other { background: #fafbfd; }
.cal-day.other .cal-num { color: #b4bccb; }
.cal-day.selected { background: var(--accent-soft); }
.cal-num { font-size: 12.5px; font-weight: 600; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; font-variant-numeric: tabular-nums; }
.cal-day.today .cal-num { background: var(--brand); color: #fff; }
.cal-ev { font-size: 11.5px; padding: 2px 6px; border-radius: 5px; background: var(--brand-50); color: var(--brand); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid var(--brand-600); cursor: pointer; }
.cal-ev.kind-ligacao { background: var(--green-soft); color: #14532d; border-left-color: #22c55e; }
.cal-ev.kind-retorno { background: var(--amber-soft); color: #78350f; border-left-color: #f59e0b; }
.cal-ev.kind-outro { background: var(--gray-soft); color: var(--gray); border-left-color: #94a3b8; }
.cal-ev:hover { filter: brightness(.96); }
.cal-more { font-size: 11px; color: var(--muted); padding-left: 4px; }
.cal-legend { display: flex; gap: 16px; margin-top: 12px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }

/* ==========================================================================
   Lead (detalhe)
   ========================================================================== */
.stage-stepper { display: flex; gap: 4px; margin-bottom: 18px; overflow-x: auto; padding-bottom: 2px; }
.step {
  flex: 1; min-width: 120px; border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  font: inherit; font-size: 12.5px; font-weight: 600; padding: 9px 10px; cursor: pointer; white-space: nowrap;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%);
  transition: background .15s, color .15s;
}
.step:first-child { clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); border-radius: 8px 0 0 8px; }
.step:hover { background: var(--surface-2); color: var(--text); }
.step.current { background: var(--brand); color: #fff; border-color: var(--brand); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.detail-main, .detail-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.dl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 22px; margin: 0; }
.dl-grid dt, .dl-inline dt { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 2px; }
.dl-grid dd, .dl-inline dd { margin: 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.note-box { margin-top: 16px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--accent-soft); color: #5c4714; font-size: 13.5px; white-space: pre-line; display: flex; gap: 8px; align-items: flex-start; }
.list-plain { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.list-plain li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.danger-zone { display: flex; justify-content: flex-end; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-block; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border-strong); font-size: 12.5px; font-weight: 600; color: var(--text-2); background: var(--surface); }
.seg input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid var(--brand-100); }

/* ==========================================================================
   Consultas
   ========================================================================== */
.consulta-layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 20px; align-items: start; }
.consulta-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.type-tabs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; background: var(--surface-2); padding: 5px; border-radius: 10px; border: 1px solid var(--border); }
.type-tab { cursor: pointer; }
.type-tab input { position: absolute; opacity: 0; pointer-events: none; }
.type-tab span { display: block; text-align: center; padding: 8px 6px; border-radius: 7px; font-weight: 650; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.type-tab input:checked + span { background: var(--surface); color: var(--brand); box-shadow: var(--shadow); }
.type-tab input:focus-visible + span { outline: 3px solid var(--brand-100); }
.mode-pick { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-pick legend { font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.mode-opt { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); cursor: pointer; }
.mode-opt:has(input:checked) { border-color: var(--brand-600); background: var(--brand-50); }
.mode-opt input { margin-top: 3px; }
.mode-opt span { display: flex; flex-direction: column; }
.mode-opt small { color: var(--muted); font-size: 12px; }
.abr, .queue-opts { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.abr summary, .queue-opts summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.queue-opts[open] summary { margin-bottom: 12px; }
.abr-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.abr-list label { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border: 1px solid var(--border); border-radius: 6px; font-size: 12.5px; cursor: pointer; }
.abr-list label:has(input:checked) { background: var(--brand-50); border-color: var(--brand-600); }
.list-rows { list-style: none; padding: 0; margin: 0; }
.list-rows li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.list-rows li:last-child { border-bottom: 0; }
.list-rows a { flex: 1; min-width: 0; display: flex; flex-direction: column; color: var(--text); text-decoration: none !important; }
.list-rows a:hover strong { color: var(--brand-600); }
.list-rows strong { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.consulta-meta { margin-bottom: 16px; }
.dl-inline { display: flex; flex-wrap: wrap; gap: 14px 32px; margin: 0; }
.center-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 36px 20px; margin-bottom: 16px; }
.center-card p { max-width: 520px; }
.error-text { color: var(--red); font-size: 13.5px; max-width: 640px; word-break: break-word; }
.spinner { width: 38px; height: 38px; border-radius: 50%; border: 4px solid var(--brand-100); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.result-summary { display: flex; gap: 12px; align-items: stretch; margin: 16px 0; flex-wrap: wrap; }
.result-summary > div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 18px; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.result-summary > div strong { font-size: 20px; font-weight: 750; font-variant-numeric: tabular-nums; }
.result-summary > div span { font-size: 12px; color: var(--muted); }
.result-summary-action { margin-left: auto; display: flex; align-items: center; }
.process-card { margin-bottom: 14px; }
.process-head { display: flex; gap: 14px; align-items: flex-start; }
.process-check { padding-top: 3px; cursor: pointer; }
.process-check input { width: 17px; height: 17px; }
.process-title { flex: 1; min-width: 0; }
.process-title h3 { font-size: 15px; }
.process-title p { font-size: 13px; margin-top: 2px; }
.process-value { text-align: right; display: flex; flex-direction: column; }
.process-value strong { font-size: 17px; color: var(--brand); font-variant-numeric: tabular-nums; }
.process-facts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 12px 0; }
.polo { font-size: 12.5px; }
.polo-ativo { color: var(--green); font-weight: 600; }
.polo-passivo { color: var(--muted); }
.lawyers { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.docs-list { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.docs-list h4 { font-size: 13px; display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.docs-list ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.sticky-bar { position: sticky; bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 14px; background: var(--brand-900); color: #fff; padding: 10px 12px 10px 20px; border-radius: 12px; box-shadow: var(--shadow-lg); margin-top: 10px; z-index: 5; }
.sticky-bar .btn-primary { background: var(--accent); color: var(--brand-900); }
.sticky-bar .btn-primary:hover { background: #d7b462; }

/* pré-salvos */
.saved-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.saved-card { display: flex; flex-direction: column; gap: 6px; color: inherit; text-decoration: none !important; transition: border-color .15s, transform .15s; }
.saved-card:hover { border-color: var(--brand-600); transform: translateY(-1px); }
.saved-head { display: flex; gap: 6px; align-items: center; }
.saved-card h3 { font-size: 15px; margin-top: 4px; }
.saved-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 6px; padding: 10px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.saved-stats div { display: flex; flex-direction: column; }
.saved-stats strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.saved-stats span { font-size: 11.5px; color: var(--muted); }
.saved-foot { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* usuários */
.inline-form { display: flex; align-items: center; gap: 12px; }
.inline-form select { width: auto; min-width: 130px; }
.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--border-strong); border-radius: 999px; cursor: pointer; transition: background .15s; }
.switch span::before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::before { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 3px solid var(--brand-100); }

/* erro */
.error-page { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.error-card { max-width: 440px; width: 100%; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 36px 28px; }
.error-card .login-logo { align-self: center; }
.error-code { font-size: 13px; font-weight: 700; color: var(--accent); letter-spacing: .1em; }

/* ==========================================================================
   Responsivo
   ========================================================================== */
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .consulta-layout { grid-template-columns: minmax(0, 1fr) 340px; }
  .type-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .dash-grid, .agenda-layout, .detail-grid, .consulta-layout { grid-template-columns: minmax(0, 1fr); }
  .dash-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
}
@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .sidebar { transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(11, 33, 64, .4); z-index: 30; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 16px 16px 0; }
  .content { padding: 16px 16px 32px; }
  .flashes { padding: 12px 16px 0; }
}
@media (max-width: 640px) {
  .kpis { grid-template-columns: minmax(0, 1fr); }
  .form-grid, .dl-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span-2, .dl-grid .span-2 { grid-column: auto; }
  .mode-pick { grid-template-columns: 1fr; }
  .type-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .queue-item { flex-direction: column; align-items: stretch; }
  .queue-side { justify-content: space-between; }
  .funnel-row { grid-template-columns: 110px minmax(0, 1fr) 30px; }
  .cal-day { min-height: 64px; }
  .cal-ev { font-size: 0; padding: 0; height: 6px; border-left-width: 0; }
  .process-head { flex-wrap: wrap; }
  .process-value { text-align: left; }
  .result-summary-action { margin-left: 0; width: 100%; }
  .result-summary-action .btn { width: 100%; }
  .toolbar select { min-width: 0; width: 100%; }
  .toolbar-group { width: 100%; }
  .toolbar-group > * { flex: 1; }
  .clock-wrap { flex-direction: column; }
}

/* ajustes de tabela */
.truncate { max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table .cell-person { min-width: 210px; }

/* ==========================================================================
   Andamentos processuais
   ========================================================================== */
.nav-badge-blue { background: var(--brand-600); }
.text-red { color: var(--red); }
.tone-red { background: var(--red-soft); color: var(--red); }
.kpis:has(.kpi-wide) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2fr); }
.kpi-value-sm { font-size: 20px; }

.tabs { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--border); margin: -4px 0 14px; flex-wrap: wrap; }
.tab { padding: 9px 12px; font-weight: 600; font-size: 13.5px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none !important; display: inline-flex; gap: 6px; align-items: center; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab-count { background: var(--gray-soft); color: var(--text-2); border-radius: 999px; padding: 0 7px; font-size: 11.5px; line-height: 18px; }
.tab.active .tab-count { background: var(--brand-50); color: var(--brand); }
.tab-search { padding-bottom: 6px; }
.tab-search .search-box { min-width: 220px; }
.tab-search input { height: 34px; padding-top: 6px; padding-bottom: 6px; }

.feed-actions { display: flex; justify-content: flex-end; margin-bottom: 4px; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed-day { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 14px 0 6px; border-bottom: 1px solid var(--border); }
.feed-item { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0 12px 12px; border-bottom: 1px solid var(--border); border-left: 3px solid transparent; }
.feed-item:last-child { border-bottom: 0; }
.feed-item.is-new { border-left-color: var(--brand-600); background: linear-gradient(90deg, var(--brand-50), transparent 60%); }
.feed-main { flex: 1; min-width: 0; }
.feed-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.feed-head .mono { font-weight: 600; }
.feed-lead { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); font-weight: 600; }
.feed-text { margin-top: 4px; color: var(--text); font-size: 13.5px; white-space: pre-line; }
.feed-doc { margin-top: 6px; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 3px 8px; }
.feed-compact .feed-item { padding-top: 9px; padding-bottom: 9px; }
.feed-compact .feed-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.process-timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.process-timeline::before { content: ""; position: absolute; left: 92px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.process-timeline li { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 26px; padding: 8px 0; position: relative; }
.process-timeline li::before { content: ""; position: absolute; left: 87px; top: 14px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-strong); }
.process-timeline li.is-new::before { background: var(--brand-600); border-color: var(--brand-600); box-shadow: 0 0 0 3px var(--brand-100); }
.pt-date { font-size: 12.5px; font-weight: 700; color: var(--text-2); text-align: right; padding-top: 2px; font-variant-numeric: tabular-nums; }
.pt-body p { font-size: 13.5px; margin-bottom: 2px; }
.process-timeline.compact li { padding: 5px 0; }
.process-timeline.compact .pt-body p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.monitor-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.monitor-cta { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); }
.steps { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; color: var(--text-2); }
.process-value form { margin-top: 6px; }
.process-value .badge { margin-top: 6px; align-self: flex-end; text-decoration: none; }

@media (max-width: 1100px) { .kpis:has(.kpi-wide) { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi-wide { grid-column: span 2; } }
@media (max-width: 640px) {
  .kpis:has(.kpi-wide) { grid-template-columns: minmax(0, 1fr); } .kpi-wide { grid-column: auto; }
  .process-timeline::before { left: 6px; }
  .process-timeline li { grid-template-columns: minmax(0, 1fr); gap: 2px; padding-left: 24px; }
  .process-timeline li::before { left: 1px; }
  .pt-date { text-align: left; }
  .tab-search, .tab-search .search-box { width: 100%; min-width: 0; }
  .process-value .badge { align-self: flex-start; }
}
.table .mono { white-space: nowrap; }
