/* =====================================================================
   Avantec Sistemas - Design do painel (tema escuro refinado)
   Componentes reutilizáveis: av-card, av-kpi, av-badge, av-btn, av-table...
   ===================================================================== */

:root {
  color-scheme: dark;
  --bg: #0e1324;
  --bg-deep: #090d19;
  --surface: #161c30;
  --surface-2: #1b2238;
  --surface-3: #283049;
  --line: rgba(185, 192, 214, .10);
  --line-strong: rgba(185, 192, 214, .18);
  --text: #eef0f7;
  --text-2: #b9c0d6;
  --text-3: #8f98b3;
  --muted: #687190;
  --brand: #6f73f2;
  --brand-600: #5b5ae6;
  --brand-300: #a5abfc;
  --brand-soft: rgba(111, 115, 242, .14);
  --ok: #3ccf82;       --ok-bg: rgba(60, 207, 130, .12);
  --warn: #f5b83d;     --warn-bg: rgba(245, 184, 61, .13);
  --crit: #f27171;     --crit-bg: rgba(242, 113, 113, .14);
  --info: #7fb2f5;     --info-bg: rgba(127, 178, 245, .13);
  --whats: #25a55f;
  --radius: 14px;
  --sidebar-w: 256px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text-2);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.tabular, .av-kpi__value, .av-table td.num { font-variant-numeric: tabular-nums; }

/* Barra de rolagem discreta */
* { scrollbar-width: thin; scrollbar-color: #2c3450 transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #2c3450; border-radius: 10px; border: 2px solid var(--bg); }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------- Estrutura ---------------------------- */
.av-shell { min-height: 100vh; }
.av-sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 40;
  background: var(--bg-deep); border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  transform: translateX(-100%); transition: transform .25s ease;
}
.av-sidebar.is-open { transform: translateX(0); }
@media (min-width: 1024px) {
  .av-sidebar { transform: translateX(0); }
  .av-content { padding-left: var(--sidebar-w); }
}
.av-content { min-height: 100vh; display: flex; flex-direction: column; }
.av-sidebar__brand { padding: 22px 22px 14px; display: flex; align-items: center; justify-content: center; }
.av-sidebar__brand img { height: 58px; width: auto; }
.av-sidebar__nav { flex: 1; overflow-y: auto; padding: 6px 12px 16px; }
.av-nav-group { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 18px 12px 6px; }
.av-nav-link {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; margin: 2px 0;
  border-radius: 10px; color: var(--text-3); font-size: 14px; font-weight: 500;
  text-decoration: none; transition: background .15s, color .15s;
}
.av-nav-link i { width: 18px; text-align: center; font-size: 15px; color: var(--muted); transition: color .15s; }
.av-nav-link:hover { background: rgba(255, 255, 255, .04); color: var(--text); }
.av-nav-link:hover i { color: var(--text-2); }
.av-nav-link.is-active { background: var(--brand-soft); color: #fff; box-shadow: inset 2px 0 0 var(--brand); }
.av-nav-link.is-active i { color: var(--brand-300); }
.av-nav-link .av-nav-count { margin-left: auto; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--crit-bg); color: var(--crit); }
.av-sidebar__foot { border-top: 1px solid var(--line); padding: 14px 16px; display: flex; align-items: center; gap: 10px; }
.av-avatar { width: 34px; height: 34px; border-radius: 999px; object-fit: cover; background: var(--surface-3); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; flex-shrink: 0; }
.av-overlay { position: fixed; inset: 0; background: rgba(5, 8, 16, .6); z-index: 35; display: none; }
.av-overlay.is-open { display: block; }
@media (min-width: 1024px) { .av-overlay { display: none !important; } }

.av-topbar {
  position: sticky; top: 0; z-index: 30; height: 64px;
  display: flex; align-items: center; gap: 14px; padding: 0 24px;
  background: rgba(14, 19, 36, .82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.av-topbar__menu { display: inline-flex; width: 38px; height: 38px; align-items: center; justify-content: center; border-radius: 10px; color: var(--text-2); }
.av-topbar__menu:hover { background: rgba(255, 255, 255, .05); }
@media (min-width: 1024px) { .av-topbar__menu { display: none; } }
.av-search { position: relative; flex: 1; max-width: 420px; }
.av-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; }
.av-search input {
  width: 100%; height: 38px; padding: 0 12px 0 34px; border-radius: 10px; font-size: 14px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text); outline: none;
}
.av-search input::placeholder { color: var(--muted); }
.av-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.av-topbar__right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.av-chip { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--text-3); font-size: 13px; }
.av-user-btn { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border-radius: 999px; }
.av-user-btn:hover { background: rgba(255, 255, 255, .05); }
.av-dropdown { position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 12px; padding: 6px; box-shadow: 0 20px 40px rgba(0, 0, 0, .45); display: none; z-index: 50; }
.av-dropdown.is-open { display: block; }
.av-dropdown a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; color: var(--text-2); font-size: 14px; }
.av-dropdown a:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.av-dropdown a i { width: 16px; color: var(--muted); }
.av-dropdown hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }

.av-main { flex: 1; width: 100%; max-width: 1480px; margin: 0 auto; padding: 24px; }
@media (max-width: 640px) { .av-main { padding: 16px; } .av-topbar { padding: 0 12px; } }
.av-footer { padding: 18px 24px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ----------------------------- Cabeçalho ---------------------------- */
.av-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.av-page-head h1 { font-size: 24px; line-height: 1.25; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.av-page-head p { color: var(--text-3); font-size: 14px; margin-top: 4px; }
.av-page-head__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.av-breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.av-breadcrumb a { color: var(--text-3); }
.av-breadcrumb a:hover { color: #fff; }

/* ------------------------------- Cards ------------------------------- */
.av-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.av-card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.av-card__title { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; color: var(--text); }
.av-card__title i { color: var(--brand-300); font-size: 14px; }
.av-card__sub { font-size: 12.5px; color: var(--text-3); font-weight: 400; }
.av-card__body { padding: 20px; }
.av-card__body--flush { padding: 0; }
.av-card__foot { padding: 12px 20px; border-top: 1px solid var(--line); font-size: 13px; }

.av-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.av-grid--4, .av-grid--5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .av-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 639px) {
  .av-grid { gap: 12px; }
  .av-kpi { padding: 14px; }
  .av-kpi__value { font-size: 19px !important; }
  .av-kpi__label { font-size: 12px; }
  .av-kpi__icon { display: none; }
  .av-page-head h1 { font-size: 21px; }
  .av-card__head { padding: 14px 16px; }
  .av-card__body { padding: 16px; }
  .av-table th, .av-table td { padding: 10px 12px; }
}
@media (min-width: 1100px) {
  .av-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .av-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .av-grid--2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .av-grid--1-1 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .av-grid--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (min-width: 640px) and (max-width: 1099px) { .av-grid--3, .av-grid--5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.av-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* -------------------------------- KPI -------------------------------- */
.av-kpi { padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; position: relative; }
.av-kpi__label { font-size: 13px; color: var(--text-3); display: flex; align-items: center; gap: 8px; }
.av-kpi__icon { width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; background: var(--brand-soft); color: var(--brand-300); }
.av-kpi__icon--ok { background: var(--ok-bg); color: var(--ok); }
.av-kpi__icon--warn { background: var(--warn-bg); color: var(--warn); }
.av-kpi__icon--crit { background: var(--crit-bg); color: var(--crit); }
.av-kpi__icon--info { background: var(--info-bg); color: var(--info); }
.av-kpi__value { font-size: 26px; line-height: 1.15; font-weight: 700; color: var(--text); letter-spacing: -.02em; margin-top: 4px; }
.av-kpi__sub { font-size: 12.5px; color: var(--text-3); }
.av-kpi a.av-kpi__link { position: absolute; inset: 0; border-radius: var(--radius); }
.av-kpi a.av-kpi__link:hover { box-shadow: inset 0 0 0 1px var(--line-strong); }
.av-delta { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.av-delta--up { color: var(--ok); }
.av-delta--down { color: var(--crit); }

/* ------------------------------- Selos ------------------------------- */
.av-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.5; }
.av-badge i { font-size: 11px; }
.av-badge--ok { background: var(--ok-bg); color: var(--ok); }
.av-badge--alerta { background: var(--warn-bg); color: var(--warn); }
.av-badge--critico { background: var(--crit-bg); color: var(--crit); }
.av-badge--info { background: var(--info-bg); color: var(--info); }
.av-badge--neutro { background: rgba(185, 192, 214, .10); color: var(--text-3); }
.av-badge--brand { background: var(--brand-soft); color: var(--brand-300); }

/* ------------------------------- Botões ------------------------------ */
.av-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 10px; font-size: 14px; font-weight: 600; border: 1px solid transparent; cursor: pointer; transition: background .15s, border-color .15s, color .15s; white-space: nowrap; text-decoration: none; }
.av-btn i { font-size: 13px; }
.av-btn--primary { background: var(--brand-600); color: #fff; }
.av-btn--primary:hover { background: #4b47cb; }
.av-btn--ghost { background: transparent; border-color: var(--line-strong); color: var(--text-2); }
.av-btn--ghost:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.av-btn--soft { background: var(--surface-3); color: var(--text); }
.av-btn--soft:hover { background: #323b58; }
.av-btn--whats { background: var(--whats); color: #fff; }
.av-btn--whats:hover { background: #1f8f52; }
.av-btn--ok { background: #1f9d5c; color: #fff; }
.av-btn--ok:hover { background: #1a8a50; }
.av-btn--warn { background: #c77d12; color: #fff; }
.av-btn--warn:hover { background: #b06e0f; }
.av-btn--danger { background: transparent; border-color: rgba(242, 113, 113, .35); color: var(--crit); }
.av-btn--danger:hover { background: var(--crit-bg); }
.av-btn--sm { height: 32px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.av-btn--icon { width: 32px; height: 32px; padding: 0; border-radius: 8px; }
.av-btn--block { width: 100%; }
.av-btn[disabled], .av-btn.is-off { opacity: .4; pointer-events: none; }

/* ------------------------------- Tabelas ----------------------------- */
.av-table-wrap { overflow-x: auto; }
.av-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.av-table th { text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; background: rgba(255, 255, 255, .015); }
.av-table td { padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--text-2); vertical-align: middle; }
.av-table tbody tr:last-child td { border-bottom: 0; }
.av-table tbody tr:hover td { background: rgba(255, 255, 255, .02); }
.av-table .num { text-align: right; white-space: nowrap; }
.av-table .strong { color: var(--text); font-weight: 600; }
.av-table tfoot td { font-weight: 700; color: var(--text); border-top: 1px solid var(--line-strong); border-bottom: 0; }
.av-table a.av-link { color: var(--text); font-weight: 600; }
.av-table a.av-link:hover { color: var(--brand-300); }
.av-table .sub { display: block; font-size: 12.5px; color: var(--text-3); margin-top: 2px; font-weight: 400; }
.av-actions { display: flex; gap: 6px; justify-content: flex-end; }
/* Tabela que vira "cartão" no celular */
@media (max-width: 639px) {
  .av-table--stack thead, .av-table--stack tfoot { display: none; }
  .av-table--stack tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); align-items: center; }
  .av-table--stack tbody tr:last-child { border-bottom: 0; }
  .av-table--stack td { display: block; padding: 0 !important; border: 0 !important; min-width: 0 !important; }
  .av-table--stack td.c-full { grid-column: 1 / -1; }
  .av-table--stack td.c-hide { display: none; }
  .av-table--stack td.c-o2 { order: 2; } .av-table--stack td.c-o3 { order: 3; text-align: right; }
  .av-table--stack td.c-o4 { order: 4; } .av-table--stack td.c-o5 { order: 5; }
}

/* ------------------------------- Abas -------------------------------- */
.av-tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; margin-bottom: 20px; }
.av-tab { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 9px; font-size: 14px; font-weight: 500; color: var(--text-3); white-space: nowrap; }
.av-tab:hover { color: #fff; background: rgba(255, 255, 255, .04); }
.av-tab.is-active { background: var(--surface-3); color: #fff; }
.av-tab i { font-size: 13px; }

/* ---------------------------- Formulários ---------------------------- */
.av-field label { display: block; font-size: 12.5px; font-weight: 500; color: var(--text-3); margin-bottom: 6px; }
.av-input, .av-select {
  width: 100%; height: 38px; padding: 0 12px; border-radius: 10px; font-size: 14px;
  background: var(--bg); border: 1px solid var(--line-strong); color: var(--text); outline: none;
}
.av-input:focus, .av-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.av-input::placeholder { color: var(--muted); }
.av-filters { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr)); align-items: end; }
.av-filters .av-field--wide { grid-column: span 2; }
@media (max-width: 639px) { .av-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } .av-filters .av-field--wide { grid-column: 1 / -1; } }

/* Formulários das telas antigas: padding e borda padrão sem sobrescrever classes */
body main :where(input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]), select, textarea) {
  padding: .5rem .75rem; border: 1px solid var(--line-strong); border-radius: .5rem;
}
body main :where(input, select, textarea):focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
body main :where(.bg-gray-800[class*="rounded"]) { border: 1px solid var(--line); }
body main :where(table) { border-collapse: collapse; }

/* ------------------------------ Diversos ----------------------------- */
@media (max-width: 767px) { .av-hide-sm { display: none !important; } }
@media (max-width: 639px) { .av-hide-xs { display: none !important; } }
@media (min-width: 768px) { .av-only-sm { display: none !important; } }
.av-ministats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.av-ministats div { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--text-3); }
.av-ministats strong { font-size: 18px; color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.av-empty { padding: 36px 20px; text-align: center; color: var(--text-3); font-size: 14px; }
.av-empty i { display: block; font-size: 26px; color: var(--muted); margin-bottom: 10px; }
.av-muted { color: var(--text-3); }
.av-text { color: var(--text); }
.av-crit { color: var(--crit); }
.av-ok { color: var(--ok); }
.av-warn { color: var(--warn); }
.av-list { list-style: none; margin: 0; padding: 0; }
.av-list li { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.av-list li:last-child { border-bottom: 0; }
.av-list__main { flex: 1; min-width: 0; }
.av-list__title { color: var(--text); font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.av-list__title:hover { color: var(--brand-300); }
.av-list__sub { color: var(--text-3); font-size: 12.5px; margin-top: 1px; }
.av-list__value { text-align: right; font-weight: 600; color: var(--text); font-size: 14px; white-space: nowrap; }

.av-meter { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; display: flex; gap: 2px; }
.av-meter > span { display: block; height: 100%; border-radius: 999px; }
.av-legend { display: flex; flex-direction: column; gap: 10px; }
.av-legend__row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.av-legend__dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.av-legend__label { flex: 1; color: var(--text-2); }
.av-legend__label a:hover { color: #fff; }
.av-legend__value { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

.av-alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 12px; font-size: 14px; margin-bottom: 18px; }
.av-alert--ok { background: var(--ok-bg); color: #bff0d4; border: 1px solid rgba(60, 207, 130, .25); }
.av-alert--erro { background: var(--crit-bg); color: #ffd1d1; border: 1px solid rgba(242, 113, 113, .3); }
.av-alert--info { background: var(--brand-soft); color: var(--brand-100, #e0e3ff); border: 1px solid rgba(111, 115, 242, .3); }

.av-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: #fff; color: #0e1324; font-weight: 600; font-size: 14px; padding: 10px 16px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); opacity: 0; pointer-events: none; transition: all .2s; z-index: 100; display: flex; align-items: center; gap: 8px; }
.av-toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }

.av-chart { position: relative; height: 260px; }
.av-chart--sm { height: 200px; }

.av-kv { display: grid; grid-template-columns: 130px 1fr; gap: 10px 16px; font-size: 14px; }
.av-kv dt { color: var(--text-3); }
.av-kv dd { color: var(--text); margin: 0; min-width: 0; overflow-wrap: anywhere; }

.av-copy { display: flex; gap: 8px; }
.av-copy input { flex: 1; min-width: 0; height: 38px; padding: 0 12px; border-radius: 10px; font-size: 13px; background: var(--bg); border: 1px solid var(--line-strong); color: var(--text-2); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.av-pagination { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.av-pagination a, .av-pagination span { min-width: 36px; height: 36px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; font-size: 14px; border: 1px solid var(--line); color: var(--text-3); background: var(--surface); }
.av-pagination a:hover { color: #fff; border-color: var(--line-strong); }
.av-pagination .is-active { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.av-pagination .is-disabled { opacity: .4; pointer-events: none; }

/* Modal */
.av-modal { position: fixed; inset: 0; z-index: 60; background: rgba(5, 8, 16, .7); display: none; align-items: center; justify-content: center; padding: 16px; }
.av-modal.is-open { display: flex; }
.av-modal__box { width: 100%; max-width: 440px; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: 0 30px 60px rgba(0, 0, 0, .5); }
.av-modal__head { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.av-modal__head h3 { font-size: 16px; font-weight: 700; color: var(--text); }
.av-modal__body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.av-modal__foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }

/* Formulário de cadastro em seções */
.av-form-sec { display: flex; flex-direction: column; gap: 2px; margin: 26px 0 14px; padding-top: 18px; border-top: 1px solid var(--line); }
.av-card__body > .av-form-sec:first-of-type, .av-card__body > .av-alert + .av-form-sec { margin-top: 0; padding-top: 0; border-top: 0; }
.av-form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 14px; }
.av-form-grid .c2 { grid-column: 1 / -1; }
@media (min-width: 900px) { .av-form-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .av-form-grid .c2 { grid-column: span 2; } }
.av-hint { display: block; font-size: 12.5px; color: var(--text-3); margin-top: 6px; min-height: 1em; }

/* Agenda */
.av-ag-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .av-ag-layout { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; } }
@media (min-width: 640px) { .av-only-xs { display: none !important; } }
.av-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.av-cal__dow { padding: 8px 10px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 1px solid var(--line); }
.av-cal__dia { min-height: 108px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; cursor: pointer; min-width: 0; }
.av-cal__dia:nth-child(7n) { border-right: 0; }
.av-cal__dia:hover { background: rgba(255, 255, 255, .02); }
.av-cal__dia.is-fora { opacity: .4; }
.av-cal__num { font-size: 12.5px; font-weight: 600; color: var(--text-3); width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; }
.av-cal__dia.is-hoje .av-cal__num { background: var(--brand-600); color: #fff; }
.av-cal__item { display: block; width: 100%; text-align: left; font-size: 12px; line-height: 1.3; padding: 3px 6px; border-radius: 6px; background: rgba(255, 255, 255, .04); border-left: 3px solid var(--cor); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.av-cal__item:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.av-cal__item b { color: var(--text); font-weight: 600; }
.av-cal__item.is-concluido { text-decoration: line-through; opacity: .6; }
.av-cal__item.is-cancelado { text-decoration: line-through; opacity: .35; }
.av-cal__mais { font-size: 11.5px; color: var(--muted); padding-left: 6px; }

/* Checkbox redondo (lista "O que falta") */
.av-check { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line-strong); background: transparent; color: transparent; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; cursor: pointer; flex-shrink: 0; transition: all .15s; }
.av-check:hover { border-color: var(--ok); color: var(--ok); }
.av-check.is-on { background: var(--ok); border-color: var(--ok); color: #0e1324; }
/* Opção em cartão (radio/checkbox com descrição) */
.av-radio { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px; cursor: pointer; font-size: 14px; color: var(--text); }
.av-radio:hover { background: rgba(255, 255, 255, .03); }
.av-radio input { margin-top: 3px; accent-color: var(--brand); width: 16px; height: 16px; flex-shrink: 0; padding: 0 !important; }
.av-radio small { display: block; color: var(--text-3); font-size: 12.5px; margin-top: 2px; }
.av-radio:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
/* Chips selecionáveis */
.av-chip-check { cursor: pointer; }
.av-chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.av-chip-check span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 13px; color: var(--text-2); }
.av-chip-check input:checked + span { background: var(--brand-soft); border-color: var(--brand); color: #fff; }
.av-chip-check input:checked + span::before { content: "\2713"; }
textarea.av-input { line-height: 1.45; }

@media print {
  .av-sidebar, .av-topbar, .av-footer, .no-print, .av-tabs, .av-page-head__actions { display: none !important; }
  .av-content { padding-left: 0 !important; }
  body { background: #fff; color: #111; }
  .av-card { border-color: #ddd; background: #fff; }
  .av-table td, .av-table th, .av-kpi__value, .av-card__title { color: #111 !important; }
}

/* Consulta de CNPJ (cadastro do cliente) */
.av-cnpj-info { margin: -6px 0 18px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface-2); font-size: 13px; color: var(--text-2); display: grid; gap: 8px; }
.av-cnpj-info[hidden] { display: none; }
.av-cnpj-info__chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.av-cnpj-info__item { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.av-cnpj-info__item i, .av-cnpj-info__cnae i { color: var(--text-3); font-size: 12px; }
.av-cnpj-info__cnae { display: flex; gap: 8px; align-items: baseline; }
.av-cnpj-info__aviso { display: flex; gap: 8px; align-items: baseline; color: var(--warn); }
.av-cnpj-info__fonte { font-size: 12px; color: var(--muted); }
