/* Auto-gerado a partir de modules/. Nao editar manualmente. */

/* === 00-ui-kit.css === */
/* =========================================================
   UI KIT — Design Tokens (customize aqui)
   ========================================================= */
:root {
  /* Cores de marca */
  --color-primary: #025efd;
  --color-primary-hover: #024fd6;
  --color-primary-soft: #e6effe;
  --color-secondary: #3a85fd;
  --color-secondary-hover: #1f6ef0;

  --color-success: #16a34a;
  --color-success-soft: #dcfce7;
  --color-warning: #d97706;
  --color-warning-soft: #fef3c7;
  --color-danger: #dc2626;
  --color-danger-soft: #fee2e2;
  --color-info: #0284c7;
  --color-info-soft: #e0f2fe;

  /* Superfícies / texto (tema claro) */
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f1f3f9;
  --border: #e5e7eb;
  --text: #111827;
  --text-muted: #6b7280;

  /* Tipografia */
  --font: "Rubik", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Raios */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-full: 999px;

  /* Sombras */
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow: 0 4px 16px rgba(16, 24, 40, .08);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, .16);

  /* Espaçamento base */
  --space: 1rem;
  --container: 1100px;
  --transition: .2s ease;
}

/* Tema escuro */
[data-theme="dark"] {
  --color-primary-soft: #0a1f3d;
  --bg: #0b0f1a;
  --surface: #121826;
  --surface-2: #1b2333;
  --border: #283044;
  --text: #e5e7eb;
  --text-muted: #94a3b8;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 4px 16px rgba(0,0,0,.45);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.6);
  --color-success-soft: #052e16;
  --color-warning-soft: #422006;
  --color-danger-soft: #450a0a;
  --color-info-soft: #082f49;
}

/* =========================================================
   Reset / base
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}
a { color: inherit; text-decoration: none; }
h1,h2,h3 { line-height: 1.2; margin: 0; }
code { background: var(--surface-2); padding: .1em .4em; border-radius: var(--radius-sm); font-size: .9em; }
kbd { background: var(--surface-2); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: var(--radius-sm); padding: .05em .4em; font-size: .85em; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 1.25rem; }
.muted { color: var(--text-muted); }
.text-gradient {
  background: linear-gradient(120deg, var(--color-primary), var(--color-secondary));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* =========================================================
   Layout helpers
   ========================================================= */
.cluster { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.cluster--center { align-items: center; }
.grid { display: grid; gap: 1.25rem; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 820px) { .grid--2, .grid--3 { grid-template-columns: 1fr; } }

/* =========================================================
   Header
   ========================================================= */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner { display: flex; align-items: center; gap: 1.5rem; height: 64px; }
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 800; font-size: 1.25rem; }
.brand__dot { width: 12px; height: 12px; border-radius: 50%; background: var(--color-primary); box-shadow: 0 0 0 4px var(--color-primary-soft); }
.brand__accent { color: var(--color-primary); }
.nav { display: flex; gap: 1.25rem; margin-left: auto; }
.nav__link { color: var(--text-muted); font-weight: 500; transition: color var(--transition); }
.nav__link:hover { color: var(--text); }
.site-header__actions { display: flex; align-items: center; gap: .6rem; margin-left: auto; }
.nav .nav__link { margin-left: 0; }
.site-header__inner > .nav { margin-left: auto; }
.site-header__inner > .site-header__actions { margin-left: 0; }
.nav-toggle { display: none; }
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

@media (max-width: 820px) {
  .nav {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: .5rem 1.25rem; box-shadow: var(--shadow);
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav__link { padding: .75rem 0; }
  .nav-toggle { display: inline-flex; }
}

/* =========================================================
   Hero
   ========================================================= */
.hero { text-align: center; padding: 4rem 0 3rem; }
.hero__title { font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 800; margin: 1rem 0; }
.hero__subtitle { max-width: 620px; margin: 0 auto 1.75rem; color: var(--text-muted); font-size: 1.1rem; }
.hero__cta { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }

/* =========================================================
   Sections
   ========================================================= */
.section { padding: 2.5rem 0; border-top: 1px solid var(--border); }
.section__title { font-size: 1.6rem; font-weight: 700; }
.section__desc { color: var(--text-muted); margin: .35rem 0 1.5rem; }
.demo {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.demo__label { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 1rem; font-weight: 600; }

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  --btn-bg: var(--surface-2); --btn-fg: var(--text); --btn-bd: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: inherit; font-weight: 600; font-size: .95rem;
  padding: .6rem 1.1rem; border-radius: 5px;
  background: var(--btn-bg); color: var(--btn-fg);
  border: 1px solid var(--btn-bd); cursor: pointer;
  transition: transform var(--transition), background var(--transition), box-shadow var(--transition), border-color var(--transition);
  white-space: nowrap; position: relative;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn--primary { --btn-bg: var(--color-primary); --btn-fg: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { --btn-bg: var(--color-primary-hover); }
.btn--secondary { --btn-bg: var(--color-secondary); --btn-fg: #fff; }
.btn--secondary:hover { --btn-bg: var(--color-secondary-hover); }
.btn--outline { --btn-bg: transparent; --btn-fg: var(--text); --btn-bd: var(--border); }
.btn--outline:hover { --btn-bg: var(--surface-2); }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--text); }
.btn--ghost:hover { --btn-bg: var(--surface-2); }
.btn--danger { --btn-bg: var(--color-danger); --btn-fg: #fff; }
.btn--success { --btn-bg: var(--color-success); --btn-fg: #fff; }

.btn--sm { padding: .4rem .8rem; font-size: .85rem; }
.btn--lg { padding: .8rem 1.6rem; font-size: 1.05rem; }
.btn--block { width: 100%; }
.btn--icon { padding: .55rem; }

.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: ""; position: absolute; width: 16px; height: 16px;
  border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%; animation: spin .7s linear infinite;
  color: #fff;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================================
   Forms
   ========================================================= */
.field { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1.1rem; }
.field:last-child { margin-bottom: 0; }
.field__label { font-weight: 600; font-size: .9rem; display: flex; align-items: center; gap: .5rem; }
.field__hint { font-size: .8rem; color: var(--text-muted); }
.field__error { font-size: .8rem; color: var(--color-danger); }

.input {
  font-family: inherit; font-size: .95rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .65rem .8rem; width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input::placeholder { color: var(--text-muted); }
.input:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-soft); }
.input.is-invalid { border-color: var(--color-danger); }
.input.is-invalid:focus { box-shadow: 0 0 0 3px var(--color-danger-soft); }
textarea.input { resize: vertical; }

.input-group { position: relative; display: flex; align-items: center; }
.input-group svg { position: absolute; left: .75rem; color: var(--text-muted); pointer-events: none; }
.input-group .input { padding-left: 2.4rem; }

/* Inputs nativos de data/hora */
.input-group--date svg { z-index: 1; }
.input-group--date .input[type="date"], .input-group--date .input[type="time"], .input-group--date .input[type="month"] { padding-left: 2.4rem; }
.input[type="date"]::-webkit-calendar-picker-indicator,
.input[type="time"]::-webkit-calendar-picker-indicator,
.input[type="month"]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .65; }
.input[type="date"]::-webkit-calendar-picker-indicator:hover,
.input[type="time"]::-webkit-calendar-picker-indicator:hover,
.input[type="month"]::-webkit-calendar-picker-indicator:hover { opacity: 1; }
[data-theme="dark"] .input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] .input[type="time"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] .input[type="month"]::-webkit-calendar-picker-indicator { filter: invert(1); }

/* Datepicker customizado */
.datepicker { position: relative; }
.datepicker__input { cursor: pointer; padding-left: 2.4rem; }
.datepicker__calendar {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; width: 280px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: .85rem;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
}
.datepicker.is-open .datepicker__calendar { opacity: 1; visibility: visible; transform: none; }
.datepicker__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.datepicker__title { font-weight: 600; font-size: .95rem; }
.datepicker__nav {
  background: none; border: none; cursor: pointer; color: var(--text-muted);
  width: 30px; height: 30px; border-radius: var(--radius-sm); display: grid; place-items: center; font-size: 1.1rem;
}
.datepicker__nav:hover { background: var(--surface-2); color: var(--text); }
.datepicker__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.datepicker__dow { text-align: center; font-size: .7rem; font-weight: 600; color: var(--text-muted); padding: .25rem 0; text-transform: uppercase; }
.datepicker__day {
  border: none; background: none; cursor: pointer; aspect-ratio: 1; border-radius: var(--radius-sm);
  font-family: inherit; font-size: .85rem; color: var(--text); display: grid; place-items: center;
  transition: background var(--transition), color var(--transition);
}
.datepicker__day:hover { background: var(--surface-2); }
.datepicker__day.is-muted { color: var(--text-muted); opacity: .4; }
.datepicker__day.is-today { box-shadow: inset 0 0 0 1px var(--color-primary); color: var(--color-primary); font-weight: 600; }
.datepicker__day.is-selected { background: var(--color-primary); color: #fff; font-weight: 600; }
.datepicker__day.is-selected:hover { background: var(--color-primary-hover); }
/* Range picker */
.datepicker__calendar--range { width: auto; }
.datepicker__months { display: flex; gap: 1.25rem; }
.datepicker__month { width: 240px; }
@media (max-width: 600px) { .datepicker__months { flex-direction: column; } }

/* destaque do intervalo */
.datepicker__day.in-range { background: var(--color-primary-soft); border-radius: 0; color: var(--text); }
.datepicker__day.range-start { background: var(--color-primary); color: #fff; font-weight: 600; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.datepicker__day.range-end { background: var(--color-primary); color: #fff; font-weight: 600; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.datepicker__day.range-start.range-end { border-radius: var(--radius-sm); }
[data-theme="dark"] .datepicker__day.in-range { color: var(--text); }

.datepicker__foot { display: flex; justify-content: space-between; margin-top: .6rem; padding-top: .6rem; border-top: 1px solid var(--border); }
.datepicker__action { background: none; border: none; cursor: pointer; font-family: inherit; font-size: .85rem; font-weight: 600; color: var(--color-primary); padding: .25rem .5rem; border-radius: var(--radius-sm); }
.datepicker__action:hover { background: var(--color-primary-soft); }

/* Checkbox & radio */
.check, .radio { display: flex; align-items: center; gap: .55rem; cursor: pointer; margin-bottom: .5rem; }
.check input, .radio input { width: 18px; height: 18px; accent-color: var(--color-primary); cursor: pointer; }

/* Switch */
.switch { display: flex; align-items: center; gap: .6rem; cursor: pointer; margin-bottom: .6rem; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track { width: 42px; height: 24px; background: var(--border); border-radius: var(--radius-full); position: relative; transition: background var(--transition); flex-shrink: 0; }
.switch__thumb { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: transform var(--transition); box-shadow: var(--shadow-sm); }
.switch input:checked + .switch__track { background: var(--color-primary); }
.switch input:checked + .switch__track .switch__thumb { transform: translateX(18px); }

/* Range */
.range { width: 100%; accent-color: var(--color-primary); }

/* =========================================================
   Uploader (Drag & Drop)
   ========================================================= */
.uploader__dropzone {
  display: flex; flex-direction: column; align-items: center; gap: .5rem; text-align: center;
  padding: 2.5rem 1.5rem; border: 2px dashed var(--border); border-radius: var(--radius-lg);
  color: var(--text-muted); cursor: pointer; background: var(--surface-2);
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}
.uploader__dropzone:hover, .uploader__dropzone:focus-visible { border-color: var(--color-primary); color: var(--text); outline: none; }
.uploader__dropzone svg { color: var(--color-primary); }
.uploader.is-dragover .uploader__dropzone {
  border-color: var(--color-primary); background: var(--color-primary-soft); color: var(--color-primary);
  transform: scale(1.01);
}
.uploader__text { margin: 0; font-size: .95rem; }
.uploader__browse { color: var(--color-primary); font-weight: 600; text-decoration: underline; }
.uploader__hint { margin: 0; font-size: .8rem; opacity: .8; }

.uploader__list { list-style: none; padding: 0; margin: .9rem 0 0; display: flex; flex-direction: column; gap: .5rem; }
.uploader__file {
  display: flex; align-items: center; gap: .75rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .6rem .75rem; animation: fade .25s ease;
}
.uploader__thumb {
  width: 40px; height: 40px; border-radius: var(--radius-sm); flex-shrink: 0; object-fit: cover;
  background: var(--surface-2); display: grid; place-items: center; color: var(--color-primary); font-size: .7rem; font-weight: 700;
}
.uploader__meta { flex: 1; min-width: 0; }
.uploader__name { font-size: .9rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uploader__size { font-size: .78rem; color: var(--text-muted); }
.uploader__remove {
  border: none; background: var(--surface-2); color: var(--text-muted); cursor: pointer;
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; line-height: 1; display: grid; place-items: center; padding: 0;
}
.uploader__remove:hover { background: var(--color-danger); color: #fff; }
.uploader__bar { height: 4px; background: var(--surface-2); border-radius: var(--radius-full); overflow: hidden; margin-top: .35rem; }
.uploader__bar span { display: block; height: 100%; width: 0; background: var(--color-primary); border-radius: var(--radius-full); transition: width .2s linear; }

/* =========================================================
   Cards
   ========================================================= */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card--outline { box-shadow: none; border: 2px solid var(--color-primary); }
.card__media { height: 140px; background: linear-gradient(120deg, var(--color-primary), var(--color-secondary)); }
.card__body { padding: 1.25rem; display: flex; flex-direction: column; gap: .6rem; flex: 1; }
.card__title { font-size: 1.15rem; font-weight: 700; }
.card__text { color: var(--text-muted); font-size: .95rem; margin: 0; }
.card__footer { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-top: 1px solid var(--border); }
.card__meta { font-size: .85rem; color: var(--text-muted); }
.card__price { font-size: 2rem; font-weight: 800; margin: .25rem 0; }
.card__price span { font-size: 1rem; font-weight: 500; color: var(--text-muted); }

.stat { display: flex; flex-direction: column; gap: .25rem; }
.stat__label { color: var(--text-muted); font-size: .9rem; }
.stat__value { font-size: 2rem; font-weight: 800; }
.stat__delta { font-size: .85rem; font-weight: 600; }
.stat__delta--up { color: var(--color-success); }
.stat__delta--down { color: var(--color-danger); }

/* Icon badge — quadrado arredondado com ícone (reutilizável em headers, listas, KPIs) */
.icon-badge { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius); flex-shrink: 0; background: var(--color-primary-soft); color: var(--color-primary); }
.icon-badge > svg { width: 22px; height: 22px; }
.icon-badge--success { background: var(--color-success-soft); color: var(--color-success); }
.icon-badge--danger  { background: var(--color-danger-soft);  color: var(--color-danger); }
.icon-badge--warning { background: var(--color-warning-soft); color: var(--color-warning); }
.icon-badge--neutral { background: var(--surface-2);          color: var(--text-muted); }
.icon-badge--sm { width: 34px; height: 34px; border-radius: var(--radius-sm); }
.icon-badge--sm > svg { width: 18px; height: 18px; }

/* Stat card — KPI com ícone, rótulo, valor e legenda */
.stat-card { display: flex; align-items: flex-start; gap: .9rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.15rem 1.25rem; box-shadow: var(--shadow-sm); }
a.stat-card { text-decoration: none; color: inherit; transition: transform var(--transition), box-shadow var(--transition); }
a.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat-card__body { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.stat-card__label { font-size: .85rem; font-weight: 600; color: var(--text-muted); }
.stat-card__value { font-size: 1.5rem; font-weight: 800; line-height: 1.15; color: var(--text); word-break: break-word; }
.stat-card__foot { font-size: .82rem; color: var(--text-muted); margin-top: .1rem; }
.stat-card__foot a { color: var(--color-primary); font-weight: 600; text-decoration: none; }
.stat-card__foot a:hover { text-decoration: underline; }
/* Grade responsiva para linhas de stat-cards (KPIs) */
.stat-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin-bottom: 1.25rem; }

.list-check { list-style: none; padding: 0; margin: .5rem 0 1.25rem; display: flex; flex-direction: column; gap: .5rem; }
.list-check li { padding-left: 1.6rem; position: relative; color: var(--text-muted); }
.list-check li::before {
  content: ""; position: absolute; left: 0; top: .35em; width: 1.05rem; height: 1.05rem;
  background: var(--color-success);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-4-4'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-4-4'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* =========================================================
   Badges & chips
   ========================================================= */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .75rem; font-weight: 600; padding: .25rem .6rem;
  border-radius: var(--radius-full); line-height: 1;
}
.badge--primary { background: var(--color-primary-soft); color: var(--color-primary); }
.badge--success { background: var(--color-success-soft); color: var(--color-success); }
.badge--warning { background: var(--color-warning-soft); color: var(--color-warning); }
.badge--danger  { background: var(--color-danger-soft);  color: var(--color-danger); }
.badge--neutral { background: var(--surface-2); color: var(--text-muted); }
[data-theme="dark"] .badge--primary { color: #c7d2fe; }

.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--surface-2); border: 1px solid var(--border);
  padding: .3rem .4rem .3rem .75rem; border-radius: var(--radius-full); font-size: .85rem;
}
.chip__x { border: none; background: var(--border); color: var(--text); width: 18px; height: 18px; border-radius: 50%; cursor: pointer; line-height: 1; display: grid; place-items: center; padding: 0; }
.chip__x:hover { background: var(--color-danger); color: #fff; }

/* =========================================================
   Alerts
   ========================================================= */
.alert {
  display: flex; align-items: center; gap: .5rem;
  padding: .85rem 1rem; border-radius: var(--radius);
  border: 1px solid transparent; margin-bottom: .75rem; font-size: .95rem;
}
.alert:last-child { margin-bottom: 0; }
.alert--info { background: var(--color-info-soft); color: var(--color-info); border-color: color-mix(in srgb, var(--color-info) 25%, transparent); }
.alert--success { background: var(--color-success-soft); color: var(--color-success); border-color: color-mix(in srgb, var(--color-success) 25%, transparent); }
.alert--warning { background: var(--color-warning-soft); color: var(--color-warning); border-color: color-mix(in srgb, var(--color-warning) 25%, transparent); }
.alert--danger { background: var(--color-danger-soft); color: var(--color-danger); border-color: color-mix(in srgb, var(--color-danger) 25%, transparent); }
.alert__close { margin-left: auto; background: none; border: none; color: inherit; cursor: pointer; line-height: 1; opacity: .7; display: inline-flex; padding: 0; }
.alert__close:hover { opacity: 1; }

/* =========================================================
   Progress
   ========================================================= */
.progress { height: 10px; background: var(--surface-2); border-radius: var(--radius-full); overflow: hidden; margin-bottom: .75rem; }
.progress:last-child { margin-bottom: 0; }
.progress__bar { height: 100%; background: var(--color-primary); border-radius: var(--radius-full); transition: width .4s ease; }
.progress__bar--success { background: var(--color-success); }
.progress--striped .progress__bar {
  background-image: linear-gradient(45deg, rgba(255,255,255,.2) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.2) 50%, rgba(255,255,255,.2) 75%, transparent 75%, transparent);
  background-size: 1rem 1rem; animation: stripes 1s linear infinite;
}
@keyframes stripes { to { background-position: 1rem 0; } }

/* =========================================================
   Tabs
   ========================================================= */
.tabs__list { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
.tabs__tab {
  background: none; border: none; padding: .65rem 1rem; cursor: pointer;
  font-family: inherit; font-weight: 600; font-size: .9rem; color: var(--text-muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color var(--transition), border-color var(--transition);
}
.tabs__tab:hover { color: var(--text); }
.tabs__tab.is-active { color: var(--color-primary); border-bottom-color: var(--color-primary); }
.tabs__panel { display: none; color: var(--text-muted); }
.tabs__panel.is-active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* =========================================================
   Accordion
   ========================================================= */
.accordion__item { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: .5rem; overflow: hidden; }
.accordion__header {
  width: 100%; text-align: left; background: var(--surface); border: none; cursor: pointer;
  padding: .9rem 1rem; font-family: inherit; font-weight: 600; font-size: .95rem; color: var(--text);
  display: flex; justify-content: space-between; align-items: center;
}
.accordion__header:hover { background: var(--surface-2); }
.accordion__icon { color: var(--color-primary); transition: transform var(--transition); display: inline-flex; }
.accordion__item.is-open .accordion__icon { transform: rotate(45deg); }
.accordion__content { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.accordion__content p { margin: 0; padding: 0 1rem 1rem; color: var(--text-muted); }

/* =========================================================
   Dropdown
   ========================================================= */
.dropdown { position: relative; display: inline-block; }
.dropdown__menu {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 180px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: .35rem; z-index: 40;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
}
.dropdown.is-open .dropdown__menu { opacity: 1; visibility: visible; transform: none; }
.dropdown__item { display: block; padding: .55rem .7rem; border-radius: var(--radius-sm); font-size: .9rem; cursor: pointer; }
.dropdown__item:hover { background: var(--surface-2); }
.dropdown__item--danger { color: var(--color-danger); }
.dropdown__divider { height: 1px; background: var(--border); margin: .35rem 0; }

/* =========================================================
   Tooltip
   ========================================================= */
.tooltip { position: relative; display: inline-flex; }
.tooltip::after {
  content: attr(data-tooltip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(4px);
  background: var(--text); color: var(--surface); padding: .35rem .65rem; border-radius: var(--radius-sm);
  font-size: .8rem; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity var(--transition), transform var(--transition);
}
.tooltip:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }

/* =========================================================
   Avatars
   ========================================================= */
.avatar {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: var(--color-primary); color: #fff; font-weight: 700; font-size: .9rem;
  border: 2px solid var(--surface);
}
.avatar--sm { width: 32px; height: 32px; font-size: .75rem; }
.avatar--lg { width: 56px; height: 56px; font-size: 1.1rem; }
.avatar--more { background: var(--surface-2); color: var(--text-muted); }
.avatar-group { display: flex; }
.avatar-group .avatar { margin-left: -10px; }
.avatar-group .avatar:first-child { margin-left: 0; }

/* =========================================================
   Table
   ========================================================= */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: .8rem 1rem; text-align: left; }
.table thead th { background: var(--surface-2); color: var(--text-muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
.table tbody tr { border-top: 1px solid var(--border); }
.table tbody tr:hover { background: var(--surface-2); }

/* =========================================================
   Modal
   ========================================================= */
.modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 1rem; }
.modal.is-open { display: flex; }
.modal__overlay { position: absolute; inset: 0; background: rgba(0,0,0,.5); backdrop-filter: blur(2px); animation: fade .2s ease; }
.modal__dialog {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 1.75rem;
  max-width: 440px; width: 100%; animation: pop .25s ease;
}
@keyframes pop { from { opacity: 0; transform: scale(.95) translateY(10px); } to { opacity: 1; transform: none; } }
.modal__close { position: absolute; top: .9rem; right: 1rem; background: none; border: none; cursor: pointer; color: var(--text-muted); line-height: 1; display: inline-flex; padding: 0; }
.modal__close:hover { color: var(--text); }
.modal__title { font-size: 1.25rem; font-weight: 700; margin-bottom: .5rem; }
.modal__body { color: var(--text-muted); margin: 0 0 1.5rem; }
.modal__footer { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: .6rem; }

/* =========================================================
   Toast
   ========================================================= */
.toast-container { position: fixed; bottom: 1.25rem; right: 1.25rem; z-index: 200; display: flex; flex-direction: column; gap: .6rem; }
.toast {
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--color-primary);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: .85rem 1rem;
  min-width: 260px; display: flex; align-items: center; gap: .6rem;
  animation: slideIn .3s ease;
}
.toast.is-leaving { animation: slideOut .3s ease forwards; }
.toast__icon { flex-shrink: 0; color: var(--color-primary); }
.toast--success { border-left-color: var(--color-success); }
.toast--success .toast__icon { color: var(--color-success); }
.toast--danger { border-left-color: var(--color-danger); }
.toast--danger .toast__icon { color: var(--color-danger); }
@keyframes slideIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes slideOut { to { opacity: 0; transform: translateX(40px); } }

/* =========================================================
   Menus, command palette & paginação
   ========================================================= */
.menu { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: .4rem; }
.menu__group + .menu__group { margin-top: .15rem; }
.menu__label { font-size: .72rem; font-weight: 600; color: var(--text-muted); padding: .55rem .6rem .3rem; }
.menu__item { display: flex; align-items: center; gap: .7rem; width: 100%; padding: .55rem .6rem; border: none; background: none; border-radius: var(--radius-sm); cursor: pointer; font-family: inherit; font-size: .9rem; color: var(--text); text-align: left; }
.menu__item:hover:not(:disabled), .menu__item.is-active { background: var(--surface-2); }
.menu__item > svg:first-child { color: var(--text-muted); flex-shrink: 0; }
.menu__text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu__kbd { color: var(--text-muted); font-size: .78rem; letter-spacing: .04em; flex-shrink: 0; }
.menu__chevron { color: var(--text-muted); flex-shrink: 0; }
.menu__item--disabled, .menu__item:disabled { opacity: .45; cursor: not-allowed; }
.menu__divider { height: 1px; background: var(--border); margin: .35rem 0; }

.dropdown__menu--rich { min-width: 248px; padding: .4rem; }

.cmdk { width: 100%; max-width: 440px; padding: 0; overflow: hidden; }
.cmdk__search { display: flex; align-items: center; gap: .6rem; padding: .8rem .9rem; border-bottom: 1px solid var(--border); }
.cmdk__search svg { color: var(--text-muted); flex-shrink: 0; }
.cmdk__input { border: none; background: none; outline: none; width: 100%; font-family: inherit; font-size: .95rem; color: var(--text); }
.cmdk__input::placeholder { color: var(--text-muted); }
.cmdk__list { padding: .4rem; max-height: 320px; overflow: auto; }
.cmdk__empty { padding: 1.5rem; text-align: center; color: var(--text-muted); font-size: .9rem; }

.pagination { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
.pagination__page, .pagination__btn {
  display: inline-flex; align-items: center; gap: .3rem; height: 36px; min-width: 36px; justify-content: center;
  padding: 0 .65rem; border: 1px solid transparent; background: none; border-radius: var(--radius-sm);
  cursor: pointer; font-family: inherit; font-size: .9rem; font-weight: 500; color: var(--text);
}
.pagination__page:hover, .pagination__btn:hover:not(:disabled) { background: var(--surface-2); }
.pagination__page.is-active { border-color: var(--border); background: var(--surface); box-shadow: var(--shadow-sm); font-weight: 600; }
.pagination__btn:disabled { opacity: .45; cursor: not-allowed; }
.pagination__ellipsis { min-width: 28px; text-align: center; color: var(--text-muted); }

/* =========================================================
   Gráficos (charts)
   ========================================================= */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: var(--font); }
.chart__grid { stroke: var(--border); stroke-width: 1; opacity: .6; }
.chart__axis { fill: var(--text-muted); font-size: 12px; }
.chart__num { fill: var(--text); font-weight: 800; }
.chart__sub { fill: var(--text-muted); }
.chart__hole { fill: var(--surface); }

.chart__bar { cursor: pointer; transform-box: fill-box; transform-origin: bottom; animation: chartGrow .6s ease both; }
.chart__bar:hover { filter: brightness(1.08); }
.chart__bar--muted { fill: var(--surface-2); }
.chart__hbar { cursor: pointer; transform-box: fill-box; transform-origin: left; animation: chartGrowX .6s ease both; }
.chart__hbar:hover { filter: brightness(1.08); }

.chart__line { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: chartDraw 1.2s ease forwards; }
.chart__area { animation: chartFade .9s ease both; }
.chart__dot { cursor: pointer; transition: r var(--transition); }
.chart__dot:hover { r: 6; }
.chart__guide { stroke: var(--color-primary); stroke-width: 1.5; stroke-dasharray: 4 4; opacity: .5; }
.chart__badge { animation: chartFade .5s ease both; }

.chart__slice { cursor: pointer; transform-box: fill-box; transform-origin: center; transition: transform var(--transition); animation: chartFade .6s ease both; }
.chart__slice:hover { transform: scale(1.04); }

.chart__gauge-track { fill: none; stroke: var(--surface-2); stroke-linecap: round; }
.chart__gauge-value { fill: none; stroke: var(--color-primary); stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: chartDraw 1.2s ease forwards; }

@keyframes chartGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes chartGrowX { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes chartDraw { to { stroke-dashoffset: 0; } }
@keyframes chartFade { from { opacity: 0; } to { opacity: 1; } }

.chart-legend { display: flex; flex-wrap: wrap; gap: .85rem; margin-top: .9rem; }
.chart-legend__item { display: flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--text-muted); }
.chart-legend__dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.chart-legend--toggle .chart-legend__item { cursor: pointer; user-select: none; border-radius: 6px; padding: .15rem .4rem; margin: -.15rem -.4rem; transition: opacity .15s, background .15s; }
.chart-legend--toggle .chart-legend__item:hover { background: var(--surface-2, rgba(0,0,0,.04)); }
.chart-legend--toggle .chart-legend__item:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 1px; }
.chart-legend__item.is-off { opacity: .4; text-decoration: line-through; }

.chart-tooltip {
  position: fixed; z-index: 300; pointer-events: none;
  background: var(--text); color: var(--surface);
  padding: .4rem .6rem; border-radius: var(--radius-sm); font-size: .8rem; font-weight: 500;
  white-space: nowrap; box-shadow: var(--shadow); opacity: 0; transform: translateY(4px);
  transition: opacity .15s ease, transform .15s ease;
}
.chart-tooltip.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .chart__bar, .chart__hbar, .chart__line, .chart__area, .chart__slice, .chart__gauge-value { animation: none; }
  .chart__line, .chart__gauge-value { stroke-dashoffset: 0; }
}

/* =========================================================
   Ícones (galeria)
   ========================================================= */
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .6rem; }
.icon-cell {
  display: flex; flex-direction: column; align-items: center; gap: .6rem;
  padding: 1.1rem .5rem; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); cursor: pointer; color: var(--text);
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}
.icon-cell:hover { border-color: var(--color-primary); background: var(--surface-2); transform: translateY(-2px); }
.icon-cell svg { color: var(--text); }
.icon-cell__name { font-size: .72rem; color: var(--text-muted); text-align: center; word-break: break-word; line-height: 1.3; }

/* =========================================================
   SweetAlert2 (tema)
   ========================================================= */
.swal2-popup { font-family: var(--font); border-radius: var(--radius-lg); }
.swal2-popup .swal2-styled { border-radius: 5px; font-weight: 600; }
.swal2-popup .swal2-title { font-weight: 700; }
[data-theme="dark"] .swal2-popup { background: var(--surface); color: var(--text); }
[data-theme="dark"] .swal2-html-container, [data-theme="dark"] .swal2-title { color: var(--text); }

/* =========================================================
   Footer
   ========================================================= */
.site-footer { border-top: 1px solid var(--border); margin-top: 2rem; padding: 1.75rem 0; }
.site-footer__inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; font-size: .9rem; }


/* === 10-auth.css === */
/* =========================================================
   Auth — tela de login em duas colunas (estilo animalcare)
   ========================================================= */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }

/* Coluna do formulário */
.auth__form-col {
  display: flex; align-items: center; justify-content: center;
  padding: 48px 24px; background: var(--surface);
}
.auth__card { width: 100%; max-width: 390px; }
.auth__brand {
  display: flex; align-items: center; gap: .55rem;
  font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 32px;
}
.auth__brand-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--color-primary); box-shadow: 0 0 0 4px var(--color-primary-soft); }
.auth__title { font-size: 32px; font-weight: 800; line-height: 1.15; letter-spacing: -.02em; margin-bottom: 8px; }
.auth__subtitle { font-size: 14px; color: var(--text-muted); margin-bottom: 32px; }

/* Alert */
.auth__alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 20px; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.auth__alert--danger  { background: var(--color-danger-soft);  color: var(--color-danger); }
.auth__alert--success { background: var(--color-success-soft); color: var(--color-success); }
.auth__alert svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Campo com label flutuante + ícones */
.auth__field { position: relative; margin-bottom: 16px; }
.auth__field > label {
  position: absolute; top: -7px; left: 12px; background: var(--surface);
  padding: 0 6px; font-size: 12px; font-weight: 500; color: var(--text); z-index: 1;
}
.auth__input-wrap { position: relative; display: flex; align-items: center; }
.auth__input-wrap input {
  width: 100%; padding: 15px 44px; font-size: 14px; font-family: inherit;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.auth__input-wrap input:focus {
  outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 4px var(--color-primary-soft);
}
.auth__input-wrap input::placeholder { color: var(--text-muted); }
.auth__icon-l { position: absolute; left: 14px; display: flex; color: var(--text-muted); pointer-events: none; }
.auth__icon-r {
  position: absolute; right: 8px; background: none; border: none; cursor: pointer;
  padding: 8px; border-radius: 6px; color: var(--text-muted); display: flex;
  transition: color .15s, background .15s;
}
.auth__icon-r:hover { color: var(--text); background: var(--surface-2); }
.auth__icon-l svg, .auth__icon-r svg { width: 18px; height: 18px; }

/* Slide-to-unlock */
.slide-verify__label { font-size: 13px; color: var(--text-muted); margin: 4px 0 8px; font-weight: 500; }
.slide-verify {
  position: relative; height: 54px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden; user-select: none; margin-bottom: 18px;
  transition: background .2s, border-color .2s;
}
.slide-verify__track {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 14px; font-weight: 500;
  background: linear-gradient(90deg, var(--color-primary-soft) 0%, transparent 100%);
  background-size: 0% 100%; background-repeat: no-repeat; transition: background-size .05s linear;
}
.slide-verify__text { pointer-events: none; }
.slide-verify__handle {
  position: absolute; top: 4px; left: 4px; width: 46px; height: 46px; border-radius: 9px;
  background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; color: var(--text);
  cursor: grab; box-shadow: var(--shadow-sm); transition: background .2s, color .2s;
}
.slide-verify__handle:active { cursor: grabbing; }
.slide-verify__handle svg { width: 18px; height: 18px; }
.slide-verify.is-verified { background: var(--color-primary-soft); border-color: var(--color-primary); }
.slide-verify.is-verified .slide-verify__track { color: var(--color-primary); background-size: 100% 100% !important; }
.slide-verify.is-verified .slide-verify__handle { background: var(--color-primary); color: #fff; border-color: var(--color-primary); cursor: default; }
@keyframes authShake { 0%,100% { transform: translateX(0); } 20%,60% { transform: translateX(-6px); } 40%,80% { transform: translateX(6px); } }

.auth__submit { width: 100%; }
.auth__switch { text-align: center; margin-top: 20px; font-size: 13px; color: var(--text-muted); }
.auth__switch a { color: var(--color-primary); font-weight: 600; }
.auth__switch a:hover { text-decoration: underline; }
.auth__footer { text-align: center; margin-top: 28px; font-size: 12px; color: var(--text-muted); }

/* Coluna do painel/marca */
.auth__panel {
  position: relative; overflow: hidden; color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 64px 48px; text-align: center;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
}
.auth__panel--admin { background: linear-gradient(135deg, #013a99, var(--color-primary)); }
.auth__panel-deco { position: absolute; border-radius: 50%; background: rgba(255,255,255,.07); }
.auth__panel-deco--1 { width: 320px; height: 320px; top: -100px; right: -80px; }
.auth__panel-deco--2 { width: 240px; height: 240px; bottom: -60px; left: -60px; }
.auth__illustration { width: 100%; max-width: 360px; margin-bottom: 36px; position: relative; z-index: 1; }
.auth__panel-badge {
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: .5rem;
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.25);
  padding: .4rem .8rem; border-radius: var(--radius-full); font-size: .8rem; font-weight: 600; margin-bottom: 1.25rem;
}
.auth__panel h2 { position: relative; z-index: 1; font-size: 24px; font-weight: 700; line-height: 1.4; max-width: 440px; letter-spacing: -.01em; }
.auth__panel p { position: relative; z-index: 1; margin-top: 12px; font-size: 14px; color: rgba(255,255,255,.82); max-width: 380px; line-height: 1.5; }

@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; }
  .auth__panel { display: none; }
}


/* === 20-app.css === */
/* =========================================================
   App shell — dashboard (sidebar + topo)
   ========================================================= */
.shell { min-height: 100vh; display: grid; grid-template-columns: 250px 1fr; }

.sidebar {
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 1.25rem 1rem;
  position: sticky; top: 0; height: 100vh;
}
.sidebar__brand { display: flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.25rem; padding: .25rem .5rem 1.25rem; }
.sidebar__brand-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--color-primary); box-shadow: 0 0 0 4px var(--color-primary-soft); }
.sidebar__logo { max-width: 100%; max-height: 44px; object-fit: contain; display: block; }

/* Garante que [hidden] funcione mesmo em elementos com display custom (.card/.field) */
[hidden] { display: none !important; }

/* Cabeçalho de página */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head h2 { font-size: 1.4rem; font-weight: 700; }
.page-head__actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
/* Mesma altura para busca, select e botão no cabeçalho */
.page-head__actions .input,
.page-head__actions .btn { height: 44px; }
.page-head__actions .btn { padding-top: 0; padding-bottom: 0; }

/* Métricas */
.metrics { display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.metric {
  flex: 1 1 150px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .85rem 1rem; display: flex; flex-direction: column; gap: .15rem;
}
.metric__num { font-size: 1.5rem; font-weight: 800; line-height: 1; color: var(--text); }
.metric__label { font-size: .82rem; color: var(--text-muted); }
.metric--success { color: var(--color-success) !important; }
.metric--danger  { color: var(--color-danger) !important; }
.metric--primary { color: var(--color-primary) !important; }
.table-actions { display: flex; gap: .15rem; justify-content: flex-end; }
.table-actions form { margin: 0; }
.icon-danger { color: var(--color-danger); }
.icon-danger:hover { background: var(--color-danger-soft) !important; color: var(--color-danger); }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.list-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; }
.list-foot .muted { font-size: .85rem; }

/* Tabelas viram cards no mobile (sem rolagem horizontal) */
@media (max-width: 720px) {
  .page-head__actions { width: 100%; }
  .page-head__actions form { width: 100%; }
  .page-head__actions .input-group { width: 100% !important; }

  /* o wrapper já não precisa de moldura no mobile: cada linha vira um cartão
     com borda própria — manter a borda do wrap (ou do card que o envolve)
     duplicava/triplicava o contorno */
  .table-wrap { overflow-x: visible; border: 0; border-radius: 0; }
  .card:has(.table-wrap) { border: 0; box-shadow: none; border-radius: 0; background: none; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr {
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    margin: 0 0 .75rem; padding: .25rem 1rem; background: var(--surface); box-shadow: var(--shadow-sm);
  }
  /* rótulo absoluto à esquerda; valor flui à direita (suporta múltiplas linhas) */
  .table td {
    position: relative; padding: .6rem 0 .6rem 42%;
    border: 0; border-bottom: 1px solid var(--border);
    text-align: right; word-break: break-word; min-height: 2.6rem;
    display: flex; align-items: center; justify-content: flex-end;
  }
  .table td:last-child { border-bottom: 0; }
  .table td::before {
    content: attr(data-label); position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 38%; text-align: left; white-space: normal; line-height: 1.2;
    font-weight: 600; color: var(--text-muted); text-transform: uppercase; font-size: .72rem; letter-spacing: .03em;
  }
  /* célula de ações: sem rótulo, botões à direita */
  .table td.cell-actions { padding-left: 0; }
  .table td.cell-actions::before { content: ""; }
  .table td .table-actions { justify-content: flex-end; }
}
.sidebar__nav { display: flex; flex-direction: column; gap: .15rem; flex: 1; }
.sidebar__link {
  display: flex; align-items: center; gap: .7rem; padding: .65rem .7rem; border-radius: var(--radius);
  color: var(--text-muted); font-weight: 500; font-size: .92rem; transition: background var(--transition), color var(--transition);
}
.sidebar__link:hover { background: var(--surface-2); color: var(--text); }
.sidebar__link.is-active { background: var(--color-primary-soft); color: var(--color-primary); font-weight: 600; }
.sidebar__link svg { flex-shrink: 0; }
.sidebar__section { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); padding: 1rem .7rem .4rem; font-weight: 600; }

.shell__main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 64px; border-bottom: 1px solid var(--border); background: var(--surface);
  display: flex; align-items: center; justify-content: space-between; padding: 0 1.5rem;
  position: sticky; top: 0; z-index: 30;
}
.topbar__title { font-weight: 700; font-size: 1.1rem; }
.topbar__actions { display: flex; align-items: center; gap: .6rem; }
.page { padding: 1.75rem; }

.user-chip { display: flex; align-items: center; gap: .6rem; }
.user-chip__info { text-align: right; line-height: 1.2; }
.user-chip__name { font-weight: 600; font-size: .9rem; }
.user-chip__role { font-size: .75rem; color: var(--text-muted); }

/* Conta no topo: dropdown (usuário no desktop, 3 pontinhos no mobile) */
.topbar__account { position: relative; }
.topbar__account-btn {
  display: flex; align-items: center; gap: .55rem; background: none; border: 0; cursor: pointer;
  padding: .3rem .45rem; border-radius: var(--radius); color: var(--text);
}
.topbar__account-btn:hover { background: var(--surface-2); }
.topbar__account-info { display: flex; flex-direction: column; text-align: right; line-height: 1.2; }
.topbar__account-caret { color: var(--text-muted); transition: transform var(--transition); }
.topbar__account.is-open .topbar__account-caret { transform: rotate(180deg); }
.topbar__account-dots { display: none; color: var(--text-muted); }
.topbar__pop {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: .4rem; z-index: 50;
  opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
}
.topbar__account.is-open .topbar__pop { opacity: 1; visibility: visible; transform: none; }
.topbar__pop-head { padding: .5rem .6rem; border-bottom: 1px solid var(--border); margin-bottom: .3rem; }
.topbar__pop-name { font-weight: 600; font-size: .9rem; }
.topbar__pop-role { font-size: .75rem; color: var(--text-muted); }
.topbar__pop form { margin: 0; }
.topbar__pop-item {
  display: flex; align-items: center; gap: .55rem; width: 100%; padding: .55rem .6rem;
  border-radius: var(--radius); color: var(--text); font-size: .9rem; font-weight: 500;
  text-align: left; background: none; border: 0; cursor: pointer;
}
.topbar__pop-item:hover { background: var(--surface-2); }

@media (max-width: 720px) {
  .topbar__account-info,
  .topbar__account-caret,
  .topbar__account .avatar { display: none; }
  .topbar__account-dots { display: inline-flex; }
}

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 60; transform: translateX(-100%); transition: transform var(--transition); width: 250px; }
  .sidebar.is-open { transform: none; }
}


/* === 30-notificacoes.css === */
/* =========================================================
   Notificações (sino do header)
   ========================================================= */
.notif { position: relative; }
.notif__bell { position: relative; }
.notif__badge {
  position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--color-danger); color: #fff; border-radius: var(--radius-full);
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
  border: 2px solid var(--surface);
}
.notif .dropdown__menu.notif__menu {
  left: auto; right: 0; width: 360px; max-width: calc(100vw - 24px); padding: 0; overflow: hidden;
}
.notif__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: .85rem 1rem; border-bottom: 1px solid var(--border);
}
.notif__head-title { font-weight: 700; font-size: .95rem; }
.notif__readall {
  background: none; border: none; cursor: pointer; font-family: inherit;
  font-size: .82rem; font-weight: 600; color: var(--color-primary); padding: .2rem .35rem; border-radius: var(--radius-sm);
}
.notif__readall:hover { background: var(--color-primary-soft); }
.notif__list { max-height: 420px; overflow-y: auto; }
.notif__empty { padding: 2rem 1rem; text-align: center; color: var(--text-muted); font-size: .9rem; }
.notif__item {
  display: flex; gap: .75rem; align-items: flex-start; padding: .8rem 1rem;
  border-bottom: 1px solid var(--border); transition: background var(--transition); position: relative;
}
.notif__item:last-child { border-bottom: none; }
.notif__item:hover { background: var(--surface-2); }
.notif__item.is-unread { background: color-mix(in srgb, var(--color-primary-soft) 60%, transparent); }
.notif__item.is-unread::before {
  content: ""; position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 8px; height: 8px; border-radius: 50%; background: var(--color-primary);
}
.notif__item.is-unread { padding-right: 1.6rem; }
.notif__icon {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; background: var(--color-primary-soft); color: var(--color-primary);
}
.notif__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notif__title { font-size: .88rem; font-weight: 600; color: var(--text); line-height: 1.3; }
.notif__sub { font-size: 12px; color: var(--text-muted); line-height: 1.3; }
.notif__time { display: inline-flex; align-items: center; gap: .4rem; font-size: .76rem; line-height: 1; color: color-mix(in srgb, var(--text-muted) 60%, transparent); }
.notif__time svg { flex: none; display: block; }

/* Rodapé do sino: "Visualizar todas as notificações" */
.notif__foot { border-top: 1px solid var(--border); padding: .6rem; display: flex; justify-content: center; }
.notif__foot .btn { width: 100%; }

/* Página "todas as notificações": sem limite de altura, ocupa o card */
.notif--page .notif__list--page { max-height: none; overflow: visible; }
.notif--page .notif__item { padding: 1rem 1.2rem; }

@media (max-width: 600px) {
  /* fixa na viewport para nunca vazar para fora da tela */
  .notif .dropdown__menu.notif__menu {
    position: fixed; top: 64px; left: 8px; right: 8px; width: auto; max-width: none; z-index: 60;
  }
  .notif__list { max-height: 70vh; }
}


/* === 40-calendario.css === */
/* grade de 4 colunas */
.grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 600px) { .grid--4 { grid-template-columns: repeat(2, 1fr); } }

/* Faturas atrasadas (cards) */
.atraso-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; max-height: 320px; overflow: auto; }
.atraso-card { display: block; text-align: left; background: #f1f3f6; border: 0; border-radius: 10px; padding: .6rem .8rem; font: inherit; cursor: pointer; transition: background .15s; }
.atraso-card:hover { background: #e6eaf1; }
.atraso-card__num { font-weight: 700; font-size: .9rem; color: #1f2937; }
.atraso-card__info { font-size: .82rem; color: #6b7280; margin-top: .2rem; }
.atraso-card__info strong { color: #1f2937; }
@media (max-width: 560px) { .atraso-list { grid-template-columns: 1fr; } }

/* Visões gerais (linha + barra de %) */
.ov-list { display: flex; flex-direction: column; gap: .9rem; }
.ov-row__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .35rem; }
.ov-row__label { font-size: .92rem; }
.ov-row__label strong { font-weight: 800; }
.ov-row__pct { font-size: .82rem; color: var(--text-muted, #6b7280); }
.ov-bar { height: 5px; border-radius: 999px; background: #eef1f5; overflow: hidden; }
.ov-bar__fill { display: block; height: 100%; border-radius: 999px; min-width: 0; transition: width .4s ease; }

/* =========================================================
   Calendário do dashboard (faturas / propostas / contratos)
   ========================================================= */
.cal-toolbar { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .9rem; }
.cal-nav { display: flex; align-items: center; gap: .4rem; }
.cal-title { margin: 0; font-size: 1.05rem; font-weight: 800; min-width: 150px; }
.cal-filters { display: flex; gap: .85rem; flex-wrap: wrap; }

/* Modos Mês/Semana/Dia */
.cal-views { display: inline-flex; background: #f1f3f6; border-radius: 9px; padding: 3px; gap: 2px; margin-left: auto; }
.cal-views button { border: 0; background: transparent; font: inherit; font-size: .85rem; font-weight: 600; padding: .35rem .9rem; border-radius: 6px; cursor: pointer; color: #475569; }
.cal-views button.is-active { background: #fff; color: #1530e6; box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }

/* Layout: mini-cal + área principal */
.cal-body { display: flex; gap: 1.1rem; align-items: flex-start; }
.cal-aside { width: 210px; flex: none; }
.cal-main { flex: 1; min-width: 0; }

/* Mini calendário */
.minical { border: 1px solid var(--border, #e7e9ee); border-radius: 12px; padding: .7rem .8rem; }
.minical__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.minical__title { font-size: .85rem; font-weight: 700; }
.minical__nav button { border: 0; background: transparent; cursor: pointer; color: #475569; font-size: 1rem; line-height: 1; padding: .1rem .25rem; border-radius: 4px; }
.minical__nav button:hover { background: #eef1f5; }
.minical__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.minical__dow { text-align: center; font-size: .58rem; font-weight: 700; color: var(--text-muted, #6b7280); padding: .25rem 0; }
.minical__day { box-sizing: border-box; width: 100%; min-width: 0; border: 0; background: transparent; font: inherit; text-align: center; font-size: .72rem; padding: .34rem 0; border-radius: 7px; cursor: pointer; }
.minical__day:hover { background: #eef1f5; }
.minical__day.is-other { color: #cbd5e1; }
.minical__day.is-today { background: #1530e6; color: #fff; font-weight: 700; }
.minical__day.is-sel { box-shadow: inset 0 0 0 2px #1530e6; }

/* Semana / Dia */
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--border, #e7e9ee); border-radius: 12px; overflow: hidden; }
.cal-week .cal-cell { min-height: 260px; border-right: 1px solid #f1f3f6; }
.cal-week .cal-cell:nth-child(7n) { border-right: 0; }
.cal-day { border: 1px solid var(--border, #e7e9ee); border-radius: 12px; padding: 1.1rem 1.2rem; min-height: 260px; }
.cal-day__title { font-weight: 800; margin-bottom: .8rem; }
.cal-day__list { display: flex; flex-direction: column; gap: .4rem; }
.cal-day .cal-ev { white-space: normal; }
.cal-ev__val { font-weight: 700; opacity: .8; }
@media (max-width: 820px) { .cal-body { flex-direction: column; } .cal-aside { width: 100%; max-width: 300px; } .cal-views { margin-left: 0; } }

/* Modal de eventos do dia */
.cal-modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .5); display: flex; align-items: center; justify-content: center; padding: 18px; z-index: 200; }
.cal-modal[hidden] { display: none; }
.cal-modal__card { background: #fff; border-radius: 14px; width: 100%; max-width: 440px; max-height: 80vh; overflow: auto; box-shadow: 0 24px 60px rgba(0, 0, 0, .28); }
.cal-modal__head { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.2rem; border-bottom: 1px solid var(--border, #e7e9ee); position: sticky; top: 0; background: #fff; }
.cal-modal__head strong { font-size: 1rem; font-weight: 800; }
.cal-modal__close { border: 0; background: transparent; font-size: 1.4rem; line-height: 1; cursor: pointer; color: #6b7280; }
.cal-modal__body { padding: 1rem 1.2rem; display: flex; flex-direction: column; gap: .4rem; }
.cal-modal__body .cal-ev { white-space: normal; }
.cal-filter { display: inline-flex; align-items: center; gap: .35rem; font-size: .82rem; cursor: pointer; user-select: none; opacity: .4; transition: opacity .15s; }
.cal-filter.is-on { opacity: 1; }
.cal-filter .dot { width: 10px; height: 10px; border-radius: 3px; background: #94a3b8; }
.cal-filter .dot--fatura { background: #1530e6; }
.cal-filter .dot--proposta { background: #7c3aed; }
.cal-filter .dot--contrato { background: #0a8f82; }

.cal-month { border: 1px solid var(--border, #e7e9ee); border-radius: 12px; overflow: hidden; }
.cal-dow-row, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-dow { padding: .5rem; text-align: center; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted, #6b7280); background: #f8fafc; border-bottom: 1px solid var(--border, #e7e9ee); }
.cal-cell { min-height: 104px; border-right: 1px solid #f1f3f6; border-bottom: 1px solid #f1f3f6; padding: .35rem .4rem; overflow: hidden; }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell.is-other { background: #fafbfc; }
.cal-cell.is-other .cal-daynum { opacity: .4; }
.cal-daynum { display: inline-block; font-size: .78rem; font-weight: 700; margin-bottom: .2rem; min-width: 22px; }
.cal-cell.is-today .cal-daynum { background: #1530e6; color: #fff; width: 22px; height: 22px; border-radius: 50%; text-align: center; line-height: 22px; }
.cal-ev { display: block; padding: .15rem .42rem; margin-bottom: .18rem; font-size: .72rem; font-weight: 600; border-radius: 5px; border-left: 3px solid; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; cursor: pointer; transition: transform .12s; }
.cal-ev:hover { transform: translateX(2px); }
.cal-ev.ev--fatura { background: #e7ebfe; color: #1530e6; border-color: #1530e6; }
.cal-ev.ev--proposta { background: #f3e8ff; color: #7c3aed; border-color: #7c3aed; }
.cal-ev.ev--contrato { background: #d1fae5; color: #065f46; border-color: #0a8f82; }
.cal-ev.st--pago, .cal-ev.st--aceita, .cal-ev.st--assinado { text-decoration: line-through; opacity: .6; }
.cal-more { display: block; width: 100%; text-align: left; border: 0; background: transparent; font: inherit; font-size: .7rem; color: var(--color-primary, #1530e6); font-weight: 600; padding: .1rem .4rem; cursor: pointer; border-radius: 4px; }
.cal-more:hover { background: #eef1f5; }

@media (max-width: 700px) {
    .cal-cell { min-height: 74px; }
    .cal-ev { font-size: .62rem; }
    .cal-filters { margin-left: 0; }
}


/* === 40-config.css === */
/* =========================================================
   Configurações (página com abas)
   ========================================================= */
.cfg .tabs__list { overflow-x: auto; }
.cfg__card { margin-bottom: 1.25rem; overflow: visible; } /* permite dropdowns (select/datepicker) saírem do card */
.cfg__title { font-size: 1.15rem; font-weight: 700; margin-bottom: 1.1rem; }
.cfg__subtitle { font-size: .95rem; font-weight: 700; margin: 1.25rem 0 .75rem; color: var(--text); }
.cfg__actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.25rem; }
.cfg__inline { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.cfg__inline .input { flex: 1; min-width: 220px; }
.cfg .switch { margin-top: .85rem; }

.cfg__upload { display: flex; flex-direction: column; gap: .5rem; }
.cfg__thumb {
  height: 90px; border: 1px dashed var(--border); border-radius: var(--radius);
  display: grid; place-items: center; background: var(--surface-2); overflow: hidden;
}
.cfg__thumb img { max-height: 78px; max-width: 100%; object-fit: contain; }
.cfg__thumb--sm { height: 64px; width: 64px; }
.cfg__thumb--sm img { max-height: 52px; }
.cfg__thumb--og { height: 160px; max-width: 320px; aspect-ratio: 1200 / 630; }
.cfg__thumb--og img { max-height: 100%; width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-sm); }

.cfg__qr { margin-top: 1rem; text-align: center; }
.cfg__qr img { width: 240px; height: 240px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; padding: 8px; }

/* API Oficial */
.of__status { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding: .85rem 1rem; background: var(--surface-2); border-radius: var(--radius); margin-bottom: 1rem; }
.of__status-actions { display: flex; align-items: center; gap: .85rem; margin-left: auto; }
.of__status .switch { margin: 0; }
.of__feedback { margin-bottom: 1rem; }
.of__section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.of__templates { max-height: 320px; overflow-y: auto; }

/* Seletor de cor (sobrescreve o .input para virar um swatch) */
input[type="color"].input {
  -webkit-appearance: none; appearance: none;
  width: 64px; height: 42px; padding: 4px; cursor: pointer;
}
input[type="color"].input::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"].input::-webkit-color-swatch { border: 1px solid var(--border); border-radius: var(--radius-sm); }
input[type="color"].input::-moz-color-swatch { border: 1px solid var(--border); border-radius: var(--radius-sm); }

/* Campo de senha/token com botão revelar */
.cfg__pass { position: relative; }
.cfg__pass .input { padding-right: 2.6rem; }
.cfg__pass-toggle {
  position: absolute; right: .4rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--text-muted);
  display: inline-flex; padding: .35rem; border-radius: var(--radius-sm);
}
.cfg__pass-toggle:hover { color: var(--text); background: var(--surface-2); }

@media (max-width: 820px) {
  .cfg__inline .input { min-width: 0; width: 100%; }
}


/* === 50-mensagens.css === */
/* =========================================================
   Mensagens — editor + preview estilo WhatsApp
   ========================================================= */
.wa-fetch { display: flex; align-items: center; gap: .6rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.of-tpl__params { margin-top: .25rem; }
/* Variáveis — bloco expansível acima da mensagem */
.wa-vars { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: .9rem; background: var(--surface); }
.wa-vars__summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: .5rem;
  padding: .6rem .8rem; font-size: .85rem; font-weight: 600; color: var(--text);
}
.wa-vars__summary::-webkit-details-marker { display: none; }
.wa-vars__summary svg { transition: transform var(--transition); color: var(--text-muted); }
.wa-vars[open] .wa-vars__summary svg { transform: rotate(90deg); }
.wa-vars[open] .wa-vars__summary { border-bottom: 1px solid var(--border); }
.wa-vars__body { padding: .5rem .8rem .7rem; }
.wa-vars__group { display: grid; grid-template-columns: 120px 1fr; gap: .5rem; align-items: start; padding: .45rem 0; border-top: 1px solid var(--border); }
.wa-vars__group:first-child { border-top: none; }
.wa-vars__label { font-size: .78rem; font-weight: 600; color: var(--text); padding-top: .3rem; }
.wa-vars__chips { display: flex; flex-wrap: wrap; gap: .4rem; }
@media (max-width: 600px) { .wa-vars__group { grid-template-columns: 1fr; gap: .25rem; } }
.wa-var-chip {
  font-family: ui-monospace, monospace; font-size: .78rem; font-weight: 600;
  color: var(--color-primary); background: var(--color-primary-soft);
  border: 1px solid color-mix(in srgb, var(--color-primary) 25%, transparent);
  border-radius: var(--radius-full); padding: .25rem .6rem; cursor: pointer;
  transition: background var(--transition);
}
.wa-var-chip:hover { background: color-mix(in srgb, var(--color-primary) 18%, var(--surface)); }

.cfg__tpl { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-bottom: .85rem; }
.cfg__tpl-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; gap: 1rem; }

.wa-grid { display: grid; gap: 1.25rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 860px) { .wa-grid { grid-template-columns: 1fr 300px; } }

/* Editor */
.wa-editor { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.wa-editor:focus-within { border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-soft); }
.wa-toolbar { display: flex; gap: 2px; padding: 5px 8px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.wa-tool {
  width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm);
  color: var(--text-muted); cursor: pointer; font-size: 13px; font-family: inherit;
}
.wa-tool:hover { background: var(--surface); border-color: var(--border); color: var(--text); }
.wa-textarea {
  width: 100%; border: none; background: transparent; box-shadow: none;
  font-family: var(--font); font-size: .92rem; line-height: 1.5; resize: vertical; padding: 10px 12px; color: var(--text);
}
.wa-textarea:focus { outline: none; }

/* Preview — telefone usando o mockup public/assets/img/phone-mockup.png */
.wa-preview-wrap { margin-top: .35rem; }
.wa-phone {
  /* % a partir de cada borda do mockup onde a TELA começa (calibrado p/ 1200x2282) */
  --screen-top: 7%; --screen-right: 6.5%; --screen-bottom: 5%; --screen-left: 6.5%;
  position: relative; width: 100%; max-width: 300px; aspect-ratio: 1200 / 2282;
  margin: .4rem auto 0; background: #f0f2f5; border-radius: 38px;
}
.wa-phone::after {
  content: ""; position: absolute; inset: 0;
  background: url("../img/phone-mockup.png") center / contain no-repeat;
  pointer-events: none; z-index: 5;
}
.wa-phone__screen {
  position: absolute; top: var(--screen-top); right: var(--screen-right);
  bottom: var(--screen-bottom); left: var(--screen-left);
  border-radius: 24px; overflow: hidden; display: flex; flex-direction: column;
  background: #efe7dd;
}
.wa-phone__header { background: #075e54; color: #fff; padding: 10px 12px; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.wa-phone__avatar {
  width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.25); color: #fff;
  display: grid; place-items: center; font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.wa-phone__name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-phone__body {
  flex: 1; overflow-y: auto; padding: 12px 12px;
  display: flex; align-items: flex-start; justify-content: flex-end;
  background-color: #d9d2c7;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cg fill='none' stroke='%23cbc0b0' stroke-width='1' opacity='.5'%3E%3Ccircle cx='10' cy='12' r='1.5'/%3E%3Ccircle cx='30' cy='28' r='1'/%3E%3Cpath d='M22 8h3M6 30c2-1 4 0 5 2'/%3E%3C/g%3E%3C/svg%3E");
}
.wa-bubble {
  position: relative; background: #d9fdd3; color: #111; padding: 7px 10px 18px 9px;
  border-radius: 8px 0 8px 8px; max-width: 100%; min-width: 60px; font-size: 13.5px; line-height: 1.4;
  box-shadow: 0 1px .5px rgba(0,0,0,.13); word-wrap: break-word; align-self: flex-end;
}
.wa-bubble__text { display: block; white-space: pre-wrap; word-wrap: break-word; }
.wa-bubble__text strong { font-weight: 700; }
.wa-bubble__text em { font-style: italic; }
.wa-bubble__text s { text-decoration: line-through; }
.wa-bubble__text code { font-family: ui-monospace, monospace; background: rgba(0,0,0,.05); padding: 0 4px; border-radius: 3px; font-size: .92em; }
.wa-bubble__text .wa-var { background: #e0f2fe; color: #0369a1; padding: 1px 5px; border-radius: 4px; font-size: .92em; font-weight: 600; white-space: nowrap; }
.wa-bubble__text .wa-empty { color: #999; font-style: italic; }
.wa-bubble__footer { display: none; font-size: 11px; color: #667781; margin-top: 4px; }
.wa-bubble__time { position: absolute; bottom: 4px; right: 8px; font-size: 10.5px; color: #667781; }

/* Botões no preview (estilo WhatsApp) */
.wa-msg { max-width: 85%; display: flex; flex-direction: column; align-items: flex-end; }
.wa-actions { align-self: stretch; display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.wa-action {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: #fff; color: #0a7cff; border-radius: 8px; padding: 9px 8px;
  font-size: 13.5px; font-weight: 500; box-shadow: 0 1px .5px rgba(0,0,0,.13);
}
.wa-action svg { flex-shrink: 0; }
/* link real do botão de URL (preview da API Oficial) */
.of-url { font-size: 11px; color: #667781; word-break: break-all; text-align: center; margin: -2px 0 2px; padding: 0 4px; }

/* Editor de botões */
.wa-buttons { margin-bottom: 1.1rem; }
.wa-buttons__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.wa-buttons__list { display: flex; flex-direction: column; gap: .5rem; }
.wa-btn-row { display: grid; grid-template-columns: 1fr 110px 1fr auto; gap: .4rem; align-items: center; }
.wa-btn-row .input { padding: .5rem .6rem; }
@media (max-width: 700px) { .wa-btn-row { grid-template-columns: 1fr 1fr; } }


/* === 60-email.css === */
/* =========================================================
   Preview do template de e-mail
   ========================================================= */
.email-prev {
  background: #fff; border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  box-shadow: var(--shadow); align-self: start; width: 100%; max-width: 640px;
}
.email-prev__head { background: #025efd; padding: 22px; text-align: center; }
.email-prev__logo { max-height: 42px; display: inline-block; }
.email-prev__name { color: #fff; font-size: 19px; font-weight: 700; }
.email-prev__body { padding: 24px; }
.email-prev__greet { margin: 0 0 12px; font-size: 14.5px; color: #374151; }
.email-prev__greet:empty { display: none; }
.email-prev__title { margin: 0 0 12px; font-size: 19px; font-weight: 700; color: #111827; }
.email-prev__text { margin: 0; font-size: 14px; line-height: 1.6; color: #374151; }
.email-prev__btn {
  display: inline-block; margin: 20px 0 6px; background: #025efd; color: #fff;
  font-weight: 600; font-size: 14px; padding: 12px 24px; border-radius: 8px; text-decoration: none; cursor: default;
}
.email-prev__sign { margin: 18px 0 0; font-size: 14px; color: #374151; white-space: pre-line; }
.email-prev__sign:empty { display: none; }
.email-prev__foot { background: #f9fafb; border-top: 1px solid #e5e7eb; padding: 16px 24px; text-align: center; }
.email-prev__foot span { display: block; font-size: 12px; color: #6b7280; line-height: 1.6; }
.email-prev__foot span:empty { display: none; }

@media (max-width: 820px) { .email-prev { max-width: 100%; } }

/* Editor de e-mail por evento: editor à esquerda, preview à direita */
.eml-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; align-items: start; }
@media (max-width: 980px) { .eml-grid { grid-template-columns: 1fr; } }


/* === 70-cliente.css === */
/* =========================================================
   Workspace do cliente (abas laterais na edição)
   ========================================================= */
.cliw { display: grid; grid-template-columns: 240px 1fr; gap: 1.25rem; align-items: start; }

.cliw__nav { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: .55rem; position: sticky; top: 84px; }
.cliw__head { padding: .5rem .6rem .75rem; border-bottom: 1px solid var(--border); margin-bottom: .4rem; }
.cliw__head-id { font-size: .75rem; color: var(--text-muted); }
.cliw__head-name { font-weight: 700; font-size: .95rem; line-height: 1.3; }
.cliw__link {
  display: flex; align-items: center; gap: .6rem; padding: .6rem .7rem; border-radius: var(--radius);
  color: var(--text-muted); font-size: .9rem; font-weight: 500; transition: background var(--transition), color var(--transition);
}
.cliw__link:hover { background: var(--surface-2); color: var(--text); }
.cliw__link.is-active { background: var(--color-primary-soft); color: var(--color-primary); font-weight: 600; }
.cliw__link svg { flex-shrink: 0; }
.cliw__badge {
  flex: 0 0 auto; margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--text-muted);
  border-radius: var(--radius-full); font-size: .72rem; font-weight: 700; line-height: 1;
}
.cliw__link.is-active .cliw__badge { background: var(--color-primary); color: #fff; }

.cliw__main { min-width: 0; }

/* Barra de salvar (página de mensagens) */
.msg-save {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; justify-content: flex-end; gap: .6rem;
  padding: .85rem 0; margin-top: .25rem;
  background: linear-gradient(to top, var(--bg, var(--surface-2)) 65%, transparent);
}

/* Modal maior e rolável (form de contato) */
/* Seção com fundo cinza-claro (permissões / notificações) */
.check-section { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem; margin-top: 1rem; }
.check-section__title { font-size: .9rem; font-weight: 700; margin: 0 0 .75rem; }

/* Chips selecionáveis (permissões / notificações) */
.check-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
@media (max-width: 560px) { .check-grid-4 { grid-template-columns: repeat(2, 1fr); } }

.check-chip {
  display: flex; align-items: center; gap: .5rem; cursor: pointer; user-select: none;
  padding: .55rem .7rem; border: 1.5px solid var(--border); border-radius: var(--radius);
  background: var(--surface); font-size: .85rem; color: var(--text);
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}
.check-chip:hover { border-color: var(--color-primary); }
.check-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.check-chip__box {
  width: 18px; height: 18px; flex-shrink: 0; border: 2px solid var(--border); border-radius: 5px;
  display: grid; place-items: center; color: #fff; transition: background var(--transition), border-color var(--transition);
}
.check-chip__box svg { opacity: 0; transition: opacity var(--transition); }
.check-chip input:checked ~ .check-chip__box { background: var(--color-primary); border-color: var(--color-primary); }
.check-chip input:checked ~ .check-chip__box svg { opacity: 1; }
.check-chip:has(input:checked) { border-color: var(--color-primary); }
.check-chip input:focus-visible ~ .check-chip__box { outline: 2px solid var(--color-primary); outline-offset: 2px; }

.modal__dialog--lg { width: 100%; max-width: 720px; display: flex; flex-direction: column; max-height: 90vh; }
.modal__dialog--lg .modal__scroll { overflow-y: auto; padding-right: .25rem; margin: .25rem 0 1rem; }
.modal__dialog--lg .modal__footer { margin-top: 0; }

/* Responsivo: em telas pequenas o modal ocupa a tela toda */
@media (max-width: 640px) {
  .modal { padding: 0; }
  .modal__dialog--lg { max-width: 100%; max-height: 100vh; height: 100%; border-radius: 0; padding: 1.1rem; }
  .modal__dialog--lg .modal__footer { flex-direction: column-reverse; gap: .5rem; }
  .modal__dialog--lg .modal__footer .btn { width: 100%; }
}

@media (max-width: 860px) {
  .cliw { grid-template-columns: 1fr; }
  .cliw__nav { position: static; }
}

/* =========================================================
   Área do cliente no mobile — cara de app (tab bar + dashboard)
   ========================================================= */

/* Tab bar inferior: só existe no mobile */
.tabbar { display: none; }

/* Dashboard do cliente */
.cdash__hero { margin-bottom: 1.25rem; }
.cdash__greet { color: var(--text-muted); font-size: .95rem; }
.cdash__name { font-size: 1.5rem; font-weight: 800; line-height: 1.2; }
.cdash__company { color: var(--text-muted); font-size: .9rem; margin-top: .1rem; }

/* "Saldo"/total em aberto no header — só aparece no mobile (no desktop é um stat_card) */
.cdash__balance { display: none; }
/* Wrapper que some no mobile sem quebrar a grade (display:contents no desktop) */
.cdash__only-desktop { display: contents; }

/* Grade dos cards de resumo (stat_card do admin): responsiva no desktop e mobile */
.cdash__stats {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-bottom: 1.5rem;
}

.cdash__section { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); font-weight: 700; margin: 0 0 .75rem; }
.cdash__tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .75rem; }
.cdash__tile {
  display: flex; align-items: center; gap: .85rem;
  padding: 1rem; border-radius: var(--radius-lg);
  border: 1px solid var(--border); background: var(--surface);
  text-decoration: none; color: inherit;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.cdash__tile:hover { border-color: var(--color-primary); box-shadow: var(--shadow-sm); }
.cdash__tile:active { transform: scale(.98); }
.cdash__tile-icon {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--color-primary-soft); color: var(--color-primary);
}
.cdash__tile-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cdash__tile-label { font-weight: 700; font-size: .98rem; }
.cdash__tile-desc { font-size: .82rem; color: var(--text-muted); }
.cdash__tile-chevron { color: var(--text-muted); flex: 0 0 auto; }

@media (max-width: 820px) {
  /* No mobile a navegação vira tab bar: esconde sidebar e o botão de menu */
  .cliente-app .sidebar { display: none; }
  .cliente-app [data-sidebar-toggle] { display: none; }

  /* Topo respeita o notch e fica mais compacto/app */
  .cliente-app .topbar { padding-top: env(safe-area-inset-top); height: calc(56px + env(safe-area-inset-top)); }
  /* Nome longo da empresa não quebra linha: trunca em reticências */
  .cliente-app .topbar__lead { min-width: 0; flex: 1; }
  .cliente-app .topbar__title {
    font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
  }
  .cliente-app .topbar__actions { flex: 0 0 auto; }

  /* Espaço pro conteúdo não ficar atrás da tab bar */
  .cliente-app .page { padding: 1.1rem 1rem calc(76px + env(safe-area-inset-bottom)); }

  .cliente-app .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: var(--surface); border-top: 1px solid var(--border);
    padding: .4rem .25rem calc(.4rem + env(safe-area-inset-bottom));
    box-shadow: 0 -2px 12px rgba(0,0,0,.05);
  }
  .tabbar__link {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: .15rem;
    padding: .35rem .15rem; border-radius: var(--radius);
    color: var(--text-muted); text-decoration: none; min-width: 0;
    transition: color var(--transition);
  }
  .tabbar__link.is-active { color: var(--color-primary); }
  .tabbar__label {
    font-size: .68rem; font-weight: 600; line-height: 1;
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }

  /* ---- Header estilo app (fintech): gradiente + saldo em destaque ---- */
  .cliente-app .cdash__hero {
    margin: -.2rem -.2rem 1.25rem; padding: 1.35rem 1.3rem 1.45rem;
    border-radius: 22px; color: #fff; text-align: left;
    background: linear-gradient(135deg, var(--color-primary), color-mix(in srgb, var(--color-primary) 55%, #000));
    box-shadow: 0 14px 30px -14px color-mix(in srgb, var(--color-primary) 80%, transparent);
  }
  .cliente-app .cdash__greet { color: rgba(255, 255, 255, .85); }
  .cliente-app .cdash__name { color: #fff; font-size: 1.4rem; }
  .cliente-app .cdash__company { color: rgba(255, 255, 255, .8); }

  .cliente-app .cdash__balance {
    display: flex; flex-direction: column; gap: .15rem;
    margin-top: 1.1rem; padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, .2);
    text-decoration: none; color: #fff;
  }
  .cdash__balance-label { font-size: .8rem; color: rgba(255, 255, 255, .8); }
  .cdash__balance-value { font-size: 2rem; font-weight: 800; line-height: 1.1; letter-spacing: -.5px; }
  .cdash__balance-sub {
    display: inline-flex; align-items: center; gap: .3rem;
    font-size: .82rem; color: rgba(255, 255, 255, .85); margin-top: .15rem;
  }
  .cdash__balance-sub.is-danger { color: #fecaca; font-weight: 600; }

  /* Faturas em aberto já está no "saldo" do header → esconde o card duplicado */
  .cliente-app .cdash__only-desktop { display: none; }

  /* Reordena no mobile: hero → acesso rápido → cards de resumo */
  .cliente-app .cdash { display: flex; flex-direction: column; }
  .cliente-app .cdash__hero    { order: 1; }
  .cliente-app .cdash__section { order: 2; }
  .cliente-app .cdash__tiles   { order: 3; }
  .cliente-app .cdash__stats   { order: 4; margin-bottom: 0; margin-top: 1.25rem; }

  /* Cards de resumo: no dashboard ocupam a largura toda (1 por linha) no mobile */
  .cliente-app .cdash__stats { grid-template-columns: 1fr; gap: .6rem; }
  .cliente-app .stat-grid { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
  .cliente-app .cdash__stats .stat-card,
  .cliente-app .stat-grid .stat-card { padding: .9rem .85rem; gap: .6rem; }
  .cliente-app .cdash__stats .stat-card__value { font-size: 1.25rem; }
  .cliente-app .stat-grid .stat-card__value { font-size: 0.8em; }

  /* ---- Acesso rápido como grade de ícones (estilo app) ---- */
  .cliente-app .cdash__tiles { grid-template-columns: repeat(3, 1fr); gap: .6rem; }
  .cliente-app .cdash__tile {
    flex-direction: column; align-items: center; text-align: center; gap: .5rem;
    padding: 1rem .4rem;
  }
  .cliente-app .cdash__tile-text { flex: none; align-items: center; }
  .cliente-app .cdash__tile-icon { width: 50px; height: 50px; }
  .cliente-app .cdash__tile-label { font-size: .74rem; line-height: 1.2; }
  .cliente-app .cdash__tile-desc,
  .cliente-app .cdash__tile-chevron { display: none; }
}


/* === 80-faturas.css === */
/* =========================================================
   Faturas — editor de itens
   ========================================================= */
.fat-itens__bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 1.25rem 0 .6rem; }

.fat-itens { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem; background: var(--surface-2); }
.fat-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-bottom: .75rem; }
.fat-item:last-child { margin-bottom: 0; }
.fat-item__grid { display: grid; grid-template-columns: 1fr 90px 170px 40px; gap: .75rem; align-items: end; }

.fat-f { display: flex; flex-direction: column; gap: .3rem; font-size: .78rem; font-weight: 600; color: var(--text-muted); }
.fat-f input, .fat-f textarea { font-weight: 400; color: var(--text); }
.fat-f--num input { text-align: right; }
.fat-f--rm { align-self: end; }
.fat-item > .fat-f { margin-top: .7rem; }
.fat-item .note-editor.note-frame { border-radius: var(--radius); margin-top: .15rem; }

/* Resumo com gradiente */
.fat-resumo {
  margin-top: 1rem; border-radius: var(--radius-lg); padding: 1.1rem 1.25rem;
  background: linear-gradient(135deg, var(--color-primary-soft), #eef4ff);
  display: flex; flex-direction: column; gap: .65rem;
}
.fat-resumo__row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-size: .95rem; }
.fat-resumo__descrow { display: flex; gap: .5rem; }
.fat-resumo__descrow .input:last-child { flex: 1; }
.fat-resumo__total { border-top: 1px solid rgba(2, 94, 253, .25); padding-top: .65rem; font-size: 1.2rem; }
.fat-resumo__total span, .fat-resumo__total strong { color: var(--color-primary); font-weight: 700; }

@media (max-width: 680px) {
  .fat-item__grid { grid-template-columns: 1fr 1fr; }
  .fat-f--titulo { grid-column: 1 / -1; }
  .fat-f--rm { grid-column: 2; justify-self: end; }
}


/* === 90-select.css === */
/* =========================================================
   Select com busca (combobox / autocomplete) — do UI Kit
   ========================================================= */
.select { position: relative; }
.select__control { position: relative; display: flex; align-items: center; }
.select__input { padding-right: 4.2rem; }
.select__chevron {
  position: absolute; right: .75rem; display: grid; place-items: center;
  color: var(--text-muted); pointer-events: none; transition: transform var(--transition);
}
.select.is-open .select__chevron { transform: rotate(180deg); }
.select__clear {
  position: absolute; right: 2.3rem; display: grid; place-items: center;
  width: 22px; height: 22px; padding: 0; border: none; background: none; cursor: pointer;
  color: var(--text-muted); border-radius: var(--radius-full);
  transition: background var(--transition), color var(--transition);
}
.select__clear:hover { background: var(--surface-2); color: var(--text); }

.select__menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: .35rem; max-height: 260px; overflow: auto;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
}
.select.is-open .select__menu { opacity: 1; visibility: visible; transform: none; }

.select__option {
  display: flex; align-items: center; gap: .6rem; width: 100%; text-align: left;
  border: none; background: none; cursor: pointer; font-family: inherit; font-size: .9rem;
  color: var(--text); padding: .55rem .7rem; border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.select__option:hover, .select__option.is-active { background: var(--surface-2); }
.select__option.is-selected { color: var(--color-primary); font-weight: 600; }
.select__text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.select__text mark { background: var(--color-primary-soft); color: var(--color-primary); border-radius: 3px; padding: 0 1px; }
.select__check { color: var(--color-primary); flex-shrink: 0; opacity: 0; }
.select__option.is-selected .select__check { opacity: 1; }
.select__empty { padding: 1.1rem; text-align: center; color: var(--text-muted); font-size: .88rem; }

/* Multiselect (checkboxes em dropdown) */
.msel { position: relative; }
.msel__control { display: flex; align-items: center; justify-content: space-between; gap: .5rem; width: 100%; cursor: pointer; text-align: left; }
.msel__tags { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msel__tags.is-empty { color: var(--text-muted); }
.msel .select__chevron { right: .75rem; }
.msel.is-open .select__chevron { transform: rotate(180deg); }
.msel__menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: .6rem .8rem;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
}
.msel.is-open .msel__menu { opacity: 1; visibility: visible; transform: none; }
.msel__menu .check { margin-bottom: .5rem; }
.msel__menu .check:last-child { margin-bottom: 0; }
.msel__bulk { display: flex; gap: .4rem; margin: -.1rem 0 .6rem; }
.msel__bulk-btn {
  flex: 1; padding: .4rem .5rem; border: 1px solid var(--border); background: var(--surface-2);
  border-radius: var(--radius-sm); cursor: pointer; font-family: inherit; font-size: .82rem; font-weight: 600;
  color: var(--text-muted); transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.msel__bulk-btn:hover { background: var(--color-primary-soft); color: var(--color-primary); border-color: var(--color-primary); }


/* === 91-datepicker.css === */
/* =========================================================
   Datepicker customizado — do UI Kit
   ========================================================= */
.input-group { position: relative; display: flex; align-items: center; }
.input-group svg { position: absolute; left: .75rem; color: var(--text-muted); pointer-events: none; }
.input-group .input { padding-left: 2.4rem; }
.input-group--date svg { z-index: 1; }

.datepicker { position: relative; }
.datepicker__input { cursor: pointer; padding-left: 2.4rem; }
.datepicker__calendar {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; width: 280px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: .85rem;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
}
.datepicker.is-open .datepicker__calendar { opacity: 1; visibility: visible; transform: none; }
.datepicker__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.datepicker__title { font-weight: 600; font-size: .95rem; }
.datepicker__nav { background: none; border: none; cursor: pointer; color: var(--text-muted); width: 30px; height: 30px; border-radius: var(--radius-sm); display: grid; place-items: center; }
.datepicker__nav:hover { background: var(--surface-2); color: var(--text); }
.datepicker__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.datepicker__dow { text-align: center; font-size: .7rem; font-weight: 600; color: var(--text-muted); padding: .25rem 0; text-transform: uppercase; }
.datepicker__day {
  border: none; background: none; cursor: pointer; aspect-ratio: 1; border-radius: var(--radius-sm);
  font-family: inherit; font-size: .85rem; color: var(--text); display: grid; place-items: center;
  transition: background var(--transition), color var(--transition);
}
.datepicker__day:hover { background: var(--surface-2); }
.datepicker__day.is-muted { color: var(--text-muted); opacity: .4; }
.datepicker__day.is-today { box-shadow: inset 0 0 0 1px var(--color-primary); color: var(--color-primary); font-weight: 600; }
.datepicker__day.is-selected { background: var(--color-primary); color: #fff; font-weight: 600; }
.datepicker__foot { display: flex; justify-content: space-between; margin-top: .6rem; padding-top: .6rem; border-top: 1px solid var(--border); }
.datepicker__action { background: none; border: none; cursor: pointer; font-family: inherit; font-size: .85rem; font-weight: 600; color: var(--color-primary); padding: .25rem .5rem; border-radius: var(--radius-sm); }
.datepicker__action:hover { background: var(--color-primary-soft); }


/* === 92-rte.css === */
/* =========================================================
   RTEditor — rich text próprio (in-house)
   ========================================================= */
.rte { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.rte__toolbar { display: flex; flex-wrap: wrap; gap: .1rem; padding: .35rem; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.rte__btn {
  width: 30px; height: 30px; border: 0; background: none; border-radius: var(--radius-sm); cursor: pointer;
  color: var(--text); display: grid; place-items: center; font-size: .9rem; line-height: 1;
  transition: background var(--transition);
}
.rte__btn:hover { background: var(--surface); }
.rte { font-weight: 400; }
.rte__content {
  min-height: 120px; max-height: 360px; overflow-y: auto; padding: .65rem .8rem;
  font-size: .9rem; font-weight: 400; line-height: 1.5; color: var(--text); outline: none;
}
.rte__content:empty::before { content: attr(data-ph); color: var(--text-muted); }
.rte__content p { margin: 0 0 .5rem; }
.rte__content ul, .rte__content ol { margin: 0 0 .5rem 1.25rem; }
.rte__content a { color: var(--color-primary); }


/* === 93-drawer.css === */
/* =========================================================
   Drawer lateral (painel de detalhes) + painel de fatura
   ========================================================= */
/* Botão que parece link (nº da fatura) */
.link-btn { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-weight: 700; color: var(--color-primary); }
.link-btn:hover { text-decoration: underline; }

.drawer { position: fixed; inset: 0; z-index: 80; visibility: hidden; }
.drawer__overlay { position: absolute; inset: 0; background: rgba(15, 23, 42, .45); opacity: 0; transition: opacity .25s ease; }
.drawer__panel {
  position: absolute; top: 0; right: 0; height: 100%; width: min(780px, 96vw);
  background: #fff; box-shadow: -10px 0 40px rgba(0, 0, 0, .18);
  transform: translateX(100%); transition: transform .28s ease; overflow-y: auto;
}
.drawer.is-open { visibility: visible; }
.drawer.is-open .drawer__overlay { opacity: 1; }
.drawer.is-open .drawer__panel { transform: none; }

/* Painel da fatura */
.painel { padding: 1.25rem 1.5rem 2rem; }
.painel__bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 0 1rem; margin: 0 0 1rem; border-bottom: 1px solid var(--border); background: #fff; }
.painel__actions { display: flex; align-items: center; gap: .5rem; }
.painel__actions form { margin: 0; }
.painel__controls { display: flex; align-items: center; gap: .5rem 1rem; flex-wrap: wrap; margin: 0 0 1rem; }
.painel__controls .painel__status,
.painel__controls .painel__tags { margin: 0; }
.painel__status { display: flex; align-items: center; gap: .5rem; margin: 0 0 1rem; flex-wrap: wrap; }
.painel__status .input, .painel__status .btn { height: 38px; }
.painel__status .btn { padding-top: 0; padding-bottom: 0; }
.painel__tags { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }

/* Linha de status/recorrência/cobrança (badges à esquerda, ações compactas à direita) */
.painel__meta-row { flex: 1 1 100%; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.painel__meta-row form { margin: 0; }
.painel__meta-actions { display: flex; align-items: center; gap: .4rem; margin-left: auto; }
.painel__meta-actions .btn--icon { display: inline-flex; align-items: center; justify-content: center; }
.painel__meta-actions .btn--icon svg { display: block; }

/* Aplicar nota de crédito na fatura (painel) */
.painel__credito { width: 100%; border: 1px solid var(--border); border-radius: var(--radius-lg, 12px); padding: .85rem 1rem; background: var(--surface-2); }
.painel__credito-head { display: flex; align-items: center; gap: .45rem; font-weight: 600; font-size: .9rem; }
.painel__credito-head svg { color: #16a34a; flex: none; }
.painel__credito-head .muted { font-weight: 500; margin-left: auto; }
.painel__credito-applied { display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-size: .9rem; padding: .5rem 0 .25rem; }
.painel__credito-applied strong { color: #16a34a; }
.painel__credito-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .2rem 0; font-size: .85rem; }
.painel__credito-row form { margin: 0; }
.painel__credito-hint { margin: .55rem 0 .3rem; font-size: .82rem; color: var(--text-muted); line-height: 1.4; }
.painel__credito-form { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; border-top: 1px solid var(--border); padding: .6rem 0 .2rem; margin: 0; }
.painel__credito-info { display: flex; flex-direction: column; line-height: 1.2; margin-right: auto; }
.painel__credito-info .muted { font-size: .78rem; }
.painel__credito-input { display: flex; align-items: center; gap: .3rem; border: 1px solid var(--border); border-radius: var(--radius); padding: 0 .55rem; background: var(--surface); height: 38px; }
.painel__credito-currency { color: var(--text-muted); font-size: .85rem; }
.painel__credito-input .input { border: 0; background: none; padding: 0; height: 36px; width: 84px; box-shadow: none; }
.painel__credito-form select.input { height: 38px; padding-top: 0; padding-bottom: 0; }
.painel__credito-form .btn { height: 38px; padding-top: 0; padding-bottom: 0; }

/* Dropdown "Mais" (native details) */
.painel__more { position: relative; }
.painel__more > summary { list-style: none; cursor: pointer; }
.painel__more > summary::-webkit-details-marker { display: none; }
.painel__more-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; min-width: 280px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: .4rem;
}
.painel__more-menu form { margin: 0; }
.painel__more-item { display: flex; align-items: center; gap: .5rem; width: 100%; text-align: left; white-space: nowrap; background: none; border: 0; cursor: pointer; padding: .55rem .6rem; border-radius: var(--radius-sm); font: inherit; font-size: .9rem; color: var(--text); }
.painel__more-item:hover { background: var(--surface-2); }
.painel__more-item--danger { color: var(--color-danger); }
.painel__more-item--danger:hover { background: var(--color-danger-soft); }

.painel__doc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; }
.painel__head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.5rem; font-size: .88rem; line-height: 1.5; }
.painel__head > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.painel__num { font-size: 1.3rem; font-weight: 800; color: var(--color-primary); margin-bottom: .4rem; }
.painel__meta { text-align: right; }

.painel__itens { width: 100%; border-collapse: collapse; margin: 1.5rem 0 .5rem; font-size: .9rem; }
.painel__itens thead th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); background: var(--surface-2); padding: .55rem .6rem; }
.painel__itens thead th:nth-child(3), .painel__itens thead th:nth-child(4), .painel__itens thead th:nth-child(5) { text-align: right; }
.painel__itens td { padding: .65rem .6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.painel__itens td:nth-child(3), .painel__itens td:nth-child(4), .painel__itens td:nth-child(5) { text-align: right; white-space: nowrap; }

.painel__totais { margin-left: auto; max-width: 100%; display: flex; flex-direction: column; gap: .45rem; margin-top: 1rem; }
.painel__totais-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; font-size: .92rem; }
.painel__totais-row > :first-child { min-width: 0; }
.painel__totais-row > :last-child { flex: none; white-space: nowrap; text-align: right; }
.painel__totais-devido { border-top: 1px solid var(--border); padding-top: .5rem; color: var(--color-danger); font-size: 1.05rem; }
.painel__totais-devido strong { color: var(--color-danger); }
.painel__totais-pago { border-top: 1px solid var(--border); padding-top: .5rem; color: var(--color-success); font-size: 1.05rem; }
.painel__totais-pago strong { color: var(--color-success); }
.painel__obs { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); font-size: .9rem; }

.painel__hist { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.painel__hist-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .7rem; }
.painel__hist-item { display: flex; gap: .6rem; align-items: flex-start; font-size: .88rem; }
.painel__hist-dot { flex: none; width: 8px; height: 8px; border-radius: 999px; background: var(--color-primary, #2563eb); margin-top: .42rem; }

/* ---------- Recibo do pagamento (drawer) ---------- */
.recibo { font-size: .9rem; line-height: 1.55; }
.recibo__head { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1.6rem; }
.recibo__party strong { display: block; font-size: .95rem; margin-bottom: .25rem; }
.recibo__party--right { text-align: right; }
.recibo__cliente a { color: var(--color-primary); text-decoration: none; }
.recibo__cliente a:hover { text-decoration: underline; }
.recibo__ln { color: var(--muted, #6b7280); font-size: .84rem; }
.recibo__title { font-size: 1.4rem; font-weight: 800; margin: .5rem 0 1.2rem; }
.recibo__info { margin: 0 0 1.2rem; display: flex; flex-direction: column; gap: .55rem; }
.recibo__row { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; border-bottom: 1px dashed var(--border); padding-bottom: .55rem; }
.recibo__row dt { font-weight: 600; color: var(--text); margin: 0; }
.recibo__row dd { margin: 0; text-align: right; word-break: break-all; }
.recibo__row code { font-size: .82rem; }
.recibo__total { background: var(--surface-2); border-radius: var(--radius); padding: .9rem 1.1rem; margin: 0 0 1.6rem; }
.recibo__total-lbl { display: block; font-size: .82rem; color: var(--muted, #6b7280); margin-bottom: .15rem; }
.recibo__total-val { font-size: 1.25rem; font-weight: 800; }
.recibo__sub { font-size: 1rem; font-weight: 700; margin: 0 0 .7rem; }

@media (max-width: 560px) {
  .painel { padding: 1rem; } .painel__doc { padding: 1rem; } .painel__head { grid-template-columns: 1fr; } .painel__meta { text-align: left; }
  .recibo__head { grid-template-columns: 1fr; }
  .recibo__party--right { text-align: left; }
}


/* === 95-cadastro.css === */
/* =========================================================
   Cadastro público de cliente (/cadastro) — página standalone
   ========================================================= */
.cad-body { background: var(--bg, #eef1f5); margin: 0; }
.cad {
  max-width: 760px; margin: 0 auto; padding: 28px 16px 56px;
  display: flex; flex-direction: column; gap: 18px;
}
.cad__head { display: flex; justify-content: center; padding: 6px 0 2px; }
.cad__logo { height: 40px; width: auto; }
.cad__brand { display: inline-flex; align-items: center; gap: .55rem; font-size: 1.15rem; font-weight: 800; color: var(--text); }
.cad__brand-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--color-primary); box-shadow: 0 0 0 4px var(--color-primary-soft); }

.cad__card {
  background: var(--surface, #fff); border: 1px solid var(--border);
  border-radius: var(--radius-lg, 16px); padding: 1.8rem 1.8rem 2rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .08);
}
.cad__title { font-size: 1.5rem; font-weight: 800; margin: 0 0 .25rem; color: var(--text); }
.cad__subtitle { color: var(--text-muted); margin: 0 0 1.4rem; font-size: .95rem; line-height: 1.5; }

.cad__section {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted); font-weight: 700;
  margin: 1.6rem 0 .9rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border);
}
.cad__card .field { margin-bottom: .9rem; }
.cad__card .grid { margin-bottom: 0; }

.cad__alert {
  display: flex; align-items: center; gap: .55rem;
  background: var(--color-danger-soft); color: var(--color-danger);
  border-radius: var(--radius); padding: .75rem .9rem; margin-bottom: 1.2rem;
  font-size: .9rem; font-weight: 500;
}
.cad__alert svg { flex: none; }

.cad__foot { text-align: center; color: var(--text-muted); font-size: .82rem; }

/* Estado de sucesso */
.cad__success { text-align: center; padding: 1.5rem 0 .5rem; }
.cad__success-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 68px; height: 68px; border-radius: 50%; margin-bottom: 1rem;
  background: var(--color-success-soft); color: var(--color-success);
}
.cad__success .cad__subtitle { margin-bottom: 1.5rem; }

@media (max-width: 560px) {
  .cad { padding: 18px 12px 40px; }
  .cad__card { padding: 1.25rem 1.1rem 1.5rem; }
  .cad__title { font-size: 1.3rem; }
}


/* === 95-uploader.css === */
/* =========================================================
   Uploader (drag & drop) — do UI Kit
   ========================================================= */
.uploader__dropzone {
  display: flex; flex-direction: column; align-items: center; gap: .5rem; text-align: center;
  padding: 2.5rem 1.5rem; border: 2px dashed var(--border); border-radius: var(--radius-lg);
  color: var(--text-muted); cursor: pointer; background: var(--surface-2);
  transition: border-color var(--transition), background var(--transition), color var(--transition), transform var(--transition);
}
.uploader__dropzone:hover, .uploader__dropzone:focus-visible { border-color: var(--color-primary); color: var(--text); outline: none; }
.uploader.is-dragover .uploader__dropzone { border-color: var(--color-primary); background: var(--color-primary-soft); color: var(--color-primary); transform: scale(1.01); }
.uploader__text { margin: 0; font-size: .95rem; }
.uploader__browse { color: var(--color-primary); font-weight: 600; text-decoration: underline; }
.uploader__hint { margin: 0; font-size: .8rem; opacity: .8; }

.uploader__list { list-style: none; padding: 0; margin: .9rem 0 0; display: flex; flex-direction: column; gap: .5rem; }
.uploader__file { display: flex; align-items: center; gap: .75rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem .75rem; }
.uploader__thumb { width: 40px; height: 40px; border-radius: var(--radius-sm); flex-shrink: 0; background: var(--surface-2); display: grid; place-items: center; color: var(--color-primary); font-size: .7rem; font-weight: 700; }
.uploader__meta { flex: 1; min-width: 0; }
.uploader__name { font-size: .9rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uploader__size { font-size: .78rem; color: var(--text-muted); }
.uploader__remove { border: none; background: var(--surface-2); color: var(--text-muted); cursor: pointer; width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; line-height: 1; display: grid; place-items: center; padding: 0; transition: background var(--transition), color var(--transition); }
.uploader__remove:hover { background: var(--color-danger); color: #fff; }

