/* CheckSinco — component styles. Depends only on tokens.css (CSS custom properties). Prefix: cs- */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@500&display=swap");

.cs, .cs * { box-sizing: border-box; }
.cs { font-family: var(--font-sans); font-size: 14px; line-height: 20px; color: var(--ink); background: var(--surface-50); -webkit-font-smoothing: antialiased; }
.cs-mono { font-family: var(--font-mono); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.cs-muted { color: var(--ink-muted); }
.cs-icon { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
:where(.cs) :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- Button ---------- */
.cs-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); height: var(--control-height); padding: 0 var(--space-4); border-radius: var(--radius-md); border: 1px solid var(--line-strong); background: var(--surface-0); color: var(--ink); font: 600 14px/20px var(--font-sans); cursor: pointer; white-space: nowrap; }
.cs-btn:hover { background: var(--surface-100); }
.cs-btn--primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.cs-btn--primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.cs-btn--ghost { border-color: transparent; background: transparent; }
.cs-btn--danger { color: var(--danger); }
.cs-btn--sm { height: 28px; padding: 0 var(--space-3); font-size: 13px; }
.cs-btn--icon { width: var(--control-height); padding: 0; }
.cs-btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Field ---------- */
.cs-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cs-field__label { font-weight: 600; font-size: 13px; line-height: 16px; }
.cs-field__label .cs-req { color: var(--danger); margin-left: 2px; }
.cs-input { height: var(--control-height); width: 100%; padding: 0 var(--space-3); border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--surface-0); color: var(--ink); font: 400 14px/20px var(--font-sans); }
.cs-input::placeholder { color: var(--ink-muted); }
.cs-input--mono { font-family: var(--font-mono); font-size: 13px; font-variant-numeric: tabular-nums; }
.cs-input:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
.cs-field--error .cs-input { border-color: var(--danger); }
.cs-field__help { font-size: 12px; line-height: 16px; color: var(--ink-muted); }
.cs-field--error .cs-field__help { color: var(--danger); }
.cs-form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--space-4); }
.cs-form-grid .cs-span-2 { grid-column: span 2; }
.cs-phone { display: grid; grid-template-columns: 64px 1fr; gap: var(--space-2); }

/* ---------- Badge ---------- */
.cs-badge { display: inline-flex; align-items: center; gap: var(--space-1); height: 20px; padding: 0 var(--space-2); border-radius: var(--radius-sm); font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .02em; background: var(--surface-100); color: var(--ink-muted); white-space: nowrap; }
.cs-badge--new { background: var(--accent-soft); color: var(--ink); }
.cs-badge--new::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.cs-badge--ok { background: var(--success-soft); color: var(--success); }
.cs-badge--alert { background: var(--danger-soft); color: var(--danger); }
.cs-badge--warn { background: var(--warning-soft); color: var(--warning); }
.cs-badge--info { background: var(--info-soft); color: var(--info); }
.cs-pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 var(--space-3); border-radius: var(--radius-pill); font-size: 13px; font-weight: 600; text-decoration: none; }
.cs-pill--alert { background: var(--danger-soft); color: var(--danger); }
.cs-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.cs-dot--credito { background: var(--cat-credito); } .cs-dot--localizacao { background: var(--cat-localizacao); }
.cs-dot--veicular { background: var(--cat-veicular); } .cs-dot--imoveis { background: var(--cat-imoveis); }

/* ---------- TopBar ---------- */
.cs-topbar { height: var(--topbar-height); display: flex; align-items: center; gap: var(--space-4); padding: 0 var(--space-4); background: var(--surface-0); border-bottom: 1px solid var(--line); }
.cs-wordmark { font-weight: 600; font-size: 18px; letter-spacing: -.01em; color: var(--ink); text-decoration: none; display: flex; align-items: baseline; }
.cs-wordmark b { color: var(--brand); font-weight: 600; }
.cs-topbar__spacer { flex: 1; }
.cs-topbar__contact { display: flex; align-items: center; gap: var(--space-4); font-size: 13px; }
.cs-topbar__contact a { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-muted); text-decoration: none; }
.cs-topbar__contact a:hover { color: var(--ink); text-decoration: underline; }
.cs-topbar__contact .cs-wa { color: var(--success); font-weight: 600; }
.cs-topbar__contact .cs-wa:hover { color: var(--success); }
button.cs-pill { border: 0; font-family: var(--font-sans); cursor: pointer; }
.cs-user { display: flex; align-items: center; gap: var(--space-2); padding: 4px var(--space-2) 4px 4px; border-radius: var(--radius-pill); border: 1px solid var(--line); background: var(--surface-0); color: var(--ink); font: 600 13px/20px var(--font-sans); cursor: pointer; }
.cs-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-strong); display: grid; place-items: center; font-size: 12px; font-weight: 600; }

/* ---------- AccountMenu ---------- */
.cs-menu { width: 280px; background: var(--surface-0); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); padding: var(--space-2); }
.cs-menu__head { padding: var(--space-2) var(--space-3) var(--space-3); border-bottom: 1px solid var(--line); margin-bottom: var(--space-2); }
.cs-menu__label { padding: var(--space-2) var(--space-3) var(--space-1); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); }
.cs-menu__item { display: flex; align-items: center; gap: var(--space-2); width: 100%; padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); color: var(--ink); text-decoration: none; background: none; border: 0; font: 400 14px/20px var(--font-sans); cursor: pointer; text-align: left; }
.cs-menu__item:hover { background: var(--surface-100); }
.cs-menu__item .cs-badge, .cs-menu__item .cs-pill { margin-left: auto; }
.cs-menu__sep { height: 1px; background: var(--line); margin: var(--space-2) 0; }

.cs-boletos { padding-bottom: var(--space-2); }
.cs-boleto { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); }
.cs-boleto:hover { background: var(--surface-100); }
.cs-boleto__info { flex: 1; min-width: 0; }
.cs-boleto__top { display: flex; align-items: center; gap: var(--space-2); }
.cs-boleto__ref { font-weight: 600; }
.cs-boleto__meta { font-size: 12px; line-height: 18px; color: var(--ink-muted); }
.cs-boleto__actions { display: flex; gap: var(--space-1); }
.cs-boletos .cs-boleto + .cs-boleto { border-top: 1px solid var(--line); border-radius: 0; }

/* ---------- ConsultaNav (sidebar) ---------- */
.cs-nav { width: var(--sidebar-width); display: flex; flex-direction: column; background: var(--surface-0); border-right: 1px solid var(--line); min-height: 0; }
.cs-nav__search { padding: var(--space-3); border-bottom: 1px solid var(--line); }
.cs-search { position: relative; display: block; }
.cs-search .cs-icon { position: absolute; left: 10px; top: 10px; color: var(--ink-muted); }
.cs-search .cs-input { padding-left: 32px; padding-right: 44px; }
.cs-kbd { position: absolute; right: 8px; top: 8px; font: 500 11px/18px var(--font-mono); color: var(--ink-muted); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 5px; }
.cs-nav__scroll { overflow: auto; padding: var(--space-2) var(--space-2) var(--space-4); flex: 1; }
.cs-nav__group { margin-top: var(--space-2); }
.cs-nav__group > summary { list-style: none; display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-2); font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); cursor: pointer; border-radius: var(--radius-md); }
.cs-nav__group > summary::-webkit-details-marker { display: none; }
.cs-nav__group > summary:hover { background: var(--surface-100); }
.cs-nav__group > summary .cs-count { margin-left: auto; font-weight: 500; letter-spacing: 0; }
.cs-nav__group > summary .cs-chev { transition: transform .15s; }
.cs-nav__group[open] > summary .cs-chev { transform: rotate(90deg); }
.cs-nav__item { display: flex; align-items: center; gap: var(--space-2); height: 32px; padding: 0 var(--space-2) 0 var(--space-3); border-radius: var(--radius-md); color: var(--ink); text-decoration: none; font-size: 14px; cursor: pointer; }
.cs-nav__item:hover { background: var(--surface-100); }
.cs-nav__item[aria-current="page"] { background: var(--brand-soft); color: var(--brand-strong); font-weight: 600; }
.cs-nav__item .cs-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-star { width: 24px; height: 24px; display: grid; place-items: center; border: 0; background: none; color: var(--ink-muted); border-radius: var(--radius-sm); cursor: pointer; opacity: 0; }
.cs-nav__item:hover .cs-star, .cs-star.is-on { opacity: 1; }
.cs-star.is-on { color: var(--accent); }
.cs-star.is-on .cs-icon { fill: currentColor; }
.cs-nav__hint { margin: 0; padding: var(--space-1) var(--space-3) var(--space-2); font-size: 12px; line-height: 18px; color: var(--ink-muted); }
.cs-nav__hint .cs-icon { width: 12px; height: 12px; vertical-align: -1px; color: var(--accent); }
.cs-nav__empty { padding: var(--space-4) var(--space-3); color: var(--ink-muted); font-size: 13px; }

/* ---------- Breadcrumb (onde estou) ---------- */
.cs-crumb { display: flex; align-items: center; gap: var(--space-2); height: 44px; padding: 0 var(--space-6); border-bottom: 1px solid var(--line); background: var(--surface-0); font-size: 13px; color: var(--ink-muted); }
.cs-crumb a { color: var(--brand); text-decoration: none; font-weight: 500; }
.cs-crumb a:hover { text-decoration: underline; }
.cs-crumb .cs-icon { width: 12px; height: 12px; }
.cs-crumb [aria-current="page"] { color: var(--ink); font-weight: 600; }

/* ---------- Panel (workspace de consulta) ---------- */
.cs-panel { animation: cs-enter .15s ease-out; background: var(--surface-0); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.cs-panel__head { display: flex; align-items: flex-start; gap: var(--space-4); padding: var(--space-4) var(--space-6); border-bottom: 1px solid var(--line); }
.cs-panel__title { margin: 0; font-size: 20px; line-height: 28px; font-weight: 600; }
.cs-panel__meta { display: flex; align-items: center; gap: var(--space-2); margin-top: 2px; font-size: 12px; line-height: 16px; color: var(--ink-muted); }
.cs-panel__body { padding: var(--space-6); }
.cs-panel__actions { display: flex; gap: var(--space-2); align-items: center; margin-top: var(--space-6); padding-top: var(--space-4); border-top: 1px solid var(--line); }
.cs-section-title { margin: 0 0 var(--space-4); font-size: 16px; line-height: 24px; font-weight: 600; }

/* ---------- Alert ---------- */
.cs-alert { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg); border: 1px solid transparent; }
.cs-alert .cs-icon { margin-top: 2px; }
.cs-alert__title { font-weight: 600; }
.cs-alert__text { color: var(--ink); }
.cs-alert__actions { margin-left: auto; display: flex; gap: var(--space-2); flex: none; }
.cs-alert--warn { background: var(--warning-soft); border-color: var(--warning-soft); }
.cs-alert--warn > .cs-icon { color: var(--warning); }
.cs-alert--danger { background: var(--danger-soft); }
.cs-alert--danger > .cs-icon { color: var(--danger); }
.cs-alert--info { background: var(--info-soft); }
.cs-alert--info > .cs-icon { color: var(--info); }

/* ---------- Shell ---------- */
.cs-shell { display: grid; grid-template-rows: var(--topbar-height) 1fr; height: 100%; min-height: 0; }
.cs-shell__main { display: grid; grid-template-columns: var(--sidebar-width) 1fr; min-height: 0; }
.cs-workspace { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.cs-workspace__scroll { overflow: auto; padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); }

/* ---------- Mobile sheet ---------- */
.cs-sheet { position: absolute; inset: auto 0 0 0; top: 24px; background: var(--surface-0); border-radius: var(--radius-lg) var(--radius-lg) 0 0; box-shadow: var(--shadow-pop); display: flex; flex-direction: column; }
.cs-sheet__grip { width: 36px; height: 4px; border-radius: var(--radius-pill); background: var(--line-strong); margin: var(--space-2) auto 0; }
.cs-sheet__head { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-4) var(--space-3); border-bottom: 1px solid var(--line); }
.cs-sheet__body { padding: var(--space-4); overflow: auto; flex: 1; display: flex; flex-direction: column; gap: var(--space-4); }
.cs-sheet__foot { padding: var(--space-3) var(--space-4); border-top: 1px solid var(--line); }
.cs-sheet__foot .cs-btn { width: 100%; }

@media (max-width: 1023px) {
  .cs-shell__main { grid-template-columns: 1fr; }
}

@keyframes cs-enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .cs-panel { animation: none; } }
