/* Inter variável, servida na mesma origem. */
@font-face { font-family: Inter; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/portal/assets/fonts/inter-latin-ext-367ba6.a28eb6d3ccb534ae.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: Inter; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/portal/assets/fonts/inter-latin-bec94a.c940764593d0fe5d.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
/* Rockfy Area — sistema visual único (docs/04-UI-SPEC.md, ADR-0008).
   Tokens herdados do area-ui.css e do Rockfy DesignSystem/ui-final.html. */

/* O atributo hidden sempre vence o display das classes. */
[hidden] { display: none !important; }

:root {
  --ink: #0a0a0a;
  --on-ink: #fff;
  --ink-soft: #2c2c2c;
  --gray-900: #4a4a4a;
  --gray-600: #8d8d8d;
  --gray-300: #c9c9c9;
  --line: #e2e2e2;
  --line-soft: #efefef;
  --surface: #fff;
  --panel: #fafafa;
  --panel-2: #f4f4f4;
  --page: #fff;
  --danger: #c2402f;
  --danger-soft: #fbeceA;
  --success: #2f7d5b;
  --success-soft: #e7f4ec;
  --warning: #a8620b;
  --warning-soft: #fbf1e2;
  --info: #5468d4;
  --info-soft: #eceffd;
  --chart-series: #5468d4;
  --chart-danger: #c2402f;
  --accent: #dfffae;
  --on-accent: #0a0a0a;
  --mint: #6fffce;
  --violet: #7b8cf0;
  --ring: color-mix(in srgb, var(--ink) 18%, transparent);
  --control-border: color-mix(in srgb, var(--ink) 30%, transparent);

  --font: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(.4, 0, .2, 1);
  --rail: 264px;
  --topbar: 56px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #f2f2f2; --on-ink: #0b0b0c; --ink-soft: #d6d6d6; --gray-900: #b4b4b4; --gray-600: #8a8a8a;
    --gray-300: #4a4a4a; --line: #2a2a2d; --line-soft: #1f1f22; --surface: #121214; --panel: #161618;
    --panel-2: #1d1d20; --page: #0e0e10; --danger: #f07a68; --danger-soft: #3a1d18; --success: #6fd3a2;
    --success-soft: #16301f; --warning: #f0b45e; --warning-soft: #33260f; --info: #9aa8ff; --info-soft: #1d2140; --chart-series: #6c7ee8; --chart-danger: #e06a58;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #f2f2f2; --on-ink: #0b0b0c; --ink-soft: #d6d6d6; --gray-900: #b4b4b4; --gray-600: #8a8a8a;
  --gray-300: #4a4a4a; --line: #2a2a2d; --line-soft: #1f1f22; --surface: #121214; --panel: #161618;
  --panel-2: #1d1d20; --page: #0e0e10; --danger: #f07a68; --danger-soft: #3a1d18; --success: #6fd3a2;
  --success-soft: #16301f; --warning: #f0b45e; --warning-soft: #33260f; --info: #9aa8ff; --info-soft: #1d2140; --chart-series: #6c7ee8; --chart-danger: #e06a58;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--page); color: var(--ink); font-family: var(--font);
  font-size: 14px; line-height: 1.5; letter-spacing: -.01em; -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img, svg { display: block; }
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -.03em; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0; }
.muted { color: var(--gray-600); }
.small { font-size: 12.5px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 16px; height: 16px; flex: 0 0 auto; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------- shell
   Desenho do Area antigo (area-ui.css): barra superior de largura total,
   grade com largura máxima, sidebar recolhível só com ícones. */
:root { --max: 1440px; --header-h: 78px; --gutter: 40px; --rail-collapsed: 64px; --rail-ease: cubic-bezier(.22, .61, .36, 1); }
.header { position: sticky; top: 0; z-index: 30; height: var(--header-h); border-bottom: 1px solid var(--line-soft); }
.header::before { content: ""; position: absolute; inset: 0; background: color-mix(in srgb, var(--page) 88%, transparent); backdrop-filter: saturate(180%) blur(14px); pointer-events: none; }
.header-in { position: relative; max-width: var(--max); height: 100%; margin: 0 auto; padding: 0 var(--gutter); display: flex; align-items: center; gap: 18px; min-width: 0; }
.brand { display: flex; align-items: center; flex: none; text-decoration: none; }
.brand img { width: 112px; height: auto; }
.brand .logo-dark { display: none; }
:root[data-theme="dark"] .brand .logo-light { display: none; }
:root[data-theme="dark"] .brand .logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand .logo-light { display: none; }
  :root:not([data-theme="light"]) .brand .logo-dark { display: block; }
}
.brand-sep { width: 1px; height: 26px; background: var(--line); flex: none; }
.crumbs { display: flex; align-items: center; gap: 9px; min-width: 0; flex: 1 1 8rem; color: var(--gray-600); font-size: 14px; }
.crumbs a { text-decoration: none; white-space: nowrap; }
.crumbs a:hover { color: var(--ink); }
.crumbs .sep { color: var(--gray-300); }
.crumbs .now { color: var(--ink); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-tag { display: inline-flex; align-items: center; gap: 5px; }
.admin-tag .nav-icon { width: 12px; height: 12px; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }

/* Menus suspensos (workspace e conta). */
.menu-details { position: relative; }
.menu-details > summary { list-style: none; cursor: pointer; }
.menu-details > summary::-webkit-details-marker { display: none; }
.menu {
  position: absolute; z-index: 45; top: calc(100% + 8px); width: min(260px, calc(100vw - 24px)); max-height: min(70dvh, calc(100dvh - var(--header-h) - 12px));
  overflow: auto; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: 0 20px 50px rgb(0 0 0 / .1);
}
.menu-details:not([open]) > .menu { display: none; }
.menu-details[open] > .menu { animation: menu-in .16s var(--ease); }
@keyframes menu-in { from { opacity: 0; } }
.menu-tenant { left: 0; width: min(280px, calc(100vw - 24px)); }
.menu-profile { right: 0; }
.menu a, .menu form button {
  display: flex; align-items: center; gap: 11px; width: 100%; min-width: 0; padding: 9px 10px; border: 0; border-radius: var(--r-md);
  background: transparent; color: var(--ink); font: inherit; font-size: 14px; text-align: left; text-decoration: none; cursor: pointer;
}
.menu a:hover, .menu form button:hover, .menu a[aria-current="true"] { background: var(--panel); }
.menu .nav-icon { width: 17px; height: 17px; color: var(--gray-600); }
.menu .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu .k { font-size: 11px; color: var(--gray-600); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.menu form { margin: 0; }
.menu-sep { margin: 4px 10px 8px; font-size: 10.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--gray-600); }
.menu-head { padding: 10px 10px 12px; margin-bottom: 6px; border-bottom: 1px solid var(--line-soft); }
.menu-head .t { font-size: 14.5px; font-weight: 600; overflow-wrap: anywhere; }
.menu-head .s { font-size: 12.5px; color: var(--gray-600); overflow-wrap: anywhere; }
.menu-foot { margin-top: 6px; border-top: 1px solid var(--line-soft) !important; border-radius: 0 0 var(--r-md) var(--r-md) !important; }
.tenant-ini { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--panel-2); color: var(--gray-900); font-size: 12px; font-weight: 600; }
.menu a[aria-current="true"] .tenant-ini { background: var(--accent); color: var(--on-accent); }

/* Workspace no breadcrumb. */
.tenantcrumb { display: flex; align-items: center; gap: 9px; min-width: 0; max-width: 260px; padding: 5px 12px 5px 5px; border: 1px solid transparent; border-radius: 999px; transition: border-color .15s var(--ease), background .15s var(--ease); }
.tenantcrumb:hover, .workspace[open] .tenantcrumb { border-color: var(--line); background: var(--surface); }
.tenantcrumb .ini { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 600; }
.tenantcrumb .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-weight: 500; letter-spacing: -.2px; }
.chev { width: 6px; height: 6px; flex: none; border-right: 1.5px solid var(--gray-600); border-bottom: 1.5px solid var(--gray-600); transform: translateY(-2px) rotate(45deg); transition: transform .15s var(--ease); }
.menu-details[open] .chev { transform: translateY(1px) rotate(225deg); }

/* Conta. */
.profilebtn { display: flex; align-items: center; gap: 9px; padding: 4px 12px 4px 4px; border: 1px solid transparent; border-radius: 999px; }
.profilebtn:hover, .menu-details[open] > .profilebtn { border-color: var(--line); }
.profilebtn .av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line); font-size: 11.5px; font-weight: 600; }
.profilebtn .t { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }

/* Grade: sidebar + conteúdo, com largura máxima. */
.shell { max-width: var(--max); margin: 0 auto; display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); align-items: start; transition: grid-template-columns .32s var(--rail-ease); }
.rail {
  position: sticky; top: var(--header-h); height: calc(100dvh - var(--header-h)); display: flex; flex-direction: column; min-height: 0;
  padding: 26px 14px 18px; border-right: 1px solid var(--line-soft); overflow-x: hidden; overflow-y: auto; scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail-collapse {
  position: absolute; top: 14px; right: 12px; z-index: 1; width: 32px; height: 32px; display: grid; place-items: center;
  border: 0; border-radius: 8px; background: transparent; color: var(--gray-600); cursor: pointer; transition: background .15s, color .15s;
}
.rail-collapse:hover { color: var(--ink); background: var(--panel-2); }
.rail-collapse:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.rail-collapse svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .32s var(--rail-ease); }
.navgroup { display: grid; gap: 4px; }
.navgroup:first-of-type { margin-top: 30px; }
.navgroup + .navgroup { margin-top: 26px; }
.navlabel { margin: 0 0 6px; padding: 0 14px; font-size: 10.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--gray-600); white-space: nowrap; }
.navitem {
  display: flex; align-items: center; gap: 13px; width: 100%; padding: 10px 14px; border: 1px solid transparent; border-radius: var(--r-md);
  color: var(--gray-600); font-size: 15px; letter-spacing: -.2px; text-decoration: none; transition: color .15s, border-color .15s, background .15s;
}
.navitem .nav-icon { width: 19px; height: 19px; flex: none; }
.navitem .txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.navitem:hover { color: var(--ink); border-color: var(--line); }
.navitem[aria-current="page"] { background: var(--panel-2); color: var(--ink); font-weight: 500; }
.rail-foot { margin-top: auto !important; padding-top: 18px; }
.menu-toggle { display: none; }
.page { min-width: 0; }
.icon-btn {
  width: 34px; height: 34px; display: inline-grid; place-items: center; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink); cursor: pointer;
}
.icon-btn:hover { background: var(--panel-2); }
.icon-btn .nav-icon { width: 18px; height: 18px; }
.icon-btn.menu-toggle { display: none; }

@media (min-width: 1024px) {
  :root[data-rail="collapsed"] { --rail: var(--rail-collapsed); }
  :root[data-rail="collapsed"] .rail { padding-inline: 8px; }
  :root[data-rail="collapsed"] .rail-collapse { right: 16px; }
  :root[data-rail="collapsed"] .rail-collapse svg { transform: rotate(180deg); }
  :root[data-rail="collapsed"] .navlabel,
  :root[data-rail="collapsed"] .navitem .txt { display: none; }
  :root[data-rail="collapsed"] .navgroup + .navgroup { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
  :root[data-rail="collapsed"] .navitem { width: 42px; height: 42px; margin-inline: auto; padding: 0; justify-content: center; gap: 0; }
  :root[data-rail="collapsed"] .navitem .nav-icon { width: 18px; height: 18px; }
}
@media (prefers-reduced-motion: reduce) { .shell, .rail-collapse svg { transition: none; } }
.admin-banner {
  display: flex; align-items: center; gap: 12px; padding: 8px var(--gutter); background: var(--warning-soft);
  color: var(--warning); font-size: 13px; border-bottom: 1px solid var(--line);
}
.admin-banner form { margin-left: auto; }

.page { width: 100%; margin: 0 auto; padding: 36px var(--gutter) 80px; }
.page.narrow { max-width: 760px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head h1 { font-size: 34px; line-height: 1.1; }
.page-head .lead { margin-top: 8px; color: var(--gray-600); font-size: 14.5px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.eyebrow { color: var(--gray-600); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 8px; }
.title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.meta-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; color: var(--gray-600); font-size: 13px; }
.meta-row .dot-sep::before { content: "·"; }
.section { margin-top: 36px; }
.section > h2, .section-head h2 { font-size: 19px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-head p { color: var(--gray-600); font-size: 13.5px; margin-top: 4px; }

/* ---------------------------------------------------------------- tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 28px; overflow-x: auto; }
.tabs a {
  padding: 10px 12px; margin-bottom: -1px; color: var(--gray-600); text-decoration: none; white-space: nowrap;
  border-bottom: 2px solid transparent; font-size: 14px;
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); font-weight: 500; }

/* ---------------------------------------------------------------- botões */
.btn {
  min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px;
  border: 1px solid var(--ink); border-radius: var(--r-sm); background: var(--surface); color: var(--ink);
  font: inherit; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .18s var(--ease), opacity .18s var(--ease);
}
.btn:hover { background: var(--panel-2); }
.btn:focus-visible, .icon-btn:focus-visible, .navitem:focus-visible, .tenantcrumb:focus-visible, .profilebtn:focus-visible, .tabs a:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.btn.primary { background: var(--ink); color: var(--on-ink); }
.btn.primary:hover { opacity: .86; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--panel-2); }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.danger.solid { background: var(--danger); color: #fff; }
.btn.sm { min-height: 30px; padding: 0 11px; font-size: 13px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn[data-loading] { opacity: .7; pointer-events: none; }
.inline-form { display: inline; margin: 0; }
.link-btn { border: 0; background: none; padding: 0; color: inherit; font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

/* ---------------------------------------------------------------- formulários */
.form { display: grid; gap: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: grid; gap: 7px; min-width: 0; align-content: start; }
.field.full { grid-column: 1 / -1; }
.field > label, .field > .label { font-size: 13px; font-weight: 500; color: var(--ink-soft); }
.field .help { font-size: 12px; color: var(--gray-600); }
.field .error { font-size: 12.5px; color: var(--danger); }
.input, select.input, textarea.input {
  width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--control-border); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; outline: none;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
textarea.input { min-height: 96px; resize: vertical; }
/* Select com seta própria: espaço à direita e a mesma altura dos campos. */
select.input {
  appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%238d8d8d' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 14px;
}
select.input::-ms-expand { display: none; }
.input.sm, select.input.sm { min-height: 34px; padding-top: 5px; padding-bottom: 5px; font-size: 13.5px; }
select.input.sm { padding-right: 32px; background-position: right 10px center; }
.input::placeholder { color: color-mix(in srgb, var(--ink) 38%, transparent); }
.input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px var(--ring); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input:disabled { opacity: .55; cursor: not-allowed; }
.input-affix { display: flex; align-items: stretch; }
.input-affix .input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-affix .affix {
  display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--control-border); border-left: 0;
  border-radius: 0 var(--r-sm) var(--r-sm) 0; background: var(--panel); color: var(--gray-600); font-size: 13px; white-space: nowrap;
}
.checkbox { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--ink); }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.form-actions .left { margin-right: auto; }

/* ---------------------------------------------------------------- painéis */
.panel { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.panel-body { padding: 20px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.panel-head .eyebrow { margin-bottom: 2px; text-transform: none; letter-spacing: 0; font-size: 12.5px; }
.panel-head h2, .panel-head h3 { font-size: 16.5px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.grid-2 > *, .grid-3 > *, .stack > * { min-width: 0; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stack { display: grid; gap: 16px; }
.stat { padding: 18px 20px; }
.stat .label { color: var(--gray-600); font-size: 13px; }
.stat .value { font-size: 34px; letter-spacing: -.04em; line-height: 1.15; margin-top: 6px; }
.stat .hint { color: var(--gray-600); font-size: 12.5px; margin-top: 2px; }
.kv { display: grid; gap: 14px; }
.kv > div { display: grid; gap: 2px; }
.kv dt, .kv .k { color: var(--gray-600); font-size: 12.5px; }
.kv dd, .kv .v { margin: 0; font-size: 14px; word-break: break-word; }
.tile-icon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--panel-2); margin-bottom: 14px; }

/* ---------------------------------------------------------------- listas e tabelas */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.row-link, .row { display: flex; align-items: center; gap: 14px; padding: 14px 20px; text-decoration: none; min-width: 0; }
.row-link:hover { background: var(--panel); }
.row-main { flex: 1; min-width: 0; }
.row-title { display: block; font-weight: 500; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { display: block; color: var(--gray-600); font-size: 12.5px; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-end { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; flex: 0 1 auto; color: var(--gray-600); font-size: 13px; }
.row-main { flex: 1 1 140px; }
.app-mark {
  width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel);
  display: grid; place-items: center; flex: 0 0 auto;
}
.app-mark img { width: 18px; height: 18px; }
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; font-weight: 500; color: var(--gray-600); font-size: 11.5px; letter-spacing: .06em;
  text-transform: uppercase; padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .nowrap, .nowrap { white-space: nowrap; }
.table a { text-decoration: none; font-weight: 500; }
.table a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- status */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px;
  font-weight: 500; background: var(--panel-2); color: var(--gray-900); white-space: nowrap; line-height: 20px;
  letter-spacing: 0;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.warning { background: var(--warning-soft); color: var(--warning); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.progress::before { animation: pulse 1.2s ease-in-out infinite; }
.tag { display: inline-flex; padding: 1px 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); font-size: 11.5px; color: var(--gray-900); letter-spacing: 0; font-weight: 400; }
.status-dot {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto;
  background: var(--panel-2); color: var(--gray-600);
}
.status-dot.success { background: var(--success-soft); color: var(--success); }
.status-dot.danger { background: var(--danger-soft); color: var(--danger); }
.status-dot.progress { background: var(--info-soft); color: var(--info); }
.status-dot .icon { width: 13px; height: 13px; stroke-width: 2; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .3; } }

/* ---------------------------------------------------------------- feedback */
.flash {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; margin-bottom: 20px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--panel); font-size: 14px;
}
.flash.success { border-color: color-mix(in srgb, var(--success) 35%, transparent); background: var(--success-soft); color: var(--success); }
.flash.error { border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: var(--danger-soft); color: var(--danger); }
.notice { padding: 14px 16px; border-radius: var(--r-md); background: var(--panel); border: 1px dashed var(--line); color: var(--gray-900); font-size: 13.5px; }
.empty { display: grid; justify-items: center; gap: 10px; padding: 56px 24px; text-align: center; }
.empty h2 { font-size: 20px; }
.empty p { color: var(--gray-600); max-width: 420px; }
.empty .actions { margin-top: 8px; display: flex; gap: 8px; }

/* ---------------------------------------------------------------- deploy */
.dropzone {
  display: grid; justify-items: center; gap: 10px; padding: 40px 24px; text-align: center; cursor: pointer;
  border: 1.5px dashed var(--control-border); border-radius: var(--r-lg); background: var(--panel);
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.dropzone:hover, .dropzone.drag { border-color: var(--ink); background: var(--panel-2); }
.dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone .title { font-weight: 500; font-size: 15px; }
.dropzone .picked { font-family: var(--mono); font-size: 12.5px; color: var(--ink); }
.source-modes { display: flex; gap: 8px; flex-wrap: wrap; }
.source-modes label {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid var(--line);
  border-radius: 999px; cursor: pointer; font-size: 13px;
}
.source-modes input { accent-color: var(--ink); }
.progress-bar { height: 4px; border-radius: 4px; background: var(--panel-2); overflow: hidden; }
.progress-bar > span { display: block; height: 100%; width: 0; background: var(--ink); transition: width .2s linear; }
.url-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
  font-family: var(--mono); font-size: 12.5px; text-decoration: none; background: var(--surface);
}
.url-pill:hover { border-color: var(--ink); }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { position: relative; display: grid; grid-template-columns: 20px 1fr auto; gap: 12px; padding: 10px 20px; align-items: start; font-size: 13.5px; }
/* Linha contínua ligando os eventos: do centro de um marcador ao próximo. */
.timeline li:not(:last-child)::before { content: ""; position: absolute; left: 29px; top: 21px; bottom: -11px; width: 2px; margin-left: -1px; background: var(--line); }
.timeline .mark { position: relative; z-index: 1; width: 10px; height: 10px; border-radius: 50%; margin: 6px auto 0; background: var(--gray-300); box-shadow: 0 0 0 3px var(--surface); }
.timeline.compact li { padding: 6px 0; grid-template-columns: 16px 1fr auto; gap: 10px; font-size: 13px; }
.timeline.compact li:not(:last-child)::before { left: 8px; top: 15px; bottom: -9px; }
.timeline .success .mark { background: var(--success); }
.timeline .error .mark { background: var(--danger); }
.timeline time { color: var(--gray-600); font-size: 12px; font-family: var(--mono); }
.steps { display: grid; gap: 14px; margin-bottom: 8px; }
.steps li { display: flex; align-items: center; gap: 12px; color: var(--gray-600); }
.steps .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); font-size: 12px; }
.steps li[aria-current="step"] { color: var(--ink); }
.steps li[aria-current="step"] .n { background: var(--ink); color: var(--on-ink); }
.env-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 10px; align-items: center; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }

/* ---------------------------------------------------------------- login */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-side {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 40px;
  background: #0a0a0a; color: #fff; overflow: hidden;
}
.auth-side::after {
  content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--mint), transparent 62%); opacity: .55; filter: blur(8px);
}
.auth-side h2 { font-size: 40px; line-height: 1.08; max-width: 420px; position: relative; z-index: 1; }
.auth-side p { color: #a8a8a8; max-width: 380px; margin-top: 14px; position: relative; z-index: 1; }
.auth-main { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 380px; display: grid; gap: 22px; }
.auth-card h1 { font-size: 28px; }
.auth-card .lead { color: var(--gray-600); margin-top: 6px; }
.code-input { font-family: var(--mono); font-size: 22px; letter-spacing: .5em; text-align: center; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--gray-600); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.dev-code { padding: 10px 12px; border-radius: var(--r-sm); background: var(--accent); color: var(--on-accent); font-size: 13px; }

/* ---------------------------------------------------------------- dialog */
dialog.modal {
  width: min(480px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); color: var(--ink); box-shadow: 0 24px 64px rgba(0, 0, 0, .18);
}
dialog.modal::backdrop { background: rgba(10, 10, 10, .35); }
dialog.modal .panel-body { display: grid; gap: 16px; }

/* ---------------------------------------------------------------- responsivo */
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail {
    position: fixed; z-index: 40; top: 0; left: 0; bottom: 0; height: 100dvh; width: min(300px, 86vw); transform: translateX(-100%);
    transition: transform .22s var(--ease); box-shadow: 0 0 40px rgba(0, 0, 0, .18); background: var(--surface);
  }
  .rail-collapse { display: none; }
  body.rail-open .rail { transform: none; }
  body.rail-open::after { content: ""; position: fixed; inset: 0; z-index: 35; background: rgba(10, 10, 10, .3); }
  .icon-btn.menu-toggle { display: inline-grid; }
  :root { --header-h: 64px; --gutter: 16px; }
  .header-in { gap: 10px; }
  .brand img { width: 92px; }
  .brand-sep, .crumbs .sep, .crumbs a, .crumbs .now, .admin-tag { display: none; }
  .profilebtn .t, .profilebtn .chev { display: none; }
  .profilebtn { padding: 2px; }
  .tenantcrumb { max-width: 160px; padding-right: 8px; }
  .page { padding: 24px 16px 64px; }
  .page-head h1 { font-size: 27px; }
  .grid-2, .grid-3, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-side { display: none; }
  .row-end .hide-sm { display: none; }
  .env-row { grid-template-columns: minmax(0, 1fr); }
  .admin-banner { padding: 8px 16px; }
}

/* Lista de deploys com ação lateral (logs). */
.list > li.row-with-action { display: flex; align-items: center; }
.row-with-action > .row-link { flex: 1; min-width: 0; }
.row-with-action > .btn, .row-with-action > .inline-form { margin-right: 4px; flex: none; }
.row-with-action > :is(.btn, .inline-form):nth-last-child(1 of .btn, .inline-form) { margin-right: 14px; }
.kv dd.dd-action { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kv dd.dd-action .btn { margin: -4px -6px -4px 0; }

/* Log do build (página do deploy e popover). */
.build-log { margin: 0; padding: 16px 20px; max-height: 360px; overflow: auto; white-space: pre-wrap; word-break: break-word; background: var(--panel); font-family: var(--mono); font-size: 12.5px; line-height: 1.55; }
.logs-popover .build-log { padding: 12px 14px; border-radius: var(--r-md); }

/* Popover de logs (atributo popover nativo). */
.logs-popover { width: min(720px, calc(100vw - 32px)); max-height: min(78vh, 760px); overflow: auto; margin: auto; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--ink); box-shadow: 0 24px 60px rgb(0 0 0 / .18); }
.logs-popover::backdrop { background: rgb(0 0 0 / .28); }
.logs-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.logs-head a { margin-left: auto; }
.logs-error { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-md); background: var(--danger-soft); color: var(--danger); font-size: 13.5px; margin: 0 0 12px; }
.logs-sub { margin: 14px 0 6px; color: var(--gray-600); font-size: 12.5px; }
.logs-popover .build-log { max-height: 340px; }

/* Gráficos (src/ui/charts.tsx): uma série, barras finas com topo arredondado. */
.grid-2.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chart { margin: 0; --c: var(--chart-series); }
.chart.tone-danger { --c: var(--chart-danger); }
.chart-plot { position: relative; height: 180px; margin-left: 44px; }
.chart-grid { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.chart-grid span { position: relative; border-top: 1px solid var(--line-soft); }
.chart-grid span:last-child { border-top-color: var(--line); }
.chart-grid span::before { content: attr(data-v); position: absolute; right: calc(100% + 8px); top: -8px; font-size: 11.5px; color: var(--gray-600); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart-bars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; }
.chart-bars .bar { flex: 1; height: 100%; display: flex; align-items: flex-end; cursor: default; }
.chart-bars .bar i { display: block; width: 100%; max-width: 22px; margin: 0 auto; border-radius: 4px 4px 0 0; background: var(--c); }
.chart-bars .bar:hover i, .chart-bars .bar.on i { filter: brightness(1.12); }
.chart-bars .bar:hover, .chart-bars .bar.on { background: color-mix(in srgb, var(--c) 8%, transparent); }
.chart-bars .bar.none { background: repeating-linear-gradient(135deg, transparent 0 4px, var(--line-soft) 4px 5px); }
.chart-marker { position: absolute; top: -6px; bottom: 0; width: 0; border-left: 2px dashed var(--ink); opacity: .55; }
.chart-marker::before { content: ""; position: absolute; top: -2px; left: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.chart-marker:hover { opacity: 1; }
.chart-marker::after { content: ""; position: absolute; inset: 0 -8px; }
.chart-axis { display: flex; justify-content: space-between; margin: 8px 0 0 44px; font-size: 11.5px; color: var(--gray-600); }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--gray-600); font-size: 13px; }
.chart-table { margin-top: 10px; font-size: 12.5px; }
.chart-table summary { cursor: pointer; color: var(--gray-600); width: fit-content; }
.chart-table table { margin-top: 8px; max-width: 320px; }
.chart-tip { position: fixed; z-index: 50; pointer-events: none; padding: 6px 9px; border-radius: var(--r-sm); background: var(--ink); color: var(--on-ink); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); }
@media (max-width: 860px) { .grid-2.even { grid-template-columns: minmax(0, 1fr); } }

/* Ícone quadrado em linhas de lista (ex.: contas do GitHub). */
.row-icon { flex: none; width: 34px; height: 34px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--panel-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .gh-icon { filter: invert(1); } }
:root[data-theme="dark"] .gh-icon { filter: invert(1); }

/* Faixa de métricas da visão geral (desenho do Area antigo, ds-application). */
.band-slot { margin-bottom: 16px; }
.metrics-band { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .75fr); gap: 16px; }
.band-block { min-width: 0; min-height: 286px; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; padding: 18px 20px 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.band-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.band-head .eyebrow { text-transform: none; letter-spacing: 0; font-size: 12.5px; color: var(--gray-600); }
.band-number-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.band-number { font-size: clamp(38px, 4.4vw, 60px); font-weight: 300; line-height: .95; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.band-unit { font-size: 12px; color: var(--gray-600); }
.band-note { margin: 10px 0 0; font-size: 12.5px; color: var(--gray-600); }
.traffic { align-self: end; display: grid; gap: 9px; margin-top: 18px; }
.traffic-bars { position: relative; height: 128px; display: grid; grid-template-columns: repeat(var(--slots, 24), minmax(2px, 1fr)); align-items: end; gap: clamp(2px, .42vw, 5px); border-bottom: 1px solid var(--line); }
.traffic-bar { position: relative; height: var(--v); min-height: 3px; border-radius: 3px 3px 0 0; background: color-mix(in srgb, var(--chart-series) 30%, transparent); transform: scaleY(0); transform-origin: center bottom; transition: transform .65s cubic-bezier(.2, .75, .2, 1), background-color .16s var(--ease); transition-delay: calc(var(--i, 0) * 18ms); outline: none; }
.traffic-bar.recent { background: var(--chart-series); }
.is-visible .traffic-bar, .metrics-band:not([data-animate]) .traffic-bar { transform: scaleY(1); }
.traffic-bar:hover, .traffic-bar:focus-visible { background: var(--chart-series); }
.traffic-bar > span { position: absolute; left: 50%; bottom: calc(100% + 8px); z-index: 5; transform: translate(-50%, 4px); padding: 5px 8px; border-radius: var(--r-sm); background: var(--ink); color: var(--on-ink); font-size: 11.5px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .14s var(--ease), transform .14s var(--ease); font-variant-numeric: tabular-nums; }
.traffic-bar:hover > span, .traffic-bar:focus-visible > span { opacity: 1; transform: translate(-50%, 0); }
.traffic-bar:first-child > span { left: 0; transform: translate(0, 4px); }
.traffic-bar:last-child > span { left: auto; right: 0; transform: translate(0, 4px); }
.traffic-bar:first-child:hover > span, .traffic-bar:last-child:hover > span { transform: none; }
.traffic-axis { display: flex; justify-content: space-between; font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--gray-600); }
.seg-dial { position: relative; align-self: end; width: 100%; max-width: 330px; margin: 14px auto 0; }
.seg-dial svg { display: block; width: 100%; overflow: visible; }
.seg-dial line { stroke: var(--line); stroke-width: 2.6; stroke-linecap: round; transition: stroke .18s ease; }
.seg-dial line.on { stroke: var(--chart-series); }
.seg-dial-center { position: absolute; left: 50%; bottom: 6%; transform: translateX(-50%); display: grid; justify-items: center; gap: 6px; width: 100%; text-align: center; }
.seg-dial-value { font-size: clamp(28px, 3.4vw, 40px); font-weight: 300; letter-spacing: -.045em; line-height: 1; font-variant-numeric: tabular-nums; }
.seg-dial-cap { font-size: 12px; color: var(--gray-600); }
[data-band-src] .metrics-band:not([data-loaded]) .traffic-bar { transform: scaleY(1); opacity: .5; }
@media (max-width: 860px) { .metrics-band { grid-template-columns: minmax(0, 1fr); } .band-block { min-height: 0; } }
@media (prefers-reduced-motion: reduce) { .traffic-bar { transition: none; transform: scaleY(1); } .seg-dial line { transition: none; } }

/* Painel lateral (popover nativo). */
.drawer { position: fixed; inset: 0 0 0 auto; width: min(560px, 100vw); height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; border-left: 1px solid var(--line); background: var(--surface); color: var(--ink); display: none; flex-direction: column; box-shadow: -24px 0 60px rgb(0 0 0 / .14); }
.drawer:popover-open { display: flex; animation: drawer-in .22s var(--ease); }
.drawer::backdrop { background: rgb(0 0 0 / .28); }
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0; } }
.drawer-head { display: flex; justify-content: space-between; gap: 12px; padding: 20px 22px 14px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 17px; }
.drawer-body { flex: 1; overflow: auto; padding: 18px 22px; display: grid; align-content: start; gap: 14px; }
.drawer-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--panel); }
.drawer-actions { display: flex; gap: 8px; margin-left: auto; }
@media (prefers-reduced-motion: reduce) { .drawer:popover-open { animation: none; } }

/* Interruptor (checkbox estilizado). */
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch i { position: relative; flex: none; width: 34px; height: 20px; border-radius: 999px; background: var(--gray-300); transition: background .16s var(--ease); }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .2); transition: transform .16s var(--ease); }
.switch input:checked + i { background: var(--ink); }
.switch input:checked + i::after { transform: translateX(14px); }
.switch input:focus-visible + i { outline: 2px solid var(--ring); outline-offset: 2px; }
.switch.small { font-size: 12.5px; }

/* Variáveis de ambiente. */
.env-list-row { gap: 14px; }
.env-reveal { display: inline-flex; align-items: center; gap: 2px; min-width: 0; max-width: 55%; }
.env-reveal code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 3px 8px; border-radius: var(--r-sm); background: var(--panel-2); margin-right: 4px; }
.env-secret-tag { display: inline-flex; align-items: center; gap: 6px; color: var(--gray-600); font-size: 12.5px; }
.env-secret-tag .icon { width: 14px; height: 14px; }
.env-import { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border: 1.5px dashed var(--line); border-radius: var(--r-md); cursor: pointer; font-size: 13.5px; transition: border-color .15s, background .15s; }
.env-import:hover, .env-import.drag { border-color: var(--ink); background: var(--panel); }
.env-items { display: grid; gap: 10px; }
.env-item { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.env-item.flash { animation: env-flash 1.2s var(--ease); }
@keyframes env-flash { from { background: var(--info-soft); border-color: var(--info); } }
.env-item-fields { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 8px; align-items: start; }
.env-value { position: relative; }
.env-value .input { padding-right: 38px; }
.env-value .icon-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.env-item-foot { display: flex; align-items: center; gap: 10px; }
.env-item-foot .btn { margin-left: auto; }
@media (max-width: 560px) { .env-item-fields { grid-template-columns: minmax(0, 1fr); } }
.env-multiline { resize: vertical; min-height: 40px; line-height: 1.45; padding-top: 8px; }
.env-multiline.masked { -webkit-text-security: disc; text-security: disc; }
.env-value:has(.env-multiline) .icon-btn { top: 6px; transform: none; }

/* DNS: lista editável na linha (desenho do Area antigo). */
.dns-add { margin-bottom: 16px; }
.dns-add > summary { cursor: pointer; list-style: none; align-items: center; }
.dns-add > summary::-webkit-details-marker { display: none; }
.dns-add > summary > span:first-child { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.dns-add:not([open]) > summary { border-bottom: 0; }
/* Colunas fixas em todas as linhas: a prioridade tem lugar reservado e só aparece no MX. */
.dns-fields { display: grid; grid-template-columns: 112px minmax(0, .9fr) minmax(0, 1.5fr) 104px 92px auto; gap: 8px; align-items: center; min-width: 0; }
.dns-fields:not([data-type="MX"]) .dns-prio { visibility: hidden; }
.dns-list { overflow: hidden; }
.dns-toolbar { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.dns-toolbar .input { max-width: 340px; }
.dns-row { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px 20px; border-bottom: 1px solid var(--line-soft); transition: background .15s; }
.dns-row.dirty { background: color-mix(in srgb, var(--info) 7%, transparent); box-shadow: inset 3px 0 0 var(--info); }
.dns-row.locked { background: var(--panel); }
.dns-check { width: 16px; height: 16px; accent-color: var(--ink); }
.dns-readonly { display: flex; align-items: center; gap: 12px; min-height: 42px; font-size: 13px; flex-wrap: wrap; }
.dns-readonly code { font-family: var(--mono); font-size: 12.5px; }
.dns-content { color: var(--gray-900); word-break: break-all; }
.dns-readonly .tag.info { display: inline-flex; align-items: center; gap: 5px; text-decoration: none; margin-left: auto; }
.dns-readonly .tag .icon { width: 12px; height: 12px; }
.dns-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 20px; background: var(--panel); }
.dns-foot-actions { display: flex; gap: 8px; }
.btn.danger.ghost { color: var(--danger); }
/* Proxy da Cloudflare: ícone + interruptor laranja. */
.cf-proxy { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 4px 8px 4px 10px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); font-size: 12.5px; color: var(--gray-900); cursor: pointer; white-space: nowrap; }
.cf-proxy img { flex: none; }
.cf-proxy .switch input:checked + i { background: #f38020; }
.cf-proxy:has(input:disabled) { opacity: .45; cursor: not-allowed; }
.cf-proxy:has(input:checked) { border-color: color-mix(in srgb, #f38020 45%, var(--line)); background: color-mix(in srgb, #f38020 8%, var(--panel)); }
.cf-dot { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; opacity: .35; filter: grayscale(1); }
.cf-dot.on { opacity: 1; filter: none; background: color-mix(in srgb, #f38020 12%, transparent); }
.input-suffix { display: flex; align-items: center; gap: 0; border: 1px solid var(--control-border); border-radius: var(--r-md); overflow: hidden; }
.input-suffix .input { border: 0; border-radius: 0; flex: 1; min-width: 0; }
.input-suffix span { padding: 0 12px; color: var(--gray-600); font-size: 13px; background: var(--panel); align-self: stretch; display: grid; place-items: center; border-left: 1px solid var(--line); }
@media (max-width: 980px) {
  .dns-fields { grid-template-columns: 112px minmax(0, 1fr); }
  .dns-fields > :nth-child(3) { grid-column: 1 / -1; }
  .dns-fields:not([data-type="MX"]) .dns-prio { display: none; }
}

/* Popover de confirmação (ex.: excluir aplicação). */
.confirm-pop { width: min(460px, calc(100vw - 32px)); margin: auto; padding: 24px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--ink); box-shadow: 0 24px 60px rgb(0 0 0 / .2); }
.confirm-pop:popover-open { display: grid; gap: 12px; animation: confirm-in .18s var(--ease); }
.confirm-pop::backdrop { background: rgb(0 0 0 / .32); }
.confirm-pop h2 { font-size: 18px; }
.confirm-pop p { margin: 0; }
.confirm-pop .form-actions { margin-top: 4px; }
.confirm-pop-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--danger-soft); color: var(--danger); }
@keyframes confirm-in { from { transform: translateY(6px) scale(.98); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .confirm-pop:popover-open { animation: none; } }

/* Nota informativa dentro de formulários. */
.note { margin: 0; padding: 10px 12px; border-radius: var(--r-md); background: var(--info-soft); color: var(--ink); line-height: 1.5; }
.note code { font-size: 12px; }

/* Toasts: sutis, no canto, sem empurrar o layout. */
.toasts { position: fixed; z-index: 80; right: 24px; bottom: 24px; display: grid; gap: 8px; justify-items: end; width: min(400px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 12px 10px 12px 14px;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--ink);
  box-shadow: 0 10px 30px rgb(0 0 0 / .08), 0 2px 6px rgb(0 0 0 / .04); font-size: 13.5px; line-height: 1.45;
  animation: toast-in .24s var(--ease);
}
.toast.leaving { animation: toast-out .2s var(--ease) forwards; }
.toast-icon { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; margin-top: 0; }
.toast-icon .icon { width: 12px; height: 12px; stroke-width: 2.4; }
.toast.success .toast-icon { background: var(--success-soft); color: var(--success); }
.toast.error .toast-icon { background: var(--danger-soft); color: var(--danger); }
.toast.info .toast-icon { background: var(--info-soft); color: var(--info); }
.toast-text { flex: 1; min-width: 0; overflow-wrap: anywhere; padding-top: 1px; }
.toast-close { flex: none; width: 24px; height: 24px; margin: -2px 0; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--gray-600); cursor: pointer; }
.toast-close:hover { background: var(--panel-2); color: var(--ink); }
.toast-close .icon { width: 13px; height: 13px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }
@media (max-width: 900px) { .toasts { right: 16px; left: 16px; bottom: 16px; width: auto; justify-items: stretch; } }
@media (prefers-reduced-motion: reduce) { .toast, .toast.leaving { animation: none; } }

/* Linha com ações embaixo (painéis estreitos). */
.row.row-stacked { flex-wrap: wrap; row-gap: 10px; }
.row.row-stacked .row-end { flex: 1 0 100%; justify-content: flex-start; }
.row-end form { display: inline-flex; margin: 0; }
.nowrap { white-space: nowrap; }

/* Repeater de registros novos. */
.dns-new { display: grid; gap: 12px; }
.dns-new-rows { display: grid; gap: 10px; }
.dns-new-row { display: grid; grid-template-columns: minmax(0, 1fr) 34px; gap: 8px; align-items: center; }
.dns-new-row:has([data-dns-new-remove][hidden]) { grid-template-columns: minmax(0, 1fr); }
.dns-new-row + .dns-new-row { padding-top: 10px; border-top: 1px dashed var(--line); }
.dns-new-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 4px; }
.dns-new-foot .btn.primary { margin-left: auto; }
.dns-new-row .icon-btn { color: var(--gray-600); }
.dns-new-row .icon-btn:hover { color: var(--danger); }
.dns-quote-note { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }

/* Linha inteira clicável que abre um painel (servidores, membros, usuários). */
.row-button { width: 100%; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background .15s var(--ease); }
.row-button:hover { background: var(--panel); }
.row-button:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--ring); }
.row-button .row-end .chev-r { width: 7px; height: 7px; border-right: 1.5px solid var(--gray-600); border-bottom: 1.5px solid var(--gray-600); transform: rotate(-45deg); }

/* Pessoas (membros e usuários). */
.person-av { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--gray-900); }
.person-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person-head .person-av { width: 42px; height: 42px; font-size: 14px; background: var(--accent); color: var(--on-accent); border: 0; }
.person-head h2 { overflow-wrap: anywhere; }
.person-tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.drawer-section { display: grid; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.drawer-section h3 { font-size: 14px; font-weight: 600; }
.mini-list { list-style: none; margin: 0; padding: 0; display: grid; border: 1px solid var(--line); border-radius: var(--r-md); }
.mini-list li { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; }
.mini-list li + li { border-top: 1px solid var(--line-soft); }
.mini-list .mini-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; font-weight: 500; }
.mini-list .mini-title:hover { text-decoration: underline; }
.mini-list form { margin: 0; }
.mini-list select.input.sm { width: auto; }
.link-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.link-row select:first-of-type { flex: 1 1 200px; }
.link-row select { width: auto; }
.drawer-foot form { margin: 0; }

/* Ranking horizontal (LTV) e parceiros (ADR-0027) */
.rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.rank li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
.rank-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.rank-value { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ink); }
.rank-track { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: var(--line-soft); overflow: hidden; }
.rank-track i { display: block; height: 100%; border-radius: 4px; background: var(--chart-series); }
.balance { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; padding: 20px 22px; }
.balance .value { font-size: 34px; letter-spacing: -.04em; line-height: 1.1; }
.balance .parts { display: flex; flex-wrap: wrap; gap: 6px 20px; color: var(--gray-600); font-size: 13px; }
.balance .parts strong { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.ref-link { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; }
.ref-link code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Avisos por membro (painel de membros). */
.notices { display: grid; gap: 10px; margin: 0; padding: 0; border: 0; }
.notices legend { margin-bottom: 6px; padding: 0; font-size: 13px; font-weight: 600; }

/* Nova aplicação: enviar arquivos ou importar do GitHub (troca sem JS). */
.new-app { display: grid; gap: 14px; }
.new-app:has(.source-pick input[value="github"]:checked) .src-upload,
.new-app:not(:has(.source-pick input[value="github"]:checked)) .src-github { display: none; }
.source-pick .gh-icon { vertical-align: -2px; }
.checkbox.full, .form-grid > .full { grid-column: 1 / -1; }

/* Fase atual do deploy: o ponto da linha do tempo vira um anel girando. */
.timeline .active .mark {
  width: 12px; height: 12px; margin-top: 5px; background: var(--surface);
  border: 2px solid var(--gray-300); border-top-color: var(--ink); box-sizing: border-box;
  animation: tl-spin .8s linear infinite;
}
@keyframes tl-spin { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: reduce) {
  .timeline .active .mark { animation: none; border-color: var(--ink); }
}

[data-finance-mode][hidden]{display:none!important}

@media print{[data-print],[data-copy]{display:none!important}}

/* CRM interno (ADR-0036). */
.crm-stages, .crm-search { display:flex; gap:12px; flex-wrap:wrap; align-items:center; margin:16px 0; }
.crm-search .field { flex:1; min-width:220px; }
.crm-board { display:grid; grid-template-columns:repeat(5,minmax(210px,1fr)); gap:16px; overflow-x:auto; padding:4px 0 16px; }
.crm-column { min-width:0; }
.crm-column h2 { font-size:15px; margin:0 0 12px; }
.crm-card { padding:16px; margin-bottom:12px; overflow-wrap:anywhere; }
.crm-note { white-space:pre-wrap; overflow-wrap:anywhere; }
.crm-card .crm-note { max-height:90px; overflow:auto; }
.crm-due { color:var(--danger,#b91c1c); font-weight:600; font-size:13px; }
.crm-legacy { padding:20px; margin:12px 0; }
.crm-legacy summary { cursor:pointer; }
.crm-legacy dd { margin:0 0 8px; overflow-wrap:anywhere; }
.crm-legacy dt { font-weight:600; }
.crm-form { padding:24px; margin:16px 0; }
@media (max-width: 600px) { .crm-form { padding:16px; } }

/* Support identity: customer-only card immediately below Developer. */
.support-pin { margin:10px 0 0; padding:10px 12px; border-radius:8px; background:var(--panel-2); display:flex; align-items:center; justify-content:space-between; gap:8px; }
.support-pin-info { display:grid; gap:4px; min-width:0; }
.support-pin-label { font-size:11px; color:var(--gray-600); }
.support-pin-value { font-size:14px; font-weight:500; letter-spacing:1.5px; font-variant-numeric:tabular-nums; color:var(--ink); }
.support-pin .icon-btn { flex:none; }
@media(min-width:901px){ :root[data-rail="collapsed"] .support-pin { padding:4px 0; justify-content:center; } :root[data-rail="collapsed"] .support-pin-info { display:none; } }

/* Navegação progressiva: só o conteúdo principal anima; a geometria permanece no fluxo. */
.page { position: relative; }
.page-enter > :not(.nav-skeleton) { animation: page-enter 180ms cubic-bezier(.2,.65,.3,1) both; }
@keyframes page-enter { from { opacity: .35; transform: translateX(9px); } to { opacity: 1; transform: translateX(0); } }
.nav-loading > :not(.nav-skeleton) { visibility: hidden; }
.nav-skeleton { position:absolute; inset:0; pointer-events:none; overflow:hidden; }
.sk-box { position:absolute; display:block; }
.sk-box,.sk-line { background:linear-gradient(100deg,var(--panel-2) 15%,var(--line-soft) 42%,var(--panel-2) 70%); background-size:240% 100%; animation:skeleton-shimmer 1.6s ease-in-out infinite; }
.sk-line { display:block; max-width:100%; border-radius:6px; }
.sk-table-row { display:flex; align-items:center; justify-content:space-between; gap:20px; height:58px; padding:0 20px; border-top:1px solid var(--line-soft); }
.sk-table-head { height:43px; border:0; }
.sk-filters { display:flex; gap:12px; margin-bottom:20px; }
.sk-form .field { display:grid; gap:9px; }
.sk-form > .sk-line { margin-top:24px; }
.nav-skeleton-model .empty { display:grid; justify-items:center; gap:10px; }
.nav-skeleton-model .stat { display:grid; gap:12px; }
@keyframes skeleton-shimmer { 0% { background-position:150% 0; } 100% { background-position:-100% 0; } }
@media(max-width:900px) { .nav-skeleton-model .grid-3 { grid-template-columns:1fr!important; } .sk-table-row { gap:12px; padding-inline:14px; } }
@media(prefers-reduced-motion:reduce) { .page-enter > :not(.nav-skeleton),.sk-box,.sk-line { animation:none; transform:none; } }

.sk-surface { background:var(--surface);border:1px solid var(--line);animation:none; }
.sk-text { color:transparent;background:var(--panel-2);border-radius:6px;box-decoration-break:clone;-webkit-box-decoration-break:clone; }
