:root {
  --f: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #f6f7f4;
  --surface: #fff;
  --text: #101112;
  --muted: #737a76;
  --line: #e3e6e1;
  --line-strong: #d3d8d3;
  --dark: #0b1015;
  --dark-2: #17212a;
  --accent: #2f75b8;
  --bad: #b94a42;
  --warn: #9a721c;
  --ok: #26744b;
  --shadow: 0 14px 40px rgba(20, 27, 24, .07);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); font-family: var(--f); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(47, 117, 184, .25); outline-offset: 2px; }
.hidden { display: none !important; }

/* Login canônico */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.16fr .84fr; background: var(--surface); }
.login-visual { min-width: 0; position: relative; overflow: hidden; display: grid; grid-template-rows: minmax(235px, .9fr) auto auto; padding: 34px 5vw 38px; background: linear-gradient(135deg, #fbfbfa, #f2f3f0); }
.login-logo { min-height: 235px; display: flex; align-items: center; justify-content: center; position: relative; z-index: 2; overflow: hidden; }
.login-logo-static { display: block; width: min(100%, 680px); max-height: 220px; object-fit: contain; }
.login-hero { position: relative; z-index: 2; max-width: 760px; padding: 26px 0 70px; }
.kick, .eye { color: #828984; font-size: 9px; font-weight: 760; letter-spacing: .11em; text-transform: uppercase; }
.login-hero .kick { margin-bottom: 18px; font-size: 10px; letter-spacing: .16em; }
.login-hero h1 { margin: 0 0 24px; font-size: clamp(50px, 6vw, 84px); font-weight: 650; letter-spacing: -.06em; line-height: .94; }
.login-hero p { max-width: 650px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.72; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
.chip, .badge { padding: 6px 9px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: #626864; font-size: 9px; font-weight: 700; }
.login-foot { position: relative; z-index: 2; color: #939a95; font-size: 10px; line-height: 1.55; }
.orb { position: absolute; border-radius: 50%; pointer-events: none; animation: float 14s ease-in-out infinite; }
.orb-a { width: 420px; height: 420px; right: -70px; top: 18%; background: radial-gradient(circle, rgba(198, 210, 221, .55), transparent 72%); }
.orb-b { width: 260px; height: 260px; left: 40%; bottom: -110px; background: radial-gradient(circle, rgba(222, 223, 220, .5), transparent 74%); animation-duration: 18s; }
@keyframes float { 50% { transform: translate(-16px, 14px) scale(1.02); } }

.auth { min-width: 0; display: grid; place-items: center; padding: 54px clamp(30px, 6vw, 86px); background: linear-gradient(155deg, #0b1015, #091018); color: #fff; }
.auth-card { width: min(440px, 100%); }
.auth-card h2 { margin: 10px 0 12px; font-size: clamp(32px, 3vw, 42px); font-weight: 620; letter-spacing: -.04em; line-height: 1.02; }
.auth-card > p { margin: 0 0 26px; color: #96a0a4; font-size: 12px; line-height: 1.65; }
.auth-card label { display: block; margin: 17px 0; color: #b8c0c4; font-size: 10px; font-weight: 700; }
.auth-card input { display: block; width: 100%; height: 50px; margin-top: 7px; padding: 0 14px; border: 1px solid #2a343d; border-radius: 14px; background: #131920; color: #fff; }
.auth-card input::placeholder { color: #647078; }
.oauth { display: grid; gap: 8px; }
.google-signin { min-height: 44px; display: grid; place-items: center; overflow: hidden; }
.oauth-button { width: 100%; min-height: 46px; display: grid; grid-template-columns: 24px 1fr 24px; align-items: center; border: 1px solid #2a343d; border-radius: 14px; background: #111820; color: #e4e8e9; cursor: pointer; font-size: 10px; font-weight: 700; }
.oauth-button::after { content: "↗"; color: #66747d; }
.oauth-button:hover { border-color: #52616b; background: #151e27; }
.provider-symbol { width: 24px; height: 24px; display: grid; place-items: center; margin-left: 10px; border-radius: 50%; background: #f4f5f3; color: #182027; font-size: 10px; font-weight: 800; }
.provider-status { min-height: 14px; margin-top: 7px; color: #9fa8ad; font-size: 9px; }
.divider { display: flex; align-items: center; gap: 12px; margin: 17px 0 4px; color: #6f7a80; font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: #263038; }
.login-button { width: 100%; height: 50px; margin-top: 7px; border: 0; border-radius: 14px; background: #f5f5f3; color: #111; cursor: pointer; font-size: 10px; font-weight: 800; }
.login-button:hover { background: #fff; }
.form-status { min-height: 16px; margin-top: 12px; color: #f1a9a5; font-size: 10px; }
.auth-note { padding-top: 15px; border-top: 1px solid #242e35; color: #6f7a80; font-size: 8.5px; line-height: 1.5; }

/* Shell canônico */
.app { min-height: 100vh; display: grid; grid-template-columns: 240px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; min-height: 0; display: flex; flex-direction: column; overflow: hidden; padding: 24px 16px; background: linear-gradient(#0b1015, #0d1319); color: #fff; }
.sidebar-brand { min-height: 58px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; margin: 2px 8px 25px; padding: 5px 6px; background: #fff; }
.sidebar-brand-logo { display: block; width: 100%; max-width: 176px; height: auto; max-height: 56px; object-fit: contain; }
#nav { min-height: 0; overflow-y: auto; padding: 0 0 12px; scrollbar-width: none; }
#nav::-webkit-scrollbar { width: 0; }
.nav-group { margin: 15px 8px 6px; color: #667178; font-size: 8px; font-weight: 760; letter-spacing: .12em; text-transform: uppercase; }
.nav-item { width: 100%; min-height: 35px; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; color: #b8c0c3; cursor: pointer; text-align: left; font-size: 10.5px; font-weight: 650; }
.nav-item:hover, .nav-item.active { background: var(--dark-2); color: #fff; }
.nav-icon { width: 18px; height: 18px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid #3a4650; border-radius: 6px; color: #8d999f; font-size: 9px; line-height: 1; }
.nav-item.active .nav-icon { border-color: #61717c; color: #fff; }
.scope { flex: 0 0 auto; margin: auto 4px 0; padding: 11px 4px 0; border-top: 1px solid #202a31; background: #0d1319; color: #707a7f; font-size: 8.7px; line-height: 1.4; }
.scope-label { margin-bottom: 4px; color: #707a7f; font-size: 8px; font-weight: 760; letter-spacing: .1em; text-transform: uppercase; }
.scope b, .scope span { display: block; color: #cad1d3; overflow-wrap: anywhere; }
.scope span { color: #7d898f; }
.link-button { margin-top: 6px; padding: 4px 0; border: 0; background: none; color: #8fa7b8; cursor: pointer; font-size: 9px; }
.main { min-width: 0; }
.topbar { height: 66px; position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 32px; border-bottom: 1px solid var(--line); background: rgba(246, 247, 244, .9); backdrop-filter: blur(18px); }
.crumb { min-width: 0; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.company-picker { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 9px; font-weight: 700; }
.company-picker select { min-width: 132px; height: 34px; padding: 0 30px 0 10px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; color: #3e4541; font-size: 9px; }
.presence { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 9px; }
.status-dot, .dot { width: 7px; height: 7px; flex: 0 0 auto; display: inline-block; border-radius: 50%; background: var(--ok); }
.account { display: grid; justify-items: end; font-size: 9px; line-height: 1.35; }
.account b { color: #303632; }
.account span { color: #8b928e; }
.avatar { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; background: #fff; color: #4e5651; font-size: 10px; font-weight: 800; }
.content { width: 100%; max-width: 1800px; min-width: 0; margin: auto; padding: 36px 32px 60px; }

/* Hierarquia e componentes */
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.hero > div:first-child { min-width: 0; }
.hero h1 { margin: 4px 0; font-size: 40px; font-weight: 650; letter-spacing: -1.8px; line-height: .98; }
.copy { max-width: 760px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn { min-height: 36px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: #fff; color: #2e3431; cursor: pointer; font-size: 10px; font-weight: 750; }
.btn:hover { border-color: #aeb6b0; background: #fbfcfa; }
.btn.primary { border-color: #111; background: #111; color: #fff; }
.btn.primary:hover { background: #252a27; }
.btn:disabled, .step:disabled { cursor: not-allowed; opacity: .48; }
.metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px; margin-bottom: 18px; }
.metric { min-width: 0; min-height: 98px; padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.metric-label { color: #78807c; font-size: 9px; font-weight: 650; }
.metric-value { margin: 12px 0 4px; overflow-wrap: anywhere; font-size: 27px; font-weight: 650; letter-spacing: -.9px; }
.metric-note { color: #969c98; font-size: 8.5px; }
.metric.bad .metric-value { color: var(--bad); }
.metric.warn .metric-value { color: var(--warn); }
.metric.good .metric-value { color: var(--ok); }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, .75fr); gap: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stack { display: grid; align-content: start; gap: 12px; }
.card, .form-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.card-head { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 15px; border-bottom: 1px solid var(--line); }
.card-title { color: #202522; font-size: 11px; font-weight: 730; }
.card-sub { margin-top: 3px; color: #909692; font-size: 8.8px; }
.card-body { padding: 14px 15px; }
.notice { margin-bottom: 16px; padding: 11px 13px; border: 1px solid #dce7e4; border-radius: 14px; background: #eef3f2; color: #38433f; font-size: 10px; line-height: 1.55; }
.notice.error, .error { border-color: #efd7d4; background: #fbefee; color: var(--bad); }
.empty { padding: 25px; color: var(--muted); font-size: 10px; text-align: center; }
.table-wrap { max-width: 100%; max-height: 570px; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 9.7px; }
th { position: sticky; top: 0; z-index: 1; padding: 9px 10px; border-bottom: 1px solid var(--line); background: #fafaf8; color: #7c837f; font-size: 8.7px; font-weight: 700; text-align: left; white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid #ededeb; color: #515752; vertical-align: middle; }
td.title { color: #151817; font-weight: 650; }
tbody tr:last-child td { border-bottom: 0; }
.clickable-row { cursor: pointer; }
.clickable-row:hover td { background: #f6f9f7; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 999px; background: #eef3f2; color: #56615c; font-size: 8.8px; font-weight: 700; white-space: nowrap; }
.pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #8a9690; }
.pill.bad { background: #fbefee; color: var(--bad); }
.pill.bad::before { background: var(--bad); }
.pill.ok { background: #ecf5f0; color: var(--ok); }
.pill.ok::before { background: var(--ok); }
.steps { min-width: 330px; display: flex; gap: 4px; }
.step { flex: 1; padding: 6px 8px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: #626a65; cursor: pointer; font-size: 8px; white-space: nowrap; }
.step.current { border-color: #111; background: #111; color: #fff; }
.tabs { display: flex; gap: 5px; overflow: auto; padding: 10px 12px; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.tab { flex: 0 0 auto; padding: 7px 10px; border: 0; border-radius: 999px; background: transparent; color: #69706c; cursor: pointer; font-size: 9px; font-weight: 680; white-space: nowrap; }
.tab.active { background: #111; color: #fff; }
.fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.field { min-width: 0; }
.field label { display: block; margin: 0 0 5px 2px; color: #8a908b; font-size: 8.4px; font-weight: 700; text-transform: uppercase; }
.field input, .field select, .field textarea, textarea { width: 100%; min-width: 0; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; color: #363c38; font-size: 10px; }
.field input, .field select { height: 36px; padding: 0 10px; }
.field textarea, textarea { padding: 9px 10px; resize: vertical; }
.field.span2 { grid-column: span 2; }
.field.full { grid-column: 1 / -1; }
.section { padding: 16px; border-bottom: 1px solid var(--line); }
.section:last-child { border-bottom: 0; }
.section h3, .inline-form h3 { margin: 0 0 12px; font-size: 11px; }
.feed-item { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; padding: 11px 0; border-bottom: 1px solid #efefec; }
.feed-item:last-child { border-bottom: 0; }
.feed-title { color: #202522; font-size: 10px; font-weight: 650; }
.feed-meta { margin-top: 3px; color: #8d948f; font-size: 8.7px; line-height: 1.45; overflow-wrap: anywhere; }
.dot.read { background: #aab1ad; }
.modal-back { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; background: rgba(11, 15, 18, .35); backdrop-filter: blur(6px); }
.modal { width: min(760px, 94vw); padding: 24px; border-radius: 20px; background: #fafbf9; box-shadow: var(--shadow); }
.modal h2 { margin: 8px 0; font-size: 26px; }
.modal p { color: var(--muted); font-size: 11px; }
.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 110; width: min(360px, calc(100vw - 40px)); display: grid; gap: 8px; }
.toast { padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); color: #414844; font-size: 10px; }
.toast.error { border-color: #efd7d4; background: #fff8f7; }

@media (max-width: 1300px) {
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-main, .grid2 { grid-template-columns: minmax(0, 1fr); }
  .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field.span2 { grid-column: span 2; }
}

@media (max-width: 820px) {
  html, body { max-width: 100%; overflow-x: hidden; }
  .login { grid-template-columns: minmax(0, 1fr); }
  .login-visual { display: none; }
  .auth { min-height: 100vh; padding: 40px 22px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: relative; z-index: 40; height: auto; max-width: 100vw; display: flex; padding: 10px 12px; }
  .sidebar-brand { display: none; }
  #nav { display: flex; gap: 6px; overflow-x: auto; overflow-y: hidden; padding: 0 0 8px; }
  .nav-group { display: none; }
  .nav-item { width: auto; min-width: max-content; flex: 0 0 auto; min-height: 38px; }
  .scope { display: flex; align-items: center; gap: 7px; margin: 0; padding: 8px 2px 0; }
  .scope-label, .scope #user-profile { display: none; }
  .scope b, .scope span { display: inline; }
  .scope .link-button { margin: 0 0 0 auto; }
  .topbar { padding: 0 14px; }
  .content { max-width: 100vw; padding: 26px 14px 50px; }
  .hero { align-items: flex-start; flex-direction: column; }
  .hero h1 { font-size: 34px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid3, .fields { grid-template-columns: minmax(0, 1fr); }
  .field.span2 { grid-column: auto; }
  .account { display: none; }
  .company-picker > span, .presence > span:last-child { display: none; }
  .feed-item { grid-template-columns: auto minmax(0, 1fr); }
  .feed-item > :last-child { grid-column: 2; }
}

@media (max-width: 480px) {
  .metrics { grid-template-columns: minmax(0, 1fr); }
  .company-picker select { min-width: 100px; max-width: 128px; }
  .topbar-actions { gap: 8px; }
  .avatar { width: 28px; height: 28px; }
  .content { padding-inline: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
