/* CLICKBARBA v1.0.003 — Design system (mobile first)
   Carbono #101114 · Lima #C6FA36 · Grafite #22252A · Fundo claro #F5F6F8 · Branco #FFFFFF */

/* ---------- Tokens ---------- */
:root {
  --carbon: #101114; --graphite: #22252A; --lime: #C6FA36; --paper: #F5F6F8; --white: #FFFFFF;
  --brand: var(--lime); --on-brand: #101114;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px; --s16: 64px;
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 24px; --r-full: 999px;
  --font: Inter, Manrope, "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  --fs-xs: .75rem; --fs-sm: .875rem; --fs-md: 1rem; --fs-lg: 1.125rem; --fs-xl: 1.375rem; --fs-2xl: 1.75rem; --fs-3xl: clamp(2rem, 6vw, 3.5rem);
  --ease: cubic-bezier(.2,.8,.2,1); --t-fast: 120ms; --t-med: 220ms;
  --tap: 44px; --sidebar: 268px; --topbar: 60px; --bottomnav: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  --focus: 0 0 0 3px color-mix(in srgb, var(--brand) 55%, transparent);
}

/* Tema escuro (padrão) */
:root, [data-theme="dark"] {
  color-scheme: dark;
  --bg: #0C0D10; --bg-2: var(--carbon); --surface: #16181C; --surface-2: #1D2025; --surface-3: var(--graphite);
  --line: #2A2E35; --line-2: #353A42;
  --text: #F2F3F5; --text-2: #B7BCC5; --muted: #8A919C;
  --ok: #4ADE80; --ok-bg: rgba(74,222,128,.12); --warn: #FBBF24; --warn-bg: rgba(251,191,36,.12);
  --err: #F87171; --err-bg: rgba(248,113,113,.12); --info: #7DD3FC; --info-bg: rgba(125,211,252,.12);
  --shadow-1: 0 1px 2px rgba(0,0,0,.4); --shadow-2: 0 12px 32px rgba(0,0,0,.45); --shadow-3: 0 24px 64px rgba(0,0,0,.55);
  --accent-text: var(--brand); /* texto de destaque: marca sobre escuro */
}
[data-theme="light"] {
  color-scheme: light;
  --bg: var(--paper); --bg-2: #ECEEF1; --surface: var(--white); --surface-2: #F8F9FA; --surface-3: #EEF0F3;
  --line: #E3E6EA; --line-2: #D5D9DF;
  --text: #101114; --text-2: #3A3F47; --muted: #5E6570;
  --ok: #15803D; --ok-bg: #DCFCE7; --warn: #A16207; --warn-bg: #FEF3C7; --err: #B91C1C; --err-bg: #FEE2E2; --info: #0369A1; --info-bg: #E0F2FE;
  --shadow-1: 0 1px 2px rgba(16,17,20,.06); --shadow-2: 0 10px 30px rgba(16,17,20,.10); --shadow-3: 0 24px 60px rgba(16,17,20,.16);
  --accent-text: var(--carbon); /* nunca texto lima sobre branco */
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: var(--fs-md); line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; min-height: 100dvh; overflow-x: hidden; }
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.02em; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: var(--s4); top: -100px; z-index: 100; background: var(--brand); color: var(--on-brand); padding: var(--s3) var(--s4); border-radius: var(--r-md); font-weight: 700; }
.skip:focus { top: var(--s4); }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic-lg { width: 24px; height: 24px; }
.ic-sm { width: 16px; height: 16px; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.mono { font-family: var(--mono); font-size: .92em; }
.nowrap { white-space: nowrap; }
.mt-2 { margin-top: var(--s2); } .mt-4 { margin-top: var(--s4); } .mt-6 { margin-top: var(--s6); } .mt-8 { margin-top: var(--s8); }
.stack { display: flex; flex-direction: column; gap: var(--s4); }
.stack-sm { display: flex; flex-direction: column; gap: var(--s2); }
.row { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Marca ---------- */
.brandmark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; letter-spacing: -.04em; font-size: 1.15rem; color: var(--text); }
.brandmark .mark { width: 30px; height: 30px; }
.brandmark b { color: var(--accent-text); font-weight: 800; }
[data-theme="light"] .brandmark b { color: var(--text); background: linear-gradient(transparent 62%, var(--lime) 62%); padding: 0 1px; }
.mark-tile { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--carbon); }
.mark-tile .mark { width: 28px; height: 28px; }
.mark .m-ring { stroke: #fff; } .mark .m-blade { fill: var(--lime); } .mark .m-cut { stroke: var(--carbon); }
[data-theme="light"] .brandmark .mark .m-ring { stroke: var(--carbon); }
.tenant-logo { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; background: var(--surface-3); }

/* ---------- Botões ---------- */
.btn { --bg-b: var(--surface-2); --fg-b: var(--text); --bd-b: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: var(--tap); padding: 0 var(--s5);
  border-radius: var(--r-md); border: 1px solid var(--bd-b); background: var(--bg-b); color: var(--fg-b); font-weight: 650; font-size: var(--fs-sm);
  text-decoration: none; cursor: pointer; transition: transform var(--t-fast) var(--ease), background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast); white-space: nowrap; user-select: none; -webkit-tap-highlight-color: transparent; }
.btn:hover { border-color: var(--muted); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { --bg-b: var(--brand); --fg-b: var(--on-brand); --bd-b: var(--brand); box-shadow: 0 6px 20px color-mix(in srgb, var(--brand) 22%, transparent); }
.btn-primary:hover { --bg-b: color-mix(in srgb, var(--brand) 88%, #fff); border-color: var(--bg-b); }
.btn-ghost { --bg-b: transparent; --bd-b: transparent; }
.btn-ghost:hover { --bg-b: var(--surface-2); }
.btn-danger { --bg-b: var(--err-bg); --fg-b: var(--err); --bd-b: color-mix(in srgb, var(--err) 35%, transparent); }
.btn-block { width: 100%; }
.btn-lg { min-height: 52px; font-size: var(--fs-md); padding: 0 var(--s6); border-radius: var(--r-lg); }
.btn-sm { min-height: 36px; padding: 0 var(--s3); font-size: var(--fs-xs); }
.btn-icon { width: var(--tap); padding: 0; }
.btn[aria-busy="true"] { pointer-events: none; opacity: .75; }
.btn[aria-busy="true"]::after { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Formulários ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); }
.field .hint { font-size: var(--fs-xs); color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--text); font-size: 16px; /* evita zoom no iOS */
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast); }
.input::placeholder { color: var(--muted); }
.input:hover, .select:hover { border-color: var(--muted); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); background: var(--surface); }
.input[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--err); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 40px; }
.field-error { color: var(--err); font-size: var(--fs-xs); font-weight: 600; }
.input-group { position: relative; display: flex; align-items: stretch; }
.input-group .input { padding-right: 52px; }
.input-group .addon { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.prefix-input { display: flex; align-items: stretch; border: 1px solid var(--line-2); border-radius: var(--r-md); background: var(--surface-2); overflow: hidden; }
.prefix-input:focus-within { border-color: var(--brand); box-shadow: var(--focus); }
.prefix-input span { display: flex; align-items: center; padding: 0 0 0 14px; color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; }
.prefix-input .input { border: 0; background: transparent; box-shadow: none; padding-left: 2px; }
.grid-2, .grid-3 { display: grid; gap: var(--s4); grid-template-columns: 1fr; }
.check { display: flex; align-items: flex-start; gap: var(--s3); cursor: pointer; min-height: var(--tap); padding: var(--s2) 0; font-size: var(--fs-sm); color: var(--text-2); }
.check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--brand); flex: none; }
.switch { position: relative; display: inline-flex; align-items: center; gap: var(--s3); cursor: pointer; min-height: var(--tap); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 44px; height: 26px; border-radius: var(--r-full); background: var(--line-2); position: relative; transition: background var(--t-fast); flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform var(--t-med) var(--ease); box-shadow: var(--shadow-1); }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(18px); background: var(--carbon); }
.switch input:focus-visible + .track { box-shadow: var(--focus); }
.form-actions { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; }
.form-actions.sticky { position: sticky; bottom: calc(var(--bottomnav) + var(--safe-b)); background: linear-gradient(transparent, var(--bg) 30%); padding: var(--s6) 0 var(--s3); margin-top: var(--s4); z-index: 5; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; font-weight: 700; margin-bottom: var(--s3); }
.color-field { display: flex; gap: var(--s3); align-items: center; }
.color-field input[type="color"] { width: 56px; height: 48px; padding: 4px; border-radius: var(--r-md); border: 1px solid var(--line-2); background: var(--surface-2); cursor: pointer; }

/* ---------- Cartões e superfícies ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5); box-shadow: var(--shadow-1); min-width: 0; }
.card-pad-0 { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s4); }
.card-title { font-size: var(--fs-md); font-weight: 700; }
.card-link { display: block; text-decoration: none; transition: border-color var(--t-fast), transform var(--t-fast) var(--ease); }
.card-link:hover { border-color: var(--line-2); transform: translateY(-1px); }
.section-title { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin: var(--s6) 0 var(--s3); }
.divider { height: 1px; background: var(--line); border: 0; margin: var(--s5) 0; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--r-full); font-size: var(--fs-xs); font-weight: 700; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok); } .badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-err { background: var(--err-bg); color: var(--err); } .badge-info { background: var(--info-bg); color: var(--info); }
.badge-brand { background: color-mix(in srgb, var(--brand) 16%, transparent); color: var(--accent-text); }
.badge-soon { background: transparent; border: 1px dashed var(--line-2); color: var(--muted); height: 20px; font-size: 10px; padding: 0 7px; letter-spacing: .02em; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* ---------- Alertas / toasts ---------- */
.alert { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s4); border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-2); font-size: var(--fs-sm); }
.alert-success { background: var(--ok-bg); border-color: transparent; color: var(--ok); }
.alert-error { background: var(--err-bg); border-color: transparent; color: var(--err); }
.alert-warning { background: var(--warn-bg); border-color: transparent; color: var(--warn); }
.alert-info { background: var(--info-bg); border-color: transparent; color: var(--info); }
.alert > div { color: var(--text); }
.toasts { position: fixed; z-index: 80; left: var(--s4); right: var(--s4); bottom: calc(var(--bottomnav) + var(--safe-b) + var(--s3)); display: flex; flex-direction: column; gap: var(--s2); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: var(--s3); align-items: center; padding: 14px var(--s4); border-radius: var(--r-md); background: var(--surface-3); color: var(--text); border: 1px solid var(--line-2); box-shadow: var(--shadow-2); font-size: var(--fs-sm); animation: toast-in var(--t-med) var(--ease); }
.toast .ic { color: var(--brand); }
.toast-error .ic { color: var(--err); } .toast-warning .ic { color: var(--warn); } .toast-info .ic { color: var(--info); }
.toast.leaving { animation: toast-out var(--t-med) var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(12px); } }

/* ---------- Listas responsivas (tabela → cartões) ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; align-items: center; gap: var(--s3); padding: var(--s4); border-top: 1px solid var(--line); text-decoration: none; min-height: 64px; transition: background var(--t-fast); }
.list-item:first-child { border-top: 0; }
a.list-item:hover { background: var(--surface-2); }
.list-item .meta { font-size: var(--fs-xs); color: var(--muted); }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: var(--fs-sm); background: var(--surface-3); color: var(--text); flex: none; letter-spacing: -.02em; }
.avatar-brand { background: var(--brand); color: var(--on-brand); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--r-lg); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th { text-align: left; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
@media (max-width: 767px) {
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards tr { padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); }
  .table-cards td { border: 0; padding: 3px 0; }
  .table-cards td[data-label]::before { content: attr(data-label) " · "; color: var(--muted); font-size: var(--fs-xs); }
}

/* ---------- Estados ---------- */
.empty { text-align: center; padding: var(--s10) var(--s5); display: flex; flex-direction: column; align-items: center; gap: var(--s3); }
.empty .empty-ic { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--accent-text); }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--r-sm); min-height: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- App shell ---------- */
.app { min-height: 100dvh; }
.topbar { position: sticky; top: 0; z-index: 30; height: calc(var(--topbar) + var(--safe-t)); padding: var(--safe-t) var(--s4) 0; display: flex; align-items: center; gap: var(--s3);
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(140%) blur(14px); -webkit-backdrop-filter: saturate(140%) blur(14px); border-bottom: 1px solid var(--line); }
.topbar .tenant { display: flex; align-items: center; gap: var(--s3); min-width: 0; flex: 1; text-decoration: none; }
.topbar .tenant-name { font-weight: 750; font-size: var(--fs-md); letter-spacing: -.02em; }
.topbar .tenant-sub { font-size: var(--fs-xs); color: var(--muted); }
.search-trigger { display: none; }
.main { padding: var(--s5) var(--s4) calc(var(--bottomnav) + var(--safe-b) + var(--s8)); max-width: 1240px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s5); flex-wrap: wrap; }
.page-head h1 { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -.035em; }
.page-head p { color: var(--muted); margin-top: 4px; font-size: var(--fs-sm); }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: var(--fs-sm); font-weight: 600; min-height: 36px; margin-bottom: var(--s2); }
.back:hover { color: var(--text); }

/* Navegação inferior (mobile) */
.bottomnav { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; height: calc(var(--bottomnav) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(5, 1fr); background: color-mix(in srgb, var(--bg-2) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
.bottomnav a, .bottomnav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 650; color: var(--muted); text-decoration: none; background: none; border: 0; cursor: pointer; position: relative; -webkit-tap-highlight-color: transparent; }
.bottomnav [aria-current="page"] { color: var(--text); }
.bottomnav [aria-current="page"]::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand); }
.bottomnav [aria-current="page"] .ic { color: var(--accent-text); }

/* Sidebar / drawer */
.sidebar { position: fixed; z-index: 60; inset: 0 auto 0 0; width: min(86vw, var(--sidebar)); background: var(--bg-2); border-right: 1px solid var(--line); display: flex; flex-direction: column;
  transform: translateX(-102%); transition: transform var(--t-med) var(--ease); padding-top: var(--safe-t); overscroll-behavior: contain; }
.sidebar.open { transform: none; box-shadow: var(--shadow-3); }
.scrim { position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: opacity var(--t-med); }
.scrim.show { opacity: 1; pointer-events: auto; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: var(--s4) var(--s4) var(--s2) var(--s5); height: var(--topbar); }
.sidebar nav { flex: 1; overflow-y: auto; padding: var(--s2) var(--s3) var(--s6); }
.nav-group { margin-top: var(--s4); }
.nav-group-title { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 750; padding: 0 var(--s3); margin-bottom: 6px; }
.nav-link { display: flex; align-items: center; gap: var(--s3); min-height: 42px; padding: 0 var(--s3); border-radius: var(--r-md); color: var(--text-2); text-decoration: none; font-size: var(--fs-sm); font-weight: 600; transition: background var(--t-fast), color var(--t-fast); }
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link[aria-current="page"] { background: var(--surface-3); color: var(--text); }
.nav-link[aria-current="page"] .ic { color: var(--accent-text); }
.nav-link.soon { color: var(--muted); cursor: default; }
.nav-link.soon:hover { background: transparent; }
.nav-link .badge-soon { margin-left: auto; }
.sidebar-foot { border-top: 1px solid var(--line); padding: var(--s3) var(--s3) calc(var(--s3) + var(--safe-b)); }
.user-chip { display: flex; align-items: center; gap: var(--s3); padding: var(--s2); border-radius: var(--r-md); text-decoration: none; }
.user-chip:hover { background: var(--surface-2); }

/* ---------- Dashboard ---------- */
.hero-card { position: relative; overflow: hidden; border-radius: var(--r-xl); padding: var(--s6); background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--brand) 26%, transparent) 0%, transparent 55%), linear-gradient(160deg, #1A1D22, var(--carbon)); color: #F2F3F5; border: 1px solid #262A30; }
.hero-card::after { content: ""; position: absolute; right: -40px; bottom: -60px; width: 220px; height: 220px; background: var(--brand); opacity: .08; transform: rotate(-45deg); border-radius: 28px; }
.hero-card h2 { font-size: var(--fs-xl); font-weight: 800; letter-spacing: -.03em; }
.hero-card p { color: #B7BCC5; }
.hero-card .btn:not(.btn-primary) { --bg-b: rgba(255,255,255,.06); --bd-b: rgba(255,255,255,.14); --fg-b: #F2F3F5; }
.kpis { display: grid; gap: var(--s3); grid-template-columns: repeat(2, minmax(0,1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s4); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kpi .kpi-label { font-size: var(--fs-xs); color: var(--muted); font-weight: 650; display: flex; align-items: center; gap: 6px; }
.kpi .kpi-value { font-size: var(--fs-xl); font-weight: 800; letter-spacing: -.03em; }
.kpi .kpi-foot { font-size: var(--fs-xs); color: var(--muted); }
.progress-ring { --p: 0; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--brand) calc(var(--p) * 1%), var(--surface-3) 0); flex: none; }
.progress-ring span { width: 50px; height: 50px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 800; font-size: var(--fs-sm); }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li a, .checklist li > span { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) 0; min-height: var(--tap); text-decoration: none; font-size: var(--fs-sm); border-top: 1px solid var(--line); }
.checklist li:first-child a, .checklist li:first-child > span { border-top: 0; }
.check-dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line-2); flex: none; }
.done .check-dot { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.done .check-text { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-2); }
.modules { display: grid; gap: var(--s3); grid-template-columns: repeat(2, minmax(0,1fr)); }
.module { border: 1px dashed var(--line-2); border-radius: var(--r-lg); padding: var(--s4); display: flex; flex-direction: column; gap: var(--s2); min-width: 0; }
.module .ic { color: var(--muted); }
.module strong { font-size: var(--fs-sm); }
.module span { font-size: var(--fs-xs); color: var(--muted); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: var(--s3); padding: var(--s3) 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.timeline li:first-child { border-top: 0; }
.timeline .when { color: var(--muted); font-size: var(--fs-xs); white-space: nowrap; }
.dash-grid { display: grid; gap: var(--s4); grid-template-columns: minmax(0,1fr); }
.link-box { display: flex; align-items: center; gap: var(--s2); padding: 6px 6px 6px 14px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); font-size: var(--fs-sm); }
.link-box code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: var(--fs-xs); color: var(--text-2); }

/* ---------- Permissões ---------- */
.perm-group { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.perm-group h3 { font-size: var(--fs-sm); padding: var(--s3) var(--s4); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.perm-group .check { padding: var(--s2) var(--s4); border-top: 1px solid var(--line); margin: 0; }
.perm-group .check:first-of-type { border-top: 0; }
.perm-grid { display: grid; gap: var(--s3); grid-template-columns: 1fr; }

/* ---------- Horários ---------- */
.hours { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.hour-row { display: grid; grid-template-columns: 1fr auto; gap: var(--s2) var(--s3); align-items: center; padding: var(--s3) var(--s4); border-top: 1px solid var(--line); }
.hour-row:first-child { border-top: 0; }
.hour-row .times { grid-column: 1 / -1; display: flex; gap: var(--s2); align-items: center; }
.hour-row .times .input { min-height: 44px; padding: 8px 10px; }
.hour-row.closed .times { opacity: .4; }

/* ---------- Auth ---------- */
.auth { min-height: 100dvh; display: grid; grid-template-columns: 1fr; background: var(--bg); }
.auth-aside { display: none; }
.auth-main { display: flex; flex-direction: column; padding: calc(var(--s5) + var(--safe-t)) var(--s5) calc(var(--s8) + var(--safe-b)); }
.auth-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s8); }
.auth-card { width: 100%; max-width: 440px; margin: 0 auto; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.auth-card.wide { max-width: 680px; }
.auth-card h1 { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -.035em; }
.auth-card .lead { color: var(--muted); margin-top: 6px; margin-bottom: var(--s6); }
.auth-foot { text-align: center; font-size: var(--fs-sm); color: var(--muted); margin-top: var(--s6); }
.auth-foot a { color: var(--text); font-weight: 650; }
.steps { display: flex; gap: var(--s2); margin-bottom: var(--s6); }
.steps li { list-style: none; flex: 1; display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-xs); color: var(--muted); font-weight: 650; }
.steps li::before { content: ""; height: 4px; border-radius: 4px; background: var(--line-2); }
.steps li.done::before, .steps li.current::before { background: var(--brand); }
.steps li.current { color: var(--text); }
.steps ol { display: contents; }
.profile-opts { display: grid; gap: var(--s2); grid-template-columns: 1fr 1fr; }
.profile-opt { position: relative; }
.profile-opt input { position: absolute; opacity: 0; }
.profile-opt label { display: flex; flex-direction: column; gap: 2px; padding: var(--s3); border-radius: var(--r-md); border: 1px solid var(--line-2); background: var(--surface-2); cursor: pointer; min-height: 72px; transition: border-color var(--t-fast), background var(--t-fast); }
.profile-opt label strong { font-size: var(--fs-sm); }
.profile-opt label span { font-size: var(--fs-xs); color: var(--muted); line-height: 1.35; }
.profile-opt input:checked + label { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, var(--surface-2)); box-shadow: inset 0 0 0 1px var(--brand); }
.profile-opt input:focus-visible + label { box-shadow: var(--focus); }
.otp-input { letter-spacing: .5em; font-size: 1.5rem; text-align: center; font-weight: 800; font-family: var(--mono); }
.secret { font-family: var(--mono); font-size: var(--fs-sm); word-break: break-all; padding: var(--s3); background: var(--surface-2); border-radius: var(--r-md); border: 1px dashed var(--line-2); }

/* ---------- Público ---------- */
.pub-nav { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; padding: calc(var(--s3) + var(--safe-t)) var(--s5) var(--s3); background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.pub-hero { position: relative; overflow: hidden; padding: var(--s16) var(--s5) var(--s12); text-align: center; }
.pub-hero::before { content: ""; position: absolute; inset: -40% -20% auto; height: 520px; background: radial-gradient(closest-side, color-mix(in srgb, var(--lime) 22%, transparent), transparent); pointer-events: none; }
.pub-hero > * { position: relative; }
.pub-hero h1 { font-size: var(--fs-3xl); font-weight: 850; letter-spacing: -.045em; max-width: 880px; margin: var(--s4) auto 0; line-height: 1.05; }
.pub-hero h1 em { font-style: normal; color: var(--accent-text); }
[data-theme="light"] .pub-hero h1 em { background: linear-gradient(transparent 60%, var(--lime) 60%); }
.pub-hero p { max-width: 620px; margin: var(--s5) auto 0; color: var(--text-2); font-size: var(--fs-lg); }
.pub-cta { display: flex; gap: var(--s3); justify-content: center; flex-wrap: wrap; margin-top: var(--s8); }
.pub-section { max-width: 1160px; margin: 0 auto; padding: var(--s12) var(--s5); }
.feature-grid { display: grid; gap: var(--s4); grid-template-columns: 1fr; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s6); }
.feature .f-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--carbon); color: var(--lime); margin-bottom: var(--s4); }
.feature h3 { font-size: var(--fs-lg); }
.feature p { color: var(--muted); font-size: var(--fs-sm); margin-top: var(--s2); }
.plans { display: grid; gap: var(--s3); grid-template-columns: 1fr; }
.plan { border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5); background: var(--surface); }
.plan h3 { font-size: var(--fs-md); }
.plan p { font-size: var(--fs-sm); color: var(--muted); margin-top: 4px; }
.pub-foot { border-top: 1px solid var(--line); padding: var(--s8) var(--s5) calc(var(--s8) + var(--safe-b)); text-align: center; color: var(--muted); font-size: var(--fs-sm); }
.tenant-hero { padding: var(--s10) var(--s5) var(--s8); text-align: center; background: radial-gradient(100% 120% at 50% 0%, color-mix(in srgb, var(--brand) 18%, transparent), transparent 60%); }
.tenant-hero .tenant-logo { width: 88px; height: 88px; border-radius: 24px; margin: 0 auto var(--s4); }
.tenant-hero .mark-tile { width: 88px; height: 88px; border-radius: 24px; margin: 0 auto var(--s4); }
.tenant-hero .mark-tile .mark { width: 56px; height: 56px; }

/* ---------- Modal / Omnisearch ---------- */
dialog { border: 0; padding: 0; background: transparent; color: var(--text); max-width: none; max-height: none; }
dialog::backdrop { background: rgba(5,6,8,.6); backdrop-filter: blur(3px); }
.modal { width: min(560px, calc(100vw - 24px)); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-xl); box-shadow: var(--shadow-3); overflow: hidden; }
.modal-body { padding: var(--s5); }
.modal-foot { padding: var(--s4) var(--s5); border-top: 1px solid var(--line); display: flex; gap: var(--s3); justify-content: flex-end; flex-wrap: wrap; }
dialog[open] .modal { animation: pop var(--t-med) var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.omni { margin-top: 8vh; }
.omni-input { display: flex; align-items: center; gap: var(--s3); padding: 0 var(--s4); border-bottom: 1px solid var(--line); }
.omni-input input { flex: 1; min-height: 60px; border: 0; background: transparent; font-size: var(--fs-lg); outline: none; }
.omni-results { list-style: none; margin: 0; padding: var(--s2); max-height: 50vh; overflow-y: auto; }
.omni-results a { display: flex; align-items: center; gap: var(--s3); padding: var(--s3); border-radius: var(--r-md); text-decoration: none; font-size: var(--fs-sm); min-height: var(--tap); }
.omni-results a:hover, .omni-results a[aria-selected="true"] { background: var(--surface-3); }
.kbd { font-family: var(--mono); font-size: 11px; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--muted); background: var(--surface-2); }

/* ---------- Offline ---------- */
.offline-bar { position: fixed; z-index: 90; top: 0; left: 0; right: 0; padding: calc(6px + var(--safe-t)) var(--s4) 6px; text-align: center; font-size: var(--fs-xs); font-weight: 700; background: var(--warn); color: #101114; transform: translateY(-110%); transition: transform var(--t-med) var(--ease); }
.offline-bar.show { transform: none; }

/* ---------- Breakpoints por conteúdo ---------- */
@media (min-width: 480px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .toasts { left: auto; width: 380px; }
  .profile-opts { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 640px) {
  .hour-row { grid-template-columns: 140px auto 1fr; }
  .hour-row .times { grid-column: auto; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .plans { grid-template-columns: repeat(2, 1fr); }
  .modules { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (min-width: 768px) {
  .main { padding: var(--s8) var(--s6) var(--s12); }
  .kpis { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .perm-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .hero-card { padding: var(--s8); }
  .form-actions.sticky { position: static; background: none; padding: 0; }
}
@media (min-width: 1024px) {
  .bottomnav, .menu-btn, .drawer-close { display: none !important; }
  .sidebar { transform: none; width: var(--sidebar); box-shadow: none; }
  .scrim { display: none; }
  .app { padding-left: var(--sidebar); }
  .topbar { padding: 0 var(--s8); }
  .topbar .tenant { display: none; }
  .search-trigger { display: inline-flex; flex: 0 1 380px; justify-content: flex-start; color: var(--muted); font-weight: 500; }
  .search-trigger .kbd { margin-left: auto; }
  .topbar-spacer { flex: 1; }
  .main { padding: var(--s8) var(--s8) var(--s16); }
  .toasts { bottom: var(--s6); right: var(--s6); }
  .dash-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
  .auth { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .auth-aside { display: flex; position: relative; overflow: hidden; flex-direction: column; justify-content: space-between; padding: var(--s12); background: var(--carbon); color: #F2F3F5; border-right: 1px solid #23262B; }
  .auth-aside::before { content: ""; position: absolute; width: 640px; height: 640px; right: -260px; top: -200px; background: radial-gradient(closest-side, rgba(198,250,54,.22), transparent); }
  .auth-aside::after { content: ""; position: absolute; width: 420px; height: 90px; left: -60px; bottom: 120px; background: var(--lime); opacity: .07; transform: rotate(-45deg); border-radius: 20px; }
  .auth-aside > * { position: relative; z-index: 1; }
  .auth-aside .brandmark { color: #fff; font-size: 1.4rem; } .auth-aside .brandmark b { color: var(--lime); background: none; }
  .auth-aside .brandmark .mark .m-ring { stroke: #fff; }
  .auth-aside h2 { font-size: clamp(2rem, 3.2vw, 3.2rem); font-weight: 850; letter-spacing: -.045em; line-height: 1.05; max-width: 520px; }
  .auth-aside h2 em { font-style: normal; color: var(--lime); }
  .auth-aside ul { list-style: none; padding: 0; margin: var(--s8) 0 0; display: grid; gap: var(--s3); color: #B7BCC5; }
  .auth-aside li { display: flex; gap: var(--s3); align-items: center; }
  .auth-aside li .ic { color: var(--lime); }
  .auth-main { padding: var(--s8) var(--s12); }
  .auth-top .brandmark { visibility: hidden; }
  .feature-grid { grid-template-columns: repeat(3, 1fr); }
  .plans { grid-template-columns: repeat(4, 1fr); }
  .modules { grid-template-columns: repeat(4, minmax(0,1fr)); }
}
@media (min-width: 1920px) {
  :root { font-size: 17px; }
  .main { max-width: 1480px; }
}
@media (min-width: 2560px) {
  :root { font-size: 20px; }
  .main { max-width: 1760px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
@media print {
  .sidebar, .bottomnav, .topbar, .toasts, .scrim, .form-actions { display: none !important; }
  .app { padding: 0; } body { background: #fff; color: #000; }
}
.d-block { display: block; }
.banner-wrap { padding: var(--s4) var(--s4) 0; max-width: 1240px; margin: 0 auto; }
@media (min-width: 1024px) { .banner-wrap { padding: var(--s6) var(--s8) 0; } }
.empty .row { justify-content: center; }
.pub-foot svg { width: 32px; height: 32px; margin: 0 auto; }
.auth-card > .empty-ic { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--accent-text); }
.btn-reset { width: 100%; border: 0; background: none; text-align: left; cursor: pointer; color: inherit; font: inherit; }
details > summary { cursor: pointer; list-style: none; min-height: var(--tap); }
details > summary::-webkit-details-marker { display: none; }
.swatch { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--carbon); display: grid; place-items: center; cursor: pointer; padding: 0; }
.swatch span { width: 22px; height: 22px; border-radius: 50%; display: block; }
.swatch[aria-pressed="true"] { box-shadow: var(--focus); border-color: var(--brand); }
.swatch-c6fa36 { background: #C6FA36; } .swatch-f5c04a { background: #F5C04A; } .swatch-5eead4 { background: #5EEAD4; } .swatch-7dd3fc { background: #7DD3FC; }
.swatch-f9a8d4 { background: #F9A8D4; } .swatch-fdba74 { background: #FDBA74; } .swatch-e5e7eb { background: #E5E7EB; }
.card-head-pad { padding: var(--s4) var(--s4) 0; margin-bottom: var(--s2); }
.ic.inline { display: inline-block; vertical-align: -3px; }
fieldset.card legend { float: left; width: 100%; margin-bottom: var(--s4); }
fieldset.card legend + * { clear: both; }
.empty-ic.small-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--accent-text); flex: none; }
.alert > span { color: var(--text); }
.logo-preview { width: 72px; height: 72px; border-radius: 18px; }
.logo-preview .mark { width: 48px; height: 48px; }
.pre { white-space: pre-wrap; word-break: break-word; margin: var(--s2) 0 0; padding: var(--s3); background: var(--surface-2); border-radius: var(--r-sm); max-height: 260px; overflow: auto; }
.steps-list { padding-left: 1.2em; margin: 0; color: var(--text-2); }
.tenant-title { font-size: var(--fs-2xl); font-weight: 850; letter-spacing: -.04em; }
.hours-list { list-style: none; padding: 0; margin: 0; font-size: var(--fs-sm); }
.hours-list li { display: flex; justify-content: space-between; padding: 6px 0; border-top: 1px solid var(--line); }
.hours-list li:first-child { border-top: 0; }
.feature p.row { color: var(--text-2); flex-wrap: nowrap; align-items: flex-start; }
.install-alert { max-width: 620px; margin-left: auto; margin-right: auto; text-align: left; }
.pub-cta span.btn[aria-disabled="true"] { opacity: .8; pointer-events: none; }
.omni-empty { padding: var(--s3); }
.stack > .badge, .stack-sm > .badge, .auth-card > .badge { align-self: flex-start; }
.brandmark b { color: var(--lime); }
[data-theme="light"] .brandmark b { color: var(--text); }
.auth-aside .brandmark b { color: var(--lime); }
.mark-tile, .tenant-logo, .avatar, .btn-icon { flex: none; }
.topbar .tenant-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 479px) { .hide-sm { display: none !important; } }
