/* ==========================================================================
   Serra Dourada | Evolução da Obra — design system (mobile-first)
   ========================================================================== */

:root {
  --bg: #f2f4f7;
  --bg-2: #e9edf2;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --navy-950: #071528;
  --navy-900: #0b1f3a;
  --navy-800: #12305a;
  --navy-700: #1c4373;
  --navy-600: #2a5a92;
  --teal-700: #0f766e;
  --teal-600: #0d9488;
  --teal-500: #14b8a6;
  --teal-400: #2dd4bf;
  --teal-300: #5eead4;
  --teal-100: #d5f3ee;
  --teal-50: #e9f8f5;
  --track: #e2f1ee;
  --text: #0e1b2d;
  --text-2: #4a5a70;
  --text-3: #617086;
  --border: #e3e8ef;
  --border-2: #d3dbe6;
  --green-700: #047857;
  --green-50: #e6f6ee;
  --amber-700: #a85a06;
  --amber-500: #f59e0b;
  --amber-50: #fdf3e1;
  --red-700: #b42318;
  --red-500: #e5484d;
  --red-50: #fdecec;
  --blue-700: #1d4ed8;
  --blue-50: #eaf1fd;
  --slate-100: #edf0f4;

  /* Composição do índice: paleta categórica validada (ordem fixa por atividade) */
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;

  --radius-xl: 24px;
  --radius-lg: 20px;
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --shadow-1: 0 1px 2px rgba(14, 27, 45, .04), 0 1px 3px rgba(14, 27, 45, .05);
  --shadow-2: 0 2px 6px rgba(14, 27, 45, .05), 0 10px 28px rgba(14, 27, 45, .08);
  --shadow-hero: 0 22px 44px -18px rgba(11, 31, 58, .55);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --tabbar-h: 64px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);

  /* Tokens semânticos (tema claro). Os componentes usam estes papéis, não cores fixas. */
  --heading: var(--navy-900);
  --ink: var(--navy-800);
  --strong-bg: var(--navy-900);
  --strong-bg-hover: var(--navy-800);
  --strong-ink: #ffffff;
  --accent: var(--teal-600);
  --accent-ink: #ffffff;
  --progress-a: var(--teal-600);
  --progress-b: var(--teal-500);
  --icon-tile-bg: var(--teal-50);
  --icon-tile-ink: var(--navy-800);
  --brand-tile: var(--navy-900);
  --avatar-bg: linear-gradient(145deg, var(--navy-800), var(--navy-900));
  --avatar-ring: #ffffff;
  --input-bg: var(--surface);
  --input-focus: var(--navy-600);
  --input-focus-ring: rgba(42, 90, 146, .14);
  --focus-ring: rgba(42, 90, 146, .45);
  --segmented-on: var(--surface);
  --topbar-bg: rgba(242, 244, 247, .86);
  --tabbar-bg: rgba(255, 255, 255, .94);
  --nav-hover: rgba(255, 255, 255, .7);
  --overlay-bg: var(--navy-900);
  --overlay-ink: #ffffff;
  --overlay-muted: rgba(255, 255, 255, .72);
  --overlay-border: transparent;
  --backdrop: rgba(7, 21, 40, .46);
  --grid: #e6eaf0;
  --skeleton: #e7ebf0;
  --skeleton-strong: #d9dfe7;
  --shimmer: rgba(255, 255, 255, .55);
  --live: #10b981;
  --live-halo: rgba(16, 185, 129, .28);
  --info-ink: #1e3a8a;
  --success-ink: #065f46;
  --warn-ink: #7c4305;
  --danger-ink: #8f1d14;
  --ok-border: #c9ecdb;
  --bad-border: #f5cdc9;
  --danger-border: #f4c7c3;
  --primary-shadow: 0 6px 16px -6px rgba(11, 31, 58, .55);
  --accent-shadow: 0 6px 16px -6px rgba(13, 148, 136, .6);
  --hero-bg:
    radial-gradient(120% 90% at 100% 0%, rgba(45, 212, 191, .22) 0%, rgba(45, 212, 191, 0) 52%),
    radial-gradient(90% 70% at 0% 100%, rgba(42, 90, 146, .45) 0%, rgba(42, 90, 146, 0) 60%),
    linear-gradient(155deg, #0b1f3a 0%, #12305a 60%, #123a60 100%);
  --hero-border: transparent;
  --hero-track: rgba(45, 212, 191, .16);
  --hero-fill: linear-gradient(90deg, #14b8a6 0%, #2dd4bf 70%, #5eead4 100%);
  --hero-glow: 0 0 18px rgba(45, 212, 191, .55);
  --hero-accent: var(--teal-300);
  --login-hero-bg:
    radial-gradient(110% 80% at 100% 0%, rgba(45, 212, 191, .28) 0%, rgba(45, 212, 191, 0) 55%),
    linear-gradient(160deg, #0b1f3a 0%, #12305a 70%, #133b62 100%);
  color-scheme: light;
}

/* --------------------------------------------------------------------------
   Tema escuro — mesmos papéis, valores próprios (validados para contraste).
   Fundo #0B121C · cartões #151F2D · painéis #101B2B · bordas #263548
   -------------------------------------------------------------------------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b121c;
  --bg-2: #111b28;
  --surface: #151f2d;
  --surface-2: #101b2b;
  --border: #263548;
  --border-2: #31445c;
  --text: #f5f7fb;
  --text-2: #93bce7;
  --text-3: #7f9ab8;
  --track: #22324a;
  --slate-100: #1c2a3d;

  /* Família "teal" vira o verde dos indicadores */
  --teal-50: rgba(66, 217, 137, .12);
  --teal-100: rgba(66, 217, 137, .18);
  --teal-300: #6fe3a7;
  --teal-400: #42d989;
  --teal-500: #42d989;
  --teal-600: #42d989;
  --teal-700: #42d989;

  --green-50: rgba(66, 217, 137, .12);
  --green-700: #42d989;
  --amber-50: rgba(255, 190, 24, .12);
  --amber-500: #ffbe18;
  --amber-700: #ffbe18;
  --red-50: rgba(255, 93, 120, .12);
  --red-500: #ff5d78;
  --red-700: #ff5d78;
  --blue-50: rgba(132, 189, 250, .12);
  --blue-700: #84bdfa;

  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --series-5: #d55181;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, .28);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .32);
  --shadow-hero: 0 18px 40px -20px rgba(0, 0, 0, .7);

  --heading: #f5f7fb;
  --ink: #84bdfa;
  --strong-bg: #84bdfa;
  --strong-bg-hover: #9fccfb;
  --strong-ink: #0b121c;
  --accent: #42d989;
  --accent-ink: #0b121c;
  --progress-a: #33c97b;
  --progress-b: #42d989;
  --icon-tile-bg: rgba(132, 189, 250, .12);
  --icon-tile-ink: #84bdfa;
  --brand-tile: #1a2a40;
  --avatar-bg: linear-gradient(145deg, #2b4c75, #1d3557);
  --avatar-ring: #0b121c;
  --input-bg: #101b2b;
  --input-focus: #84bdfa;
  --input-focus-ring: rgba(132, 189, 250, .18);
  --focus-ring: rgba(132, 189, 250, .55);
  --segmented-on: #24364d;
  --topbar-bg: rgba(11, 18, 28, .86);
  --tabbar-bg: rgba(16, 25, 38, .94);
  --nav-hover: rgba(255, 255, 255, .05);
  --overlay-bg: #1d2a3c;
  --overlay-ink: #f5f7fb;
  --overlay-muted: #93bce7;
  --overlay-border: #31445c;
  --backdrop: rgba(3, 7, 12, .62);
  --grid: #213044;
  --skeleton: #182435;
  --skeleton-strong: #1b293c;
  --shimmer: rgba(255, 255, 255, .05);
  --live: #42d989;
  --live-halo: rgba(66, 217, 137, .28);
  --info-ink: #84bdfa;
  --success-ink: #42d989;
  --warn-ink: #ffbe18;
  --danger-ink: #ff5d78;
  --ok-border: rgba(66, 217, 137, .32);
  --bad-border: rgba(255, 93, 120, .32);
  --danger-border: rgba(255, 93, 120, .4);
  --primary-shadow: none;
  --accent-shadow: none;
  --hero-bg:
    radial-gradient(110% 90% at 100% 0%, rgba(66, 217, 137, .08) 0%, rgba(66, 217, 137, 0) 50%),
    linear-gradient(155deg, #182537 0%, #152131 55%, #121d2c 100%);
  --hero-border: #263548;
  --hero-track: #22324a;
  --hero-fill: linear-gradient(90deg, #33c97b 0%, #42d989 100%);
  --hero-glow: 0 0 10px rgba(66, 217, 137, .22);
  --hero-accent: #42d989;
  --login-hero-bg:
    radial-gradient(110% 80% at 100% 0%, rgba(66, 217, 137, .10) 0%, rgba(66, 217, 137, 0) 55%),
    linear-gradient(160deg, #0f1926 0%, #131f2f 70%, #16243a 100%);
}

/* Troca de tema: transição curta de cores (aplicada só durante a troca) */
html.theme-switching,
html.theme-switching *,
html.theme-switching *::before,
html.theme-switching *::after {
  transition: background-color .25s ease, color .25s ease, border-color .25s ease,
    fill .25s ease, stroke .25s ease, box-shadow .25s ease !important;
}

/* Botão de tema: lua no claro, sol no escuro (sem depender do JS para o ícone certo) */
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

body.has-sheet { overflow: hidden; }

h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; }
code { font-family: var(--mono); font-size: .9em; background: var(--slate-100); padding: 1px 6px; border-radius: 6px; }

svg[viewBox="0 0 24 24"] {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; border-radius: 8px; }

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--strong-bg); color: var(--strong-ink); padding: 10px 14px; border-radius: 10px;
}
.skip-link:focus { top: calc(8px + var(--safe-t)); }

.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;
}

.noscript { padding: 24px; text-align: center; color: var(--text-2); }

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding-left: max(16px, var(--safe-l));
  padding-right: max(16px, var(--safe-r));
}

/* --------------------------------------------------------------------------
   Topo
   -------------------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  padding-top: var(--safe-t);
  background: var(--topbar-bg);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.topbar.is-scrolled { border-bottom-color: var(--border); box-shadow: 0 1px 0 rgba(14, 27, 45, .02); }
.topbar__inner { display: flex; align-items: center; gap: 12px; height: 64px; }

.brand { display: flex; align-items: center; gap: 11px; min-width: 0; flex: 1; }
.brand-mark { width: 38px; height: 38px; flex: none; color: var(--brand-tile); }
.brand-mark--lg { width: 52px; height: 52px; }
.brand__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.brand__text strong { font-size: 15px; font-weight: 800; letter-spacing: .14em; color: var(--heading); }
.brand__text small { font-size: 12px; font-weight: 500; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

.avatar {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--avatar-bg);
  color: #fff; font-size: 14px; font-weight: 700; letter-spacing: .02em;
  box-shadow: 0 0 0 3px var(--avatar-ring), var(--shadow-1);
  transition: transform .15s var(--ease);
}
.avatar:active { transform: scale(.94); }

.desknav { display: none; }

/* --------------------------------------------------------------------------
   Navegação inferior (app)
   -------------------------------------------------------------------------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding: 0 max(8px, var(--safe-l)) var(--safe-b) max(8px, var(--safe-r));
  background: var(--tabbar-bg);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
  border-top: 1px solid var(--border);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--text-3); font-size: 11px; font-weight: 600; letter-spacing: .01em;
  min-width: 0; -webkit-user-select: none; user-select: none;
  transition: color .2s;
}
.tab__icon {
  display: grid; place-items: center; width: 56px; height: 30px; border-radius: 999px;
  transition: background-color .25s var(--ease), transform .15s var(--ease);
}
.tab__icon svg { width: 23px; height: 23px; }
.tab:active .tab__icon { transform: scale(.92); }
.tab.is-active { color: var(--heading); }
.tab.is-active .tab__icon { background: var(--teal-100); }
.tab.is-active .tab__icon svg { stroke-width: 2.1; }

/* --------------------------------------------------------------------------
   Área de conteúdo
   -------------------------------------------------------------------------- */
.view {
  padding-top: 6px;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 28px);
  min-height: 60vh;
  outline: none;
}

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin: 10px 0 18px; }
.page-head > div:first-child { flex: 1; min-width: 0; }
.page-head--wrap { flex-wrap: wrap; }
.page-head--wrap > div:first-child { flex-basis: 260px; }
.page-head > .btn, .page-head > .icon-btn { margin-top: 2px; }
@media (max-width: 479px) { .page-head .btn .btn__label { display: none; } .page-head .btn { width: 44px; padding: 0; } }
.page-head h1 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; color: var(--heading); line-height: 1.2; }
.page-head p { color: var(--text-2); font-size: 14px; margin-top: 4px; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 26px 2px 12px; }
.section-head h2 { font-size: 16px; font-weight: 750; color: var(--heading); letter-spacing: -.01em; }
.section-head span { font-size: 12.5px; color: var(--text-3); }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
}
.card__pad { padding: 18px; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 0; }
.card__head h2, .card__head h3 { font-size: 15px; font-weight: 700; color: var(--heading); }
.card__head p { font-size: 12.5px; color: var(--text-3); }

/* --------------------------------------------------------------------------
   Faixa de atualização
   -------------------------------------------------------------------------- */
.status-strip { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 14px; }
.fresh {
  display: inline-flex; align-items: center; gap: 9px; min-width: 0;
  padding: 7px 13px 7px 11px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-1);
  font-size: 13px; color: var(--text-2);
}
.fresh strong { color: var(--heading); font-weight: 650; white-space: nowrap; }
.fresh__text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fresh__dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.fresh--recent .fresh__dot { background: var(--live); }
.fresh--recent .fresh__dot::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  background: var(--live-halo); animation: halo 2.4s ease-out infinite;
}
.fresh--aging .fresh__dot { background: var(--amber-500); }
.fresh--stale .fresh__dot { background: var(--red-500); }

.icon-btn {
  flex: none; display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-1);
  color: var(--ink);
  transition: transform .15s var(--ease), background-color .2s;
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:active { transform: scale(.92); }
.icon-btn--ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-3); width: 40px; height: 40px; }
.icon-btn.is-loading svg { animation: spin .9s linear infinite; }
.icon-btn:disabled { opacity: .6; cursor: default; }

/* --------------------------------------------------------------------------
   Card principal — avanço geral
   -------------------------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: var(--radius-xl);
  padding: 22px 20px 18px;
  color: #fff;
  background: var(--hero-bg);
  border: 1px solid var(--hero-border);
  box-shadow: var(--shadow-hero);
}
.hero__art {
  position: absolute; z-index: -1; right: -18px; bottom: -14px;
  width: 170px; height: 200px; color: #fff; opacity: .075; pointer-events: none;
}
.hero__label {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: rgba(255, 255, 255, .74);
}
.hero__label svg { width: 16px; height: 16px; color: var(--hero-accent); }
.hero__value {
  display: flex; align-items: baseline;
  margin: 12px 0 2px;
  font-size: clamp(58px, 19vw, 80px); font-weight: 800; letter-spacing: -.035em; line-height: .95;
}
.hero__value small { font-size: .44em; font-weight: 700; letter-spacing: 0; margin-left: 4px; color: rgba(255, 255, 255, .86); }
.hero__caption { font-size: 14px; color: rgba(255, 255, 255, .76); font-weight: 500; }

.hero__meter { margin-top: 20px; }
.meter {
  position: relative; height: 10px; border-radius: 999px; overflow: hidden;
  background: var(--track);
}
.meter__fill {
  position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--progress-a), var(--progress-b));
  transition: width 1.1s var(--ease) .08s;
}
.meter--hero { height: 12px; background: var(--hero-track); }
.meter--hero .meter__fill {
  background: var(--hero-fill);
  box-shadow: var(--hero-glow);
}
.meter--thin { height: 6px; }

.hero__split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.hero__split div { display: flex; flex-direction: column; gap: 1px; }
.hero__split div:last-child { text-align: right; }
.hero__split span { font-size: 12px; color: rgba(255, 255, 255, .66); font-weight: 500; }
.hero__split strong { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.hero__split .is-done strong { color: var(--hero-accent); }

.hero__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .12);
}
.hero__ref { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: rgba(255, 255, 255, .74); min-width: 0; white-space: nowrap; }
@media (max-width: 399px) { .hide-xs { display: none; } }
.hero__ref svg { width: 16px; height: 16px; flex: none; }
.hero__ref strong { color: #fff; font-weight: 600; }
.hero__link {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 36px; padding: 0 12px 0 14px; border-radius: 999px;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16);
  color: #fff; font-size: 13px; font-weight: 600;
  transition: background-color .2s, transform .15s var(--ease);
}
.hero__link svg { width: 16px; height: 16px; }
.hero__link:active { transform: scale(.97); background: rgba(255, 255, 255, .16); }

/* --------------------------------------------------------------------------
   Cards de atividades
   -------------------------------------------------------------------------- */
.activities { display: grid; grid-template-columns: 1fr; gap: 12px; }

.act {
  display: block; position: relative;
  padding: 16px 16px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  transition: transform .16s var(--ease), box-shadow .25s var(--ease), border-color .2s;
}
.act:active { transform: scale(.985); }
.act__head { display: flex; align-items: center; gap: 12px; }
.act__icon {
  flex: none; width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--icon-tile-bg); color: var(--icon-tile-ink);
}
.act__icon svg { width: 24px; height: 24px; }
.act__title { flex: 1; min-width: 0; }
.act__name { font-size: 15px; font-weight: 700; color: var(--heading); line-height: 1.25; letter-spacing: -.005em; }
.act__badge { margin-top: 4px; }
.act__chev { flex: none; width: 20px; height: 20px; color: var(--text-3); transition: transform .2s var(--ease); }

.act__value { display: flex; align-items: baseline; gap: 8px; margin: 14px 0 10px; }
.act__value strong { font-size: 34px; font-weight: 800; letter-spacing: -.03em; color: var(--heading); line-height: 1; }
.act__value strong small { font-size: .55em; font-weight: 700; margin-left: 2px; letter-spacing: 0; }
.act__value span { font-size: 13px; font-weight: 500; color: var(--text-2); }

.act__qty { margin-top: 10px; font-size: 13.5px; color: var(--text-2); }
.act__qty b { color: var(--text); font-weight: 650; }

.act__foot {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border);
}
.act__foot div { display: flex; flex-direction: column; gap: 1px; }
.act__foot div:last-child { text-align: right; }
.mini-label { font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.act__foot strong { font-size: 14.5px; font-weight: 700; color: var(--text); }

/* --------------------------------------------------------------------------
   Selos
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 650; white-space: nowrap; letter-spacing: .01em;
  background: var(--slate-100); color: var(--text-2);
}
.badge svg { width: 12px; height: 12px; stroke-width: 2.4; }
.badge--teal { background: var(--teal-50); color: var(--teal-700); }
.badge--success { background: var(--green-50); color: var(--green-700); }
.badge--warn { background: var(--amber-50); color: var(--amber-700); }
.badge--danger { background: var(--red-50); color: var(--red-700); }
.badge--info { background: var(--blue-50); color: var(--blue-700); }
.badge--navy { background: var(--strong-bg); color: var(--strong-ink); }
.badge--lg { height: 28px; padding: 0 12px; font-size: 12.5px; }

.delta { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; white-space: nowrap; }
.delta svg { width: 14px; height: 14px; stroke-width: 2.4; }
.delta--up { color: var(--green-700); }
.delta--down { color: var(--red-700); }
.delta--flat { color: var(--text-3); }
.delta-pill { padding: 4px 10px; border-radius: 999px; font-size: 13px; }
.delta-pill.delta--up { background: var(--green-50); }
.delta-pill.delta--down { background: var(--red-50); }
.delta-pill.delta--flat { background: var(--slate-100); }

/* --------------------------------------------------------------------------
   Folha de detalhes (bottom sheet / modal)
   -------------------------------------------------------------------------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: var(--backdrop);
  opacity: 0; transition: opacity .28s var(--ease);
}
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61;
  display: flex; flex-direction: column;
  max-height: calc(100dvh - 28px - var(--safe-t));
  background: var(--bg);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: 0 -12px 40px rgba(7, 21, 40, .18);
  transform: translateY(104%);
  transition: transform .34s var(--ease);
  padding-bottom: var(--safe-b);
  outline: none;
}
.sheet.is-open { transform: translateY(0); }
.sheet-backdrop.is-open { opacity: 1; }
.sheet.is-dragging { transition: none; }
.sheet__grab { padding: 8px 0 2px; touch-action: none; cursor: grab; }
.sheet__handle { width: 40px; height: 5px; border-radius: 3px; background: var(--border-2); margin: 0 auto; }
.sheet__header { display: flex; align-items: center; gap: 12px; padding: 6px 16px 10px 20px; touch-action: none; }
.sheet__title { flex: 1; min-width: 0; font-size: 17px; font-weight: 750; color: var(--heading); letter-spacing: -.01em; }
.sheet__close { width: 36px; height: 36px; background: var(--surface); }
.sheet__body { overflow-y: auto; overscroll-behavior: contain; padding: 2px 20px 24px; -webkit-overflow-scrolling: touch; }

.detail-top { display: flex; gap: 14px; align-items: center; }
.detail-top .act__icon { width: 52px; height: 52px; border-radius: 16px; }
.detail-top .act__icon svg { width: 28px; height: 28px; }
.detail-pct { font-size: 44px; font-weight: 800; letter-spacing: -.035em; color: var(--heading); line-height: 1; }
.detail-pct small { font-size: .5em; font-weight: 700; margin-left: 2px; letter-spacing: 0; }
.detail-sub { font-size: 13.5px; color: var(--text-2); margin-top: 4px; }
.detail-meter { margin: 16px 0 6px; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 12px 13px;
}
.stat span { display: block; font-size: 11.5px; font-weight: 600; color: var(--text-3); letter-spacing: .02em; }
.stat strong { display: block; font-size: 17px; font-weight: 750; color: var(--text); margin-top: 3px; letter-spacing: -.01em; }
.stat em { display: block; font-style: normal; font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.stat--wide { grid-column: 1 / -1; }
.stat--accent { background: linear-gradient(140deg, var(--teal-50), var(--surface) 80%); border-color: var(--teal-100); }

.note { font-size: 12.5px; color: var(--text-3); margin-top: 12px; display: flex; gap: 6px; align-items: flex-start; }
.note svg { width: 15px; height: 15px; flex: none; margin-top: 2px; }

.segments { padding: 4px 16px; }
.segment { padding: 13px 0; border-bottom: 1px solid var(--border); }
.segment:last-child { border-bottom: 0; }
.segment__top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.segment__code { font-size: 14px; font-weight: 700; color: var(--heading); letter-spacing: .02em; }
.segment__pct { font-size: 14.5px; font-weight: 750; color: var(--text); }
.segment__qty { font-size: 12.5px; color: var(--text-2); margin-top: 7px; }

/* Composição do índice */
.stack {
  display: flex; gap: 2px; height: 16px; border-radius: 6px; overflow: hidden;
  background: var(--slate-100); margin: 18px 0 8px;
}
.stack__seg { height: 100%; width: 0; transition: width .9s var(--ease); }
.stack__seg:first-child { border-radius: 4px 0 0 4px; }
.stack__rest { flex: 1; }
.stack-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); }
.legend { list-style: none; margin: 16px 0 0; padding: 4px 16px; }
.legend li { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.legend li:last-child { border-bottom: 0; }
.legend__swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.legend__name { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; color: var(--text); }
.legend__name small { display: block; font-size: 12px; font-weight: 500; color: var(--text-3); }
.legend__value { font-size: 14px; font-weight: 750; color: var(--text); white-space: nowrap; }
.legend__total { background: var(--surface-2); margin: 0 -16px; padding-left: 16px !important; padding-right: 16px !important; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.sw-1 { background: var(--series-1); } .sw-2 { background: var(--series-2); } .sw-3 { background: var(--series-3); }
.sw-4 { background: var(--series-4); } .sw-5 { background: var(--series-5); }

/* --------------------------------------------------------------------------
   Histórico
   -------------------------------------------------------------------------- */
.compare { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.compare__item span { display: block; font-size: 12px; font-weight: 600; color: var(--text-3); }
.compare__item strong { display: block; font-size: 28px; font-weight: 800; letter-spacing: -.03em; color: var(--heading); line-height: 1.15; margin-top: 2px; }
.compare__item em { display: block; font-style: normal; font-size: 12px; color: var(--text-3); margin-top: 2px; }
.compare__item--prev strong { color: var(--text-2); font-weight: 700; }
.compare__item:last-child { text-align: right; }
.compare__arrow { color: var(--text-3); }
.compare__arrow svg { width: 22px; height: 22px; }
.compare__delta {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border);
}
.compare__delta p { font-size: 12.5px; color: var(--text-3); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 18px 0; }
.chip {
  height: 34px; padding: 0 14px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 13px; font-weight: 600; color: var(--text-2);
  transition: background-color .2s, color .2s, border-color .2s, transform .12s;
}
.chip:active { transform: scale(.96); }
.chip[aria-pressed="true"] { background: var(--strong-bg); border-color: var(--strong-bg); color: var(--strong-ink); }

.chart { position: relative; padding: 8px 10px 12px 6px; touch-action: pan-y; }
.chart svg { width: 100%; overflow: visible; }
.chart__grid { stroke: var(--grid); stroke-width: 1; }
.chart__base { stroke: var(--border-2); stroke-width: 1; }
.chart__tick { font-size: 11px; fill: var(--text-3); font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart__line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart__area { fill: url(#chartArea); }
.chart__stop { stop-color: var(--accent); }
.chart__dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.chart__dot--last { fill: var(--heading); }
.chart__end { font-size: 12px; font-weight: 700; fill: var(--text); font-family: var(--font); }
.chart__cross { stroke: var(--text-3); stroke-width: 1; opacity: 0; }
.chart__hover { fill: var(--accent); stroke: var(--surface); stroke-width: 2.5; opacity: 0; }
.chart.is-hover .chart__cross, .chart.is-hover .chart__hover { opacity: 1; }
.chart__overlay { fill: transparent; cursor: crosshair; outline: none; }
.chart__tip {
  position: absolute; top: 0; left: 0; z-index: 2; pointer-events: none;
  min-width: 132px; padding: 9px 11px; border-radius: 12px;
  background: var(--overlay-bg); color: var(--overlay-ink); box-shadow: var(--shadow-2);
  border: 1px solid var(--overlay-border);
  font-size: 12px; line-height: 1.35; opacity: 0; transform: translateY(4px);
  transition: opacity .15s, transform .15s;
}
.chart.is-hover .chart__tip { opacity: 1; transform: none; }
.chart__tip strong { display: block; font-size: 15px; font-weight: 750; }
.chart__tip span { color: var(--overlay-muted); }

.records { list-style: none; margin: 0; padding: 4px 6px 6px; }
.records > li { border-bottom: 1px solid var(--border); }
.records > li:last-child { border-bottom: 0; }
.record summary {
  list-style: none; display: flex; align-items: center; gap: 12px;
  padding: 14px 12px; cursor: pointer; border-radius: 12px;
}
.record summary::-webkit-details-marker { display: none; }
.record summary:active { background: var(--surface-2); }
.record__main { flex: 1; min-width: 0; }
.record__date { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; font-weight: 700; color: var(--heading); }
.record__meta { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.record__value { text-align: right; }
.record__value strong { display: block; font-size: 16px; font-weight: 750; color: var(--text); }
.record__value .delta { font-size: 12.5px; }
.record__chev { width: 18px; height: 18px; color: var(--text-3); transition: transform .2s var(--ease); flex: none; }
.record[open] .record__chev { transform: rotate(90deg); }
.record__body { padding: 0 12px 14px; }
.record__acts { list-style: none; margin: 0; padding: 4px 12px; background: var(--surface-2); border-radius: 12px; }
.record__acts li { display: flex; align-items: center; gap: 10px; padding: 9px 0; font-size: 13.5px; border-bottom: 1px solid var(--border); }
.record__acts li:last-child { border-bottom: 0; }
.record__acts li span:first-child { flex: 1; color: var(--text-2); }
.record__acts li strong { font-weight: 700; min-width: 64px; text-align: right; }
.record__acts .delta { min-width: 86px; justify-content: flex-end; font-size: 12.5px; }

/* --------------------------------------------------------------------------
   Perfil
   -------------------------------------------------------------------------- */
.profile-card { display: flex; align-items: center; gap: 16px; padding: 20px 18px; }
.profile-card .avatar { width: 64px; height: 64px; font-size: 22px; box-shadow: none; }
.profile-card h2 { font-size: 19px; font-weight: 750; color: var(--heading); letter-spacing: -.01em; }
.profile-card p { font-size: 13.5px; color: var(--text-3); margin: 2px 0 6px; }

.menu { list-style: none; margin: 0; padding: 4px 0; }
.menu li + li { border-top: 1px solid var(--border); }
.menu__item {
  display: flex; align-items: center; gap: 14px; width: 100%;
  min-height: 58px; padding: 10px 18px; background: none; border: 0; text-align: left;
  font-size: 15px; font-weight: 600; color: var(--text);
  transition: background-color .15s;
}
.menu__item:active { background: var(--surface-2); }
.menu__item .menu__icon { flex: none; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink); }
.menu__item .menu__icon svg { width: 19px; height: 19px; }
.menu__item > span:not(.menu__icon) { flex: 1; min-width: 0; }
.menu__item small { display: block; font-size: 12.5px; font-weight: 500; color: var(--text-3); }
.menu__item > svg { width: 18px; height: 18px; color: var(--text-3); flex: none; }
.menu__item--danger { color: var(--red-700); }
.menu__item--danger .menu__icon { background: var(--red-50); color: var(--red-700); }
.app-version { text-align: center; font-size: 12px; color: var(--text-3); margin: 22px 0 6px; }

/* --------------------------------------------------------------------------
   Formulários e botões
   -------------------------------------------------------------------------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; height: 48px; padding: 0 14px;
  background: var(--input-bg); border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  font-size: 16px; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
.field textarea { height: auto; min-height: 88px; padding: 12px 14px; resize: vertical; }
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237f8da0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-right: 40px;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--input-focus); box-shadow: 0 0 0 4px var(--input-focus-ring);
}
.field input:disabled { background: var(--surface-2); color: var(--text-3); }
.field__hint { font-size: 12px; color: var(--text-3); margin-top: 5px; }
.field__password { position: relative; }
.field__password input { padding-right: 50px; }
.field__password .icon-btn { position: absolute; right: 4px; top: 4px; }
.field-row { display: grid; grid-template-columns: 1fr; gap: 14px; }
.pin-row { display: flex; gap: 10px; }
.pin-row .btn { height: 48px; flex: none; }
.field input.pin-code { font-size: 22px; font-weight: 700; letter-spacing: .5em; font-variant-numeric: tabular-nums; }
.field input.pin-code::placeholder { letter-spacing: .3em; color: var(--border-2); }
.pin-reveal { display: flex; justify-content: center; gap: 10px; margin: 20px 0 6px; }
.pin-reveal span {
  width: 52px; height: 64px; border-radius: 14px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-1);
  font-size: 30px; font-weight: 800; color: var(--heading); font-variant-numeric: tabular-nums;
}

.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--slate-100); border-radius: 13px; }
.segmented label { margin: 0; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
  display: grid; place-items: center; height: 40px; border-radius: 10px;
  font-size: 14px; font-weight: 600; color: var(--text-2); cursor: pointer;
  transition: background-color .2s, color .2s, box-shadow .2s;
}
.segmented input:checked + span { background: var(--segmented-on); color: var(--heading); box-shadow: var(--shadow-1); }
.segmented input:focus-visible + span { outline: 3px solid var(--focus-ring); }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--ink); flex: none; }

.form__error {
  padding: 11px 13px; border-radius: 12px; background: var(--red-50); color: var(--red-700);
  font-size: 13.5px; font-weight: 500;
}

.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-size: 15px; font-weight: 650; white-space: nowrap; text-align: center;
  transition: transform .14s var(--ease), background-color .2s, box-shadow .2s, opacity .2s;
  -webkit-user-select: none; user-select: none;
}
.btn svg { width: 18px; height: 18px; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--primary { background: var(--strong-bg); color: var(--strong-ink); box-shadow: var(--primary-shadow); }
.btn--primary:hover:not(:disabled) { background: var(--strong-bg-hover); }
.btn--accent { background: var(--accent); color: var(--accent-ink); box-shadow: var(--accent-shadow); }
.btn--ghost { background: var(--surface); border-color: var(--border-2); color: var(--text); }
.btn--danger { background: var(--surface); border-color: var(--danger-border); color: var(--red-700); }
.btn--subtle { background: var(--surface-2); color: var(--ink); }
.btn--lg { height: 52px; font-size: 16px; border-radius: 14px; }
.btn--sm { height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn--block { width: 100%; }
.btn .spinner { display: none; }
.btn.is-loading { pointer-events: none; }
.btn.is-loading .btn__label { opacity: 0; }
.btn.is-loading .spinner { display: block; position: absolute; }
.spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite;
}
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.actions--end { justify-content: flex-end; }

/* --------------------------------------------------------------------------
   Estados: vazio, erro, carregamento
   -------------------------------------------------------------------------- */
.empty { text-align: center; padding: 40px 22px; }
.empty__icon {
  width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 20px;
  display: grid; place-items: center; background: var(--teal-50); color: var(--teal-700);
}
.empty__icon svg { width: 30px; height: 30px; }
.empty--error .empty__icon { background: var(--red-50); color: var(--red-700); }
.empty h2, .empty h3 { font-size: 17px; font-weight: 750; color: var(--heading); }
.empty p { font-size: 14px; color: var(--text-2); margin: 6px auto 18px; max-width: 420px; }

.skeleton {
  position: relative; overflow: hidden; background: var(--skeleton); border-radius: 10px;
}
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, var(--shimmer) 50%, transparent 100%);
  transform: translateX(-100%); animation: shimmer 1.3s ease-in-out infinite;
}
.sk-hero { height: 286px; border-radius: var(--radius-xl); background: var(--skeleton-strong); }
.sk-card { height: 214px; border-radius: var(--radius-lg); }
.sk-strip { height: 36px; width: 230px; border-radius: 999px; }
.sk-btn { width: 42px; height: 42px; border-radius: 50%; }
.sk-title { width: 190px; height: 18px; }
.sk-line { height: 14px; margin: 8px 0; }
.sk-block { height: 180px; border-radius: var(--radius-lg); }
.stat--span2 { grid-column: span 2; }

.banner {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 13px 15px; border-radius: 14px; font-size: 14px; line-height: 1.45;
  background: var(--blue-50); color: var(--info-ink);
}
.banner svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.banner strong { display: block; font-weight: 700; }
.banner--success { background: var(--green-50); color: var(--success-ink); }
.banner--warn { background: var(--amber-50); color: var(--warn-ink); }
.banner--danger { background: var(--red-50); color: var(--danger-ink); }

/* --------------------------------------------------------------------------
   Avisos flutuantes
   -------------------------------------------------------------------------- */
.toasts {
  position: fixed; left: 50%; z-index: 80; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px);
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  width: max-content; max-width: calc(100% - 32px); pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; border-radius: 999px;
  background: var(--overlay-bg); color: var(--overlay-ink); font-size: 14px; font-weight: 550;
  border: 1px solid var(--overlay-border);
  box-shadow: 0 12px 28px -10px rgba(7, 21, 40, .55);
  animation: toast-in .3s var(--ease) both;
}
.toast svg { width: 18px; height: 18px; flex: none; color: var(--teal-300); }
.toast--error svg { color: #fca5a5; }
.toast.is-leaving { animation: toast-out .25s var(--ease) both; }

/* --------------------------------------------------------------------------
   Administração
   -------------------------------------------------------------------------- */
.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
  padding: 28px 18px; border: 2px dashed var(--border-2); border-radius: var(--radius-lg);
  background: var(--surface-2); cursor: pointer;
  transition: border-color .2s, background-color .2s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--teal-500); background: var(--teal-50); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.dropzone__icon { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: var(--surface); color: var(--teal-700); box-shadow: var(--shadow-1); margin-bottom: 6px; }
.dropzone__icon svg { width: 26px; height: 26px; }
.dropzone strong { font-size: 15px; color: var(--heading); }
.dropzone span { font-size: 13px; color: var(--text-3); }

.file-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.file-row__icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--green-50); color: var(--green-700); flex: none; }
.file-row__icon svg { width: 22px; height: 22px; }
.file-row__name { flex: 1; min-width: 0; }
.file-row__name strong { display: block; font-size: 14px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-row__name span { font-size: 12.5px; color: var(--text-3); }

.progress-indeterminate { height: 4px; border-radius: 999px; background: var(--track); overflow: hidden; position: relative; }
.progress-indeterminate::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 40%; border-radius: 999px;
  background: var(--teal-500); animation: indeterminate 1.2s var(--ease) infinite;
}

.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border-radius: 14px; overflow: hidden; border: 1px solid var(--border); }
.meta-grid div { background: var(--surface); padding: 11px 13px; min-width: 0; }
.meta-grid span { display: block; font-size: 11.5px; font-weight: 600; color: var(--text-3); }
.meta-grid strong { display: block; font-size: 14px; font-weight: 650; color: var(--text); margin-top: 2px; overflow-wrap: anywhere; }
.meta-grid .mono { font-family: var(--mono); font-size: 12px; font-weight: 500; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 11.5px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase;
  color: var(--text-3); padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2);
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tbody tr.is-clickable { cursor: pointer; transition: background-color .15s; }
.table tbody tr.is-clickable:hover { background: var(--surface-2); }
.table tbody tr.is-selected { background: var(--teal-50); }
.cell-main { font-weight: 650; color: var(--text); }
.cell-sub { font-size: 12.5px; color: var(--text-3); }

.list-cards { display: flex; flex-direction: column; gap: 10px; }
.list-card { display: block; width: 100%; text-align: left; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.list-card__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.list-card__title { font-size: 14.5px; font-weight: 700; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-card__meta { font-size: 12.5px; color: var(--text-3); margin-top: 4px; }

.checks-summary { display: flex; flex-wrap: wrap; gap: 8px; }
.checks { list-style: none; margin: 0; padding: 0; }
.check-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.check-item:last-child { border-bottom: 0; }
.check-item__icon { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.check-item__icon svg { width: 15px; height: 15px; stroke-width: 2.4; }
.check-item--pass .check-item__icon { background: var(--green-50); color: var(--green-700); }
.check-item--warn .check-item__icon { background: var(--amber-50); color: var(--amber-700); }
.check-item--fail .check-item__icon { background: var(--red-50); color: var(--red-700); }
.check-item--info .check-item__icon { background: var(--blue-50); color: var(--blue-700); }
.check-item__body { min-width: 0; }
.check-item__body strong { display: block; font-size: 14px; font-weight: 650; color: var(--text); }
.check-item__body p { font-size: 13px; color: var(--text-2); margin-top: 2px; overflow-wrap: anywhere; }
.check-item__group { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
.disclosure > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; padding: 12px 0; font-size: 14px; font-weight: 650; color: var(--ink); }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary svg { width: 16px; height: 16px; transition: transform .2s; }
.disclosure[open] > summary svg { transform: rotate(90deg); }

.kpis { display: grid; grid-template-columns: 1fr; gap: 10px; }
.kpi { padding: 13px 15px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.kpi span { display: block; font-size: 12px; font-weight: 600; color: var(--text-3); }
.kpi strong { display: block; font-size: 20px; font-weight: 750; color: var(--heading); margin-top: 2px; letter-spacing: -.01em; }
.kpi--ok { background: var(--green-50); border-color: var(--ok-border); }
.kpi--bad { background: var(--red-50); border-color: var(--bad-border); }
.kpi--ok span, .kpi--bad span { color: var(--text-2); }

.card-title { font-size: 17px; font-weight: 750; color: var(--heading); letter-spacing: -.01em; }
.card-sub { font-size: 13.5px; margin-top: 3px; overflow-wrap: anywhere; }
.block-title { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); margin-bottom: 10px; }
.detail-head { display: flex; align-items: flex-start; gap: 12px; }
.detail-head__main { flex: 1; min-width: 0; }
.detail-head__badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.upload-status { font-size: 14px; }
.field__label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.user-cell { display: flex; align-items: center; gap: 12px; }
.avatar--sm { width: 36px; height: 36px; font-size: 13px; box-shadow: none; }
.audit-filter { min-width: 240px; }
.audit-list { padding: 4px 18px; }
.admin-grid > * + * { margin-top: 16px; }

.stack-gap > * + * { margin-top: 16px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.muted { color: var(--text-3); }
.only-desktop { display: none; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-3); }

/* --------------------------------------------------------------------------
   Login
   -------------------------------------------------------------------------- */
.login-page { background: var(--bg); }
.login { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.login__hero {
  position: relative; overflow: hidden;
  height: 36vh; min-height: 210px;
  color: rgba(45, 212, 191, .45);
  background: var(--login-hero-bg);
}
.login__lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.login__card {
  position: relative; z-index: 1;
  width: calc(100% - 32px); max-width: 440px; align-self: center;
  margin: -110px 0 32px;
  padding: 26px 22px 22px;
  background: var(--surface); border-radius: var(--radius-xl);
  box-shadow: 0 24px 60px -24px rgba(11, 31, 58, .4), var(--shadow-1);
  animation: rise .5s var(--ease) both;
}
.login__brand { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.login__eyebrow { font-size: 16px; font-weight: 800; letter-spacing: .16em; color: var(--heading); }
.login__sub { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.login__title { font-size: 22px; font-weight: 800; letter-spacing: -.02em; color: var(--heading); }
.login__hint { font-size: 14px; color: var(--text-2); margin: 4px 0 20px; }
.login__footer { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 18px; font-size: 12.5px; color: var(--text-3); }
.login__title--center, .login__hint--center { text-align: center; }
.login--pin .login__hero { height: 24vh; min-height: 150px; }
.login--pin .login__card { margin-top: -84px; padding-bottom: 18px; }

/* PIN: cinco pontos + teclado numérico */
.pin { display: flex; flex-direction: column; align-items: center; }
.pin__input {
  position: absolute; width: 1px; height: 1px; padding: 0; border: 0;
  opacity: 0; pointer-events: none; caret-color: transparent;
}
.pin__dots { display: flex; gap: 16px; margin: 4px 0 8px; }
.pin__dots span {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--border-2); background: transparent;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), transform .15s var(--ease);
}
.pin__dots span.is-filled { background: var(--strong-bg); border-color: var(--strong-bg); transform: scale(1.06); }
.pin__dots.is-success span { background: var(--teal-500); border-color: var(--teal-500); }
.pin__dots.is-error span { background: var(--red-500); border-color: var(--red-500); }
.pin__dots.is-error { animation: shake .45s cubic-bezier(.36, .07, .19, .97) both; }
.pin__status { min-height: 22px; margin: 4px 0 14px; font-size: 13.5px; font-weight: 550; text-align: center; color: var(--text-3); }
.pin__status[data-type="error"] { color: var(--red-700); }
.pin__status[data-type="success"] { color: var(--teal-700); }

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; max-width: 300px; }
.key {
  height: 60px; border-radius: 18px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--heading);
  font-size: 26px; font-weight: 650; font-variant-numeric: tabular-nums;
  display: grid; place-items: center;
  -webkit-user-select: none; user-select: none; touch-action: manipulation;
  transition: background-color .12s, transform .1s var(--ease), border-color .12s;
}
.key:active:not(:disabled) { transform: scale(.94); background: var(--teal-100); border-color: var(--teal-100); }
.key:disabled { opacity: .55; cursor: default; }
.key--action { background: transparent; border-color: transparent; font-size: 14px; font-weight: 600; color: var(--text-2); }
.key--action svg { width: 26px; height: 26px; }
.pin.is-busy .pin__dots span.is-filled { animation: pulse-dot 1s ease-in-out infinite; }
.pin.is-busy .pin__dots span:nth-child(2) { animation-delay: .1s; }
.pin.is-busy .pin__dots span:nth-child(3) { animation-delay: .2s; }
.pin.is-busy .pin__dots span:nth-child(4) { animation-delay: .3s; }
.pin.is-busy .pin__dots span:nth-child(5) { animation-delay: .4s; }

@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}
@keyframes pulse-dot { 50% { opacity: .45; } }

@media (hover: hover) and (pointer: fine) {
  .key:hover:not(:disabled) { background: var(--bg-2); }
  .key--action:hover:not(:disabled) { background: var(--surface-2); }
}
@media (max-height: 640px) {
  .login--pin .login__hero { height: 110px; min-height: 0; }
  .login--pin .login__card { margin-top: -60px; padding-top: 20px; }
  .login--pin .login__brand { margin-bottom: 12px; }
  .login--pin .login__hint { display: none; }
  .key { height: 52px; }
}
.login__footer svg { width: 14px; height: 14px; }
.login .btn--lg { margin-top: 4px; }

/* --------------------------------------------------------------------------
   Animações
   -------------------------------------------------------------------------- */
.rise { animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 55ms); }

@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes halo { 0% { transform: scale(.6); opacity: .9; } 80%, 100% { transform: scale(1.9); opacity: 0; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }
@keyframes indeterminate { 0% { left: -40%; } 100% { left: 100%; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
  .fresh--recent .fresh__dot::after { display: none; }
}

/* --------------------------------------------------------------------------
   Interações com mouse
   -------------------------------------------------------------------------- */
@media (hover: hover) and (pointer: fine) {
  .act:hover { box-shadow: var(--shadow-2); border-color: var(--border-2); transform: translateY(-2px); }
  .act:hover .act__chev { transform: translateX(3px); color: var(--ink); }
  .hero__link:hover { background: rgba(255, 255, 255, .16); }
  .icon-btn:hover { background: var(--surface-2); }
  .chip:hover:not([aria-pressed="true"]) { border-color: var(--border-2); color: var(--text); }
  .menu__item:hover { background: var(--surface-2); }
  .record summary:hover { background: var(--surface-2); }
  .btn--ghost:hover:not(:disabled) { background: var(--surface-2); }
}

/* --------------------------------------------------------------------------
   Telas muito estreitas (320px)
   -------------------------------------------------------------------------- */
@media (max-width: 359px) {
  .brand__text small { display: none; }
  .hero { padding: 20px 16px 16px; }
  .hero__foot { flex-wrap: wrap; row-gap: 10px; }
  .hero__link { margin-left: auto; }
  .section-head span { display: none; }
  .act__value strong { font-size: 30px; }
  .compare__item strong { font-size: 23px; }
  .fresh { font-size: 12px; padding: 6px 11px 6px 10px; }
}

/* --------------------------------------------------------------------------
   Tablet
   -------------------------------------------------------------------------- */
@media (min-width: 640px) {
  .container { padding-left: max(24px, var(--safe-l)); padding-right: max(24px, var(--safe-r)); }
  .activities { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .activities > .act:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .field-row { grid-template-columns: 1fr 1fr; }
  .meta-grid { grid-template-columns: repeat(3, 1fr); }
  .hero { padding: 26px 26px 20px; }
}

@media (min-width: 768px) {
  .sheet {
    left: 50%; right: auto; top: 50%; bottom: auto;
    width: min(580px, calc(100% - 48px));
    max-height: min(86vh, 860px);
    border-radius: var(--radius-xl);
    transform: translate(-50%, -46%) scale(.98);
    opacity: 0;
    transition: transform .3s var(--ease), opacity .25s var(--ease);
    padding-bottom: 0;
  }
  .sheet.is-open { transform: translate(-50%, -50%); opacity: 1; }
  .sheet__grab { display: none; }
  .sheet__header { padding: 18px 18px 12px 24px; }
  .sheet__body { padding: 2px 24px 26px; }
  .login { display: grid; place-items: center; position: relative; }
  .login__hero { position: absolute; inset: 0; height: auto; }
  .login__card { margin: 32px 0; padding: 34px 32px 28px; }
  .login--pin .login__hero { height: auto; }
  .login--pin .login__card { margin: 32px 0; }
}

/* --------------------------------------------------------------------------
   Computador
   -------------------------------------------------------------------------- */
@media (min-width: 1024px) {
  body { font-size: 15px; }
  .container { padding-left: 32px; padding-right: 32px; }
  .topbar__inner { height: 72px; gap: 24px; }
  .brand { flex: none; }
  .desknav { display: flex; align-items: center; gap: 4px; flex: 1; justify-content: center; }
  .desknav a {
    display: inline-flex; align-items: center; gap: 8px;
    height: 40px; padding: 0 15px; border-radius: 999px;
    font-size: 14px; font-weight: 600; color: var(--text-2);
    transition: background-color .2s, color .2s;
  }
  .desknav a svg { width: 18px; height: 18px; }
  .desknav a:hover { color: var(--heading); background: var(--nav-hover); }
  .desknav a.is-active { background: var(--surface); color: var(--heading); box-shadow: var(--shadow-1); }
  .tabbar { display: none; }
  .view { padding-bottom: 56px; padding-top: 10px; }
  .toasts { bottom: 28px; }
  .only-desktop { display: block; }
  .only-mobile { display: none !important; }

  .hero { padding: 32px 36px 24px; }
  .hero__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 48px; align-items: end; }
  .hero__meter { margin-top: 0; }
  .hero__value { font-size: 88px; }
  .hero__art { width: 210px; height: 250px; right: -24px; bottom: -64px; opacity: .06; }

  /* 5 atividades em linhas cheias: 3 na primeira, 2 mais largas na segunda */
  .activities { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
  .activities > .act { grid-column: span 2; }
  .activities > .act:nth-child(n + 4),
  .activities > .act:last-child:nth-child(odd) { grid-column: span 3; }
  .act { padding: 18px 18px 16px; }
  .page-head h1 { font-size: 28px; }
  .history-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
  .history-grid > .card + .card { margin-top: 0; }
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .meta-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1280px) {
  .meta-grid { grid-template-columns: repeat(6, 1fr); }
}

@media print {
  .topbar, .tabbar, .toasts, .status-strip .icon-btn { display: none !important; }
  .view { padding: 0; }
  .hero { box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
