/* =====================================================================
   BIRTH HOSTING MANAGER - Estilo base (tema Light)
   ===================================================================== */

:root {
  /* Cores da marca Birth: roxo #8F6CFF (logo) e grafite #242424.
     --brand é o mesmo roxo um pouco mais escuro, para texto branco legível (contraste AA). */
  --brand: #7350ee;
  --brand-600: #5f3fd6;
  --brand-soft: #f1edff;
  --brand-300: #8f6cff;
  --brand-logo: #8f6cff;

  --ink: #242424;
  --ink-2: #33343d;
  --muted: #6b6e7b;
  --faint: #a2a4ae;

  --bg: #f7f7fa;
  --surface: #ffffff;
  --line: #e7e7ed;
  --line-soft: #f1f1f4;

  --ok: #12b76a;
  --ok-soft: #e7f8f0;
  --warn: #f79009;
  --warn-soft: #fef4e6;
  --danger: #e5484d;
  --danger-soft: #fdecec;
  --info: #2e90fa;
  --info-soft: #eaf3fe;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(23, 25, 35, .04), 0 4px 16px rgba(23, 25, 35, .04);
  --sidebar: 248px;
  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-600); }

h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); border: 0;
}

/* ---------- Marca ---------- */
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-logo { height: 30px; width: auto; display: block; }
.brand-tag {
  font-size: 10.5px; line-height: 1.15; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); padding-left: 12px; border-left: 2px solid var(--brand-logo);
}

/* ---------- Botões e formulários ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: var(--radius-sm);
  border: 1px solid transparent; font: inherit; font-weight: 600; font-size: 14px;
  cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); color: #fff; }
.btn-primary:disabled { background: var(--faint); cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.btn-ghost:hover { background: var(--line-soft); color: var(--ink); }
.btn-block { width: 100%; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field small { font-size: 12px; color: var(--muted); }
.input {
  height: 44px; padding: 0 14px; width: 100%;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }

/* ---------- Alertas ---------- */
.alert {
  padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px;
  margin-bottom: 14px; border: 1px solid transparent;
}
.alert-error { background: var(--danger-soft); color: #b42318; border-color: #f9d0d1; }
.alert-success { background: var(--ok-soft); color: #067647; border-color: #c4ecd9; }
.alert-info { background: var(--info-soft); color: #175cd3; border-color: #cfe2fc; }

/* ---------- Telas de acesso (login / instalação) ---------- */
.auth-wrap {
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center; padding: 24px 16px;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(115, 80, 238, .14), transparent 60%),
    radial-gradient(700px 400px at 110% 110%, rgba(155, 143, 240, .14), transparent 60%),
    var(--bg);
}
.auth-card {
  width: 100%; max-width: 420px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
  padding: 32px 28px;
}
.auth-card.wide { max-width: 640px; }
.auth-card .brand { margin-bottom: 28px; }
.auth-card h1 { font-size: 22px; margin-bottom: 6px; }
.auth-card .lead { color: var(--muted); margin: 0 0 24px; font-size: 14px; }
.auth-foot { text-align: center; font-size: 12px; color: var(--faint); margin-top: 20px; }

/* Lista de verificação do instalador */
.checklist { list-style: none; margin: 0 0 24px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.checklist li { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: start; padding: 11px 14px; border-top: 1px solid var(--line-soft); font-size: 14px; }
.checklist li:first-child { border-top: 0; }
.checklist .dot { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; margin-top: 2px; }
.checklist .ok .dot { background: var(--ok); }
.checklist .bad .dot { background: var(--danger); }
.checklist .opt .dot { background: var(--warn); }
.checklist .val { color: var(--muted); font-size: 13px; text-align: right; }
.checklist .hint { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ---------- Estrutura do painel ---------- */
.app { min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar);
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 20px 14px; z-index: 30;
}
.sidebar .brand { padding: 4px 8px 22px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 14px 10px 6px; }
.nav a, .nav span.soon {
  display: flex; align-items: center; gap: 11px; height: 40px; padding: 0 10px;
  border-radius: var(--radius-sm); color: var(--muted); font-weight: 500; font-size: 14px;
}
.nav a:hover { background: var(--line-soft); color: var(--ink); }
.nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav span.soon { opacity: .55; cursor: default; }
.nav span.soon em { margin-left: auto; font-style: normal; font-size: 10px; font-weight: 700; background: var(--line-soft); padding: 2px 6px; border-radius: 6px; }
.nav svg { width: 19px; height: 19px; flex-shrink: 0; }
.sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; flex-shrink: 0; }
.user-chip .who { min-width: 0; flex: 1; }
.user-chip .who strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .who span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { color: var(--danger); border-color: #f9d0d1; background: var(--danger-soft); }
.icon-btn svg { width: 17px; height: 17px; }

.main { margin-left: var(--sidebar); padding: 28px 32px 48px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.stat-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.stat-value { font-size: 30px; font-weight: 700; margin-top: 6px; letter-spacing: -.02em; }
.stat-note { font-size: 12px; color: var(--faint); margin-top: 2px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
/* Espaço entre blocos empilhados na página (gráficos, listas, painéis lado a lado) */
.main > .panel, .main > .grid-2, .main > .cards { margin-bottom: 16px; }
.main > :last-child { margin-bottom: 0; }
.panel h2 { font-size: 17px; margin-bottom: 12px; }
.steps { margin: 0; padding-left: 20px; color: var(--ink-2); }
.steps li { margin: 6px 0; }
.steps li.done { color: var(--ok); }

/* ---------- Dashboard (Etapa 2) ---------- */
.muted { color: var(--muted); font-size: 13px; }
.empty { color: var(--muted); margin: 8px 0 0; }

.cards-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.card { position: relative; overflow: hidden; }
.card-hero { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-logo) 100%); border-color: transparent; color: #fff; box-shadow: 0 8px 24px rgba(115, 80, 238, .28); }
.card-hero .stat-label, .card-hero .stat-note { color: rgba(255, 255, 255, .82); }
.card-warn { border-color: #fbd9a8; }
.card-warn::before, .card-danger::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.card-warn::before { background: var(--warn); }
.card-danger { border-color: #f6c4c6; }
.card-danger::before { background: var(--danger); }
.card-danger .stat-value { color: var(--danger); }

.banner { padding: 14px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; }
.banner-danger { background: var(--danger-soft); color: #b42318; border: 1px solid #f9d0d1; }

.windows { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 8px 0 24px; }
.window { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; }
.window-n { min-width: 44px; height: 44px; padding: 0 8px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 20px; display: grid; place-items: center; }
.window-txt { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); }
.window-txt strong { color: var(--ink); font-weight: 600; font-size: 14px; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 16px; margin-bottom: 16px; align-items: start; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head h2 { margin: 0; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; padding: 0 10px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table th:first-child, .table td:first-child { padding-left: 0; }
.table th:last-child, .table td:last-child { padding-right: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table small { color: var(--muted); font-size: 12px; }
.cell-title { display: block; font-weight: 600; }
.cell-sub { display: block; font-size: 13px; color: var(--muted); }
.cell-sub:hover { color: var(--brand); }

.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--ok-soft); color: #067647; }
.badge-info { background: var(--info-soft); color: #175cd3; }
.badge-warn { background: var(--warn-soft); color: #b54708; }
.badge-danger { background: var(--danger-soft); color: #b42318; }
.badge-muted { background: var(--line-soft); color: var(--muted); }

.kv { margin: 0; }
.kv > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.kv .kv-total { border-bottom: 0; padding-top: 14px; }
.kv .kv-total dt { color: var(--ink); font-weight: 600; }
.kv .kv-total dd { color: var(--brand); font-size: 18px; }

/* Gráfico de barras (uma série, sem bibliotecas) */
.bars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; height: 220px; padding-top: 8px; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to top, transparent 0, transparent 43px, var(--line-soft) 43px, var(--line-soft) 44px); }
.bar-col { position: relative; display: flex; flex-direction: column; align-items: center; outline: none; }
.bar-track { flex: 1; width: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.bar { width: 100%; max-width: 30px; background: var(--brand); border-radius: 4px 4px 0 0; transition: background .15s; }
.bar-value { font-size: 11px; color: var(--muted); margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.bar-label { position: absolute; bottom: -26px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.bar-label small { color: var(--faint); margin-left: 1px; font-size: 10px; }
.bars + table { margin-top: 0; }
.panel .bars { margin-bottom: 30px; }
.bar-tip {
  position: absolute; bottom: calc(100% - 10px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: 12px; line-height: 1.45; padding: 8px 10px; border-radius: 8px;
  white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s; z-index: 5;
}
.bar-col:hover .bar, .bar-col:focus .bar { background: var(--brand-600); }
.bar-col:hover .bar-tip, .bar-col:focus .bar-tip { opacity: 1; }
.bar-col:first-child .bar-tip { left: 0; transform: none; }
.bar-col:last-child .bar-tip { left: auto; right: 0; transform: none; }

/* ---------- Telas de cadastro (Etapa 3) ---------- */
.btn svg { width: 17px; height: 17px; }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: #f6c4c6; }
.btn-danger-ghost:hover { background: var(--danger-soft); color: #b42318; }
.faint { color: var(--faint); }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.back svg { width: 15px; height: 15px; }
.back:hover { color: var(--brand); }
.page-head p .badge { vertical-align: middle; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 16px; }
.search { position: relative; flex: 1; min-width: 240px; max-width: 460px; }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--faint); pointer-events: none; }
.search .input { padding-left: 40px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 500; }
.chip span { font-size: 12px; color: var(--faint); }
.chip:hover { color: var(--ink); border-color: #d6d6de; }
.chip.active { background: var(--brand-soft); border-color: transparent; color: var(--brand); font-weight: 600; }
.chip.active span { color: var(--brand-300); }

.table-link tbody tr { cursor: pointer; transition: background .12s; }
.table-link tbody tr:hover { background: #fafafc; }
a.cell-title { color: var(--ink); }
a.cell-title:hover { color: var(--brand); }
.cell-contact { display: flex; flex-direction: column; }
.due { display: block; margin-bottom: 3px; }
.tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.tag { font-size: 11px; font-weight: 600; color: var(--muted); background: var(--line-soft); padding: 2px 7px; border-radius: 6px; }

.empty-state { text-align: center; padding: 32px 16px; color: var(--muted); }
.empty-state p { margin: 0 0 14px; }

.form { max-width: 820px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.field label b { color: var(--danger); font-weight: 600; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6e7b' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
textarea.input { height: auto; padding: 12px 14px; resize: vertical; min-height: 100px; line-height: 1.5; }
.input:disabled { background: var(--line-soft); color: var(--muted); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 18px; margin-top: 4px; border-top: 1px solid var(--line-soft); }

.hint-box { background: var(--brand-soft); color: var(--ink-2); font-size: 13px; padding: 10px 12px; border-radius: var(--radius-sm); margin: 14px 0 0; }
.sub-h { font-size: 14px; margin: 20px 0 6px; }
.notes { margin: 0; font-size: 14px; color: var(--ink-2); white-space: normal; overflow-wrap: anywhere; }
.danger-zone { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line-soft); font-size: 13px; }
.danger-zone p { margin: 0; }

/* ---------- Hospedagens (Etapa 4) ---------- */
.cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 16px; }
.cards-3 .stat-value { font-size: 24px; }
.cards-3 .stat-note .badge { margin-top: 4px; }
.chips-row { margin: -4px 0 16px; }
.chip-danger:not(.active) { color: #b42318; border-color: #f6c4c6; }
.chip-danger:not(.active) span { color: #e5484d; }
.badge-status-ativa { background: var(--brand-soft); color: var(--brand); }
.badge-status-suspensa { background: var(--warn-soft); color: #b54708; }
.badge-status-cancelada { background: var(--line-soft); color: var(--muted); }
.due-wrap { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn-sm svg { width: 15px; height: 15px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.panel-head-right { display: inline-flex; align-items: center; gap: 12px; }
.contact-row { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.panel .form-section { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin: 4px 0 14px; }
.form-grid + .form-section { margin-top: 10px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.checks { display: flex; gap: 10px; flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; font-size: 14px; font-weight: 500 !important; color: var(--ink-2) !important; user-select: none; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); margin: 0; }
.check:has(input:checked) { border-color: var(--brand-300); background: var(--brand-soft); }

/* ---------- Vencimentos (Etapa 5) ---------- */
a.card-link, a.window, a.banner { display: block; color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; }
a.window { display: flex; }
a.card-link:hover, a.window:hover { border-color: var(--brand-300); box-shadow: 0 6px 20px rgba(115, 80, 238, .12); }
a.banner:hover { color: #912018; }
.muted-link { font-size: 13px; color: var(--muted); }
.muted-link:hover { color: var(--brand); }

.filter-block { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.filter-label { width: 64px; flex-shrink: 0; font-size: 12px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; }
.filter-block + .filter-block { margin-bottom: 20px; }
.filter-block + .panel, .filter-block + .due-group { margin-top: 20px; }

.due-group { margin-bottom: 16px; padding-bottom: 8px; }
.due-group-overdue { border-color: #f6c4c6; }
.due-group-overdue .panel-head h2 { color: #b42318; }
.due-list { list-style: none; margin: 0; padding: 0; }
.due-item {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) 130px 150px auto; gap: 16px; align-items: center;
  padding: 12px 0; border-top: 1px solid var(--line-soft);
}
.due-item:first-child { border-top: 0; padding-top: 4px; }
.due-date { width: 52px; height: 52px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; background: var(--line-soft); color: var(--ink); }
.due-date strong { font-size: 19px; }
.due-date span { font-size: 11px; text-transform: uppercase; font-weight: 600; color: var(--muted); }
.due-date-danger { background: var(--danger-soft); color: #b42318; }
.due-date-warn { background: var(--warn-soft); color: #b54708; }
.due-date-info { background: var(--info-soft); color: #175cd3; }
.due-date-ok { background: var(--brand-soft); color: var(--brand); }
.due-date-danger span, .due-date-warn span, .due-date-info span, .due-date-ok span { color: inherit; opacity: .8; }
.due-info { min-width: 0; }
.due-info .cell-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.due-info .cell-sub a { color: var(--muted); }
.due-info .cell-sub a:hover { color: var(--brand); }
.due-amount { text-align: right; font-variant-numeric: tabular-nums; }
.due-amount strong { display: block; }
.due-amount small { color: var(--muted); font-size: 12px; }
.due-actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.due-actions .icon-btn { display: grid; }
.due-actions .icon-btn:hover { color: var(--brand); border-color: var(--brand-300); background: var(--brand-soft); }
.due-actions .icon-btn-wa:hover { color: #067647; border-color: #a6e4c6; background: var(--ok-soft); }
.icon-btn-muted { opacity: .6; }

/* ---------- Domínio (Registro.br) ---------- */
.banner-warn { background: var(--warn-soft); color: #93370d; border: 1px solid #fbd9a8; }
.banner-flex { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.banner-flex .btn { background: #fff; }
.banner-list { display: block; }
.banner-list .banner-title { color: inherit; display: block; }
.banner-list .banner-title:hover { text-decoration: underline; }
.banner-list ul { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.banner-list li { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--ink-2); }
.banner-list li > a:first-child { font-weight: 600; color: var(--ink); }
.badge-domain { margin-top: 5px; }
a.badge:hover { filter: brightness(.96); text-decoration: none; }

/* ---------- App instalável (Etapa 8) ---------- */
[hidden] { display: none !important; }
.install-btn { margin-bottom: 10px; }
.install-banner { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--brand-300); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 16px; box-shadow: 0 6px 20px rgba(115, 80, 238, .12); }
.install-banner img { border-radius: 10px; flex-shrink: 0; }
.install-text { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; color: var(--muted); line-height: 1.4; }
.install-text strong { color: var(--ink); font-size: 14px; }
.install-text b { color: var(--ink-2); }
.install-actions { display: flex; align-items: center; gap: 6px; }
.install-actions .icon-btn { display: grid; font-size: 13px; }
.install-actions .icon-btn:hover { color: var(--ink); border-color: var(--line); background: var(--line-soft); }
.offline-card .lead { margin-bottom: 20px; }
.check-login { width: 100%; height: auto; padding: 10px 12px; margin: -2px 0 16px; font-size: 13px; }
/* App instalado no iPhone: respeita a área do relógio/notch */
.is-standalone .mobile-top { padding-top: env(safe-area-inset-top); height: calc(60px + env(safe-area-inset-top)); }
body { -webkit-tap-highlight-color: transparent; }

/* ---------- Abertura animada do app ---------- */
.splash { display: none; }
.show-splash .splash {
  display: grid; place-items: center; position: fixed; inset: 0; z-index: 1000; background: #fff;
  animation: splash-out .3s ease-in 1.4s forwards;
}
.splash-b { height: 104px; width: auto; overflow: visible; }
/* 1) haste: linha reta descendo (acelera)  2) volta da barriga (desacelera) */
.splash-stem { stroke-dasharray: 1 1; stroke-dashoffset: 1; animation: splash-pen .3s cubic-bezier(.5, 0, 1, 1) .08s forwards; }
.splash-bowl { stroke-dasharray: 1 1; stroke-dashoffset: 1; animation: splash-pen .55s cubic-bezier(0, 0, .35, 1) .38s forwards; }
/* 3) logo original exato no fim; bolinha roxa aparece com um pequeno "pulo" */
.splash-final { opacity: 0; animation: splash-show 0s linear .93s forwards; }
.splash-dot { transform-box: fill-box; transform-origin: center; transform: scale(0); animation: splash-pop .34s cubic-bezier(.34, 1.56, .64, 1) .95s forwards; }
@keyframes splash-pen { to { stroke-dashoffset: 0; } }
@keyframes splash-show { to { opacity: 1; } }
@keyframes splash-pop { to { transform: scale(1); } }
@keyframes splash-out { to { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) {
  .splash-stem, .splash-bowl, .splash-final, .splash-dot { animation: none; stroke-dashoffset: 0; opacity: 1; transform: none; }
  .show-splash .splash { animation-delay: .3s; }
}

/* ---------- Notificações (Etapa 9) ---------- */
.chips-select { display: none; }
.nav-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.mobile-top .brand { margin-right: auto; }
.bell-btn { position: relative; display: grid; color: var(--muted); }
.bell-btn:hover, .bell-btn.active { color: var(--brand); border-color: var(--brand-300); background: var(--brand-soft); }
.bell-count { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; }
.notif-group { margin-bottom: 16px; }
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-list li { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line-soft); }
.notif-list li:first-child { border-top: 0; padding-top: 4px; }
.notif-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.notif-icon svg { width: 19px; height: 19px; }
.notif-danger { background: var(--danger-soft); color: #b42318; }
.notif-warn { background: var(--warn-soft); color: #b54708; }
.notif-info { background: var(--info-soft); color: #175cd3; }
.notif-body { flex: 1; min-width: 0; display: flex; flex-direction: column; color: var(--ink-2); }
.notif-body strong { font-weight: 500; }
.notif-body span { font-size: 12px; color: var(--muted); }
.notif-list li.unread .notif-body strong { font-weight: 700; color: var(--ink); }
.notif-list li.unread .notif-body strong::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-right: 8px; vertical-align: middle; }
.notif-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.notif-side small { color: var(--faint); font-size: 11px; }
.push-box { background: var(--brand-soft); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 12px; }
.push-status { margin: 0 0 10px; font-size: 14px; color: var(--ink-2); }
.push-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.push-hint { margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.device-list { list-style: none; margin: 0 0 12px; padding: 0; }
.device-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.device-list li span { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.device-list svg { width: 16px; height: 16px; color: var(--brand); }
.device-list small { color: var(--faint); }
.inline-form { margin: 0 0 8px; }
.cron-help { margin: 14px 0 6px; }
.cron-cmd { display: block; background: var(--ink); color: #e9e6ff; padding: 10px 12px; border-radius: 8px; font-size: 12px; overflow-wrap: anywhere; margin-bottom: 12px; font-family: ui-monospace, Consolas, monospace; user-select: all; }
.dd-wrap { text-align: right; font-weight: 500 !important; font-size: 13px; }

/* ---------- Configurações ---------- */
.settings { max-width: 860px; }
.settings .panel { scroll-margin-top: 80px; margin-bottom: 16px; }
.section-help { margin: -4px 0 18px; font-size: 13px; color: var(--muted); }
.version-note { font-size: 12px; color: var(--faint); text-align: center; margin: 8px 0 0; }

/* ---------- Calendário (Etapa 7) ---------- */
.cal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.cal-nav { display: flex; align-items: center; gap: 10px; }
.cal-nav h2 { font-size: 20px; min-width: 170px; text-align: center; }
.cal-nav h2 span { color: var(--muted); font-weight: 500; }
.cal-nav .icon-btn { display: grid; }
.cal-nav .icon-btn:hover { color: var(--brand); border-color: var(--brand-300); background: var(--brand-soft); }
.icon-flip svg { transform: scaleX(-1); }
.cal-totals { display: flex; gap: 18px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.cal-totals strong { color: var(--ink); margin-left: 4px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: baseline; }
.dot-ok { background: var(--ok); }
.dot-brand { background: var(--brand); }
.dot-light { background: #cfc2ff; }
.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chip-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

.cal-panel { padding: 0; overflow: hidden; margin-bottom: 16px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-wd { padding: 10px; font-size: 12px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line); }
.cal-day { min-height: 112px; padding: 6px 6px 8px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-out { background: #fbfbfd; }
.cal-out .cal-num { color: #c8c9d1; }
.cal-num { font-size: 13px; font-weight: 600; color: var(--ink-2); width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cal-today .cal-num { background: var(--brand); color: #fff; }
.ev { display: block; font-size: 11.5px; font-weight: 600; line-height: 1.3; padding: 3px 6px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid transparent; }
.ev-more { font-size: 11px; color: var(--muted); padding-left: 6px; }
.ev-danger, .chip-dot.ev-danger { background: var(--danger-soft); color: #b42318; border-left-color: var(--danger); }
.ev-warn, .chip-dot.ev-warn { background: var(--warn-soft); color: #b54708; border-left-color: var(--warn); }
.ev-info, .chip-dot.ev-info { background: var(--info-soft); color: #175cd3; border-left-color: var(--info); }
.ev-plain, .chip-dot.ev-plain { background: var(--brand-soft); color: var(--brand-600); border-left-color: var(--brand); }
.ev-proj, .chip-dot.ev-proj { background: #fff; color: var(--muted); border: 1px dashed var(--brand-300); border-left: 3px solid var(--brand-300); }
.ev-paid, .chip-dot.ev-paid { background: var(--ok-soft); color: #067647; border-left-color: var(--ok); }
.ev-domain, .chip-dot.ev-domain { background: #fff4e5; color: #93370d; border-left-color: #f79009; }
.ev-reseller, .chip-dot.ev-reseller { background: var(--line-soft); color: var(--ink-2); border-left-color: var(--faint); }
.chip-dot.ev-danger { background: var(--danger); } .chip-dot.ev-warn { background: var(--warn); } .chip-dot.ev-info { background: var(--info); }
.chip-dot.ev-plain { background: var(--brand); } .chip-dot.ev-paid { background: var(--ok); } .chip-dot.ev-domain { background: #f79009; }
.chip-dot.ev-reseller { background: var(--faint); } .chip-dot.ev-proj { background: #fff; border: 2px dashed var(--brand-300); }
a.ev:hover { filter: brightness(.97); text-decoration: none; }

.ag-day { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.ag-day:first-of-type { border-top: 0; }
.ag-date { display: flex; flex-direction: column; line-height: 1.1; }
.ag-date strong { font-size: 20px; }
.ag-date span { font-size: 12px; color: var(--muted); }
.ag-today .ag-date strong { color: var(--brand); }
.ag-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ag-list li { display: flex; align-items: flex-start; gap: 10px; }
.ag-list .chip-dot { margin-top: 5px; }
.ag-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ag-main a, .ag-main strong { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.ag-main a:hover { color: var(--brand); }
.ag-main small { color: var(--muted); font-size: 12px; }
.ag-amount { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Relatórios (Etapa 7) ---------- */
.legend { display: inline-flex; gap: 14px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; }
.bars-stacked .bar-forecast { background: #cfc2ff; }
.bars-stacked .bar-stack-top { border-radius: 4px 4px 0 0; margin-bottom: 2px; }
.bars-stacked .bar-stack-bottom { border-radius: 0; }
.bars-stacked .bar-col:hover .bar-forecast, .bars-stacked .bar-col:focus .bar-forecast { background: #b9a8ff; }
.bar-current .bar-label { color: var(--brand); font-weight: 700; }
.table-details { margin-top: 8px; }
.table-details summary { cursor: pointer; font-size: 13px; color: var(--muted); padding: 6px 0; }
.table-details summary:hover { color: var(--brand); }
.table-details .table { margin-top: 8px; }
.tr-total td { font-weight: 700; border-top: 1px solid var(--line); }
.grid-even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.kv-compact > div { padding: 7px 0; }
.rank { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.rank li { font-size: 14px; }
.rank li a { font-weight: 600; color: var(--ink); }
.rank li a:hover { color: var(--brand); }
.rank li span { margin-left: 6px; font-size: 13px; }
.rank li strong { float: right; font-variant-numeric: tabular-nums; }

/* ---------- Pagamentos (Etapa 6) ---------- */
.btn-pay:hover { color: var(--brand); border-color: var(--brand-300); background: var(--brand-soft); }
.grid-form { grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); }
.grid-form .form { max-width: none; }
.renewal { position: sticky; top: 20px; }
.renewal .kv dd { text-align: right; }
.renewal .kv dd .badge { margin-left: 6px; }
.check-block { height: auto; width: 100%; padding: 12px 14px; align-items: flex-start; margin-bottom: 8px; }
.check-block input { margin-top: 2px; flex-shrink: 0; }
.check-block span { display: flex; flex-direction: column; gap: 2px; }
.check-block small { color: var(--muted); font-weight: 400; font-size: 12px; }
.link-danger { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; color: var(--danger); cursor: pointer; }
.link-danger:hover { text-decoration: underline; }
.table-foot { margin: 12px 0 0; font-size: 13px; color: var(--muted); text-align: right; }
.cell-stack { display: inline-flex; flex-direction: column; }

@media (max-width: 1200px) {
  .due-item { grid-template-columns: 52px minmax(0, 1fr) auto; }
  .due-sit { grid-column: 2; grid-row: 2; }
  .due-amount { grid-column: 3; grid-row: 1; }
  .due-actions { grid-column: 3; grid-row: 2; }
  .due-date { grid-row: 1 / span 2; }
}

@media (max-width: 1200px) {
  .cards-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
}

/* ---------- Navegação inferior (celular) ---------- */
.mobile-top, .tabbar { display: none; }

@media (max-width: 900px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 16px 16px calc(88px + env(safe-area-inset-bottom)); }
  .mobile-top {
    /* Topo rola junto com a página (não fica fixo) */
    display: flex; align-items: center; gap: 8px;
    position: static; height: 60px; padding: 0 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
  }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a, .tabbar span {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    font-size: 11px; font-weight: 500; color: var(--muted); padding: 6px 0;
  }
  .tabbar span { opacity: .45; }
  .tabbar a.active { color: var(--brand); font-weight: 600; }
  .tab-more { position: relative; }
  .tab-more summary { list-style: none; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 500; color: var(--muted); padding: 6px 0; cursor: pointer; }
  .tab-more summary::-webkit-details-marker { display: none; }
  .tab-more summary.active, .tab-more[open] summary { color: var(--brand); font-weight: 600; }
  .tab-more summary svg { width: 22px; height: 22px; }
  .more-menu { position: absolute; right: 6px; bottom: calc(100% + 10px); min-width: 200px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(23, 25, 35, .16); padding: 6px; display: flex; flex-direction: column; }
  .more-menu a { display: flex !important; flex-direction: row !important; align-items: center; gap: 12px !important; font-size: 15px !important; padding: 12px !important; border-radius: var(--radius-sm); color: var(--ink-2) !important; }
  .more-menu a.active { background: var(--brand-soft); color: var(--brand) !important; }
  .more-menu svg { width: 20px !important; height: 20px !important; }
  .tabbar svg { width: 22px; height: 22px; }
  .page-head h1 { font-size: 22px; }
  .cards, .cards-4 { grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
  .card { padding: 16px; }
  .stat-value { font-size: 22px; }
  .card-hero, .card-hero ~ .card:last-child { grid-column: 1 / -1; }
  .card-hero .stat-value { font-size: 28px; }
  .windows { grid-template-columns: 1fr; gap: 8px; margin-bottom: 16px; }
  .window { padding: 10px 14px; }
  .panel { padding: 16px; }

  /* Tabela vira lista de cartões */
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr { padding: 18px 0; border-bottom: 1px solid var(--line); }
  .table-stack tr:first-child { padding-top: 6px; }
  .table-stack td[data-label] { padding: 4px 0 !important; }
  .table-stack tr:last-child { border-bottom: 0; }
  .table-stack td { border: 0; padding: 2px 0; text-align: left; }
  .table-stack td[data-label] { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
  .table-stack td[data-label]::before { content: attr(data-label); color: var(--muted); }
  .table-stack td:first-child { margin-bottom: 6px; }

  .page-head .btn-primary { width: 100%; }
  .head-actions { width: 100%; }
  .head-actions .btn { flex: 1; }
  .search { max-width: none; min-width: 0; flex-basis: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .form-actions .btn { flex: 1; }
  .table-stack td[data-label] .badge { margin-left: 6px; }
  .table-stack .cell-contact { align-items: flex-end; text-align: right; }
  .table-stack .due-wrap { flex-direction: row; align-items: center; gap: 0; }
  .table-stack td[data-label] .tags { margin-top: 0; justify-content: flex-end; }
  .cards-3 { grid-template-columns: 1fr; gap: 10px; }
  .cards-3 .card { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; }
  .cards-3 .stat-label { flex-basis: 100%; }
  .cards-3 .stat-value { font-size: 20px; margin-top: 0; }
  .chips { overflow-x: auto; flex-wrap: nowrap; max-width: 100%; padding-bottom: 2px; }
  .chip { flex-shrink: 0; }
  /* Filtros viram caixa de seleção (criada pelo app.js) */
  .chips.has-select { display: none; }
  .chips-select { display: flex; align-items: center; gap: 10px; width: 100%; margin-bottom: 10px; }
  .chips-select span { flex: 0 0 72px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
  .chips-select select { flex: 1; min-width: 0; }
  .toolbar .chips-select { margin-bottom: 0; }
  .filter-block .filter-label { display: none; }
  .filter-block { margin-bottom: 0; }
  .check { flex: 1 1 auto; }
  .panel-head-right { gap: 8px; }
  .filter-block { flex-direction: column; align-items: flex-start; gap: 6px; }
  .filter-block .chips { width: 100%; }
  .due-summary .card:last-child { display: none; }
  .hide-sm { display: none; }
  .cal-panel, .cal-legend { display: none; }
  .cal-nav h2 { min-width: 0; font-size: 18px; }
  .cal-toolbar { margin-bottom: 14px; }
  .grid-even { grid-template-columns: 1fr; }
  .ag-day { grid-template-columns: 48px minmax(0, 1fr); }
  .renewal { position: static; order: -1; }
  .table-stack .cell-stack { align-items: flex-end; text-align: right; }
  .table-stack td.num:empty { display: none; }
  .due-item { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 8px 12px; padding: 14px 0; }
  .due-date { width: 48px; height: 48px; grid-row: 1; }
  .due-info { grid-column: 2; grid-row: 1; }
  .due-info .cell-title { white-space: normal; overflow-wrap: anywhere; }
  .due-amount { grid-column: 3; grid-row: 1; }
  .due-sit { grid-column: 1 / 3; grid-row: 2; }
  .due-actions { grid-column: 3; grid-row: 2; }
  .due-actions .btn-sm { width: 34px; padding: 0; }

  .bars { gap: 4px; height: 180px; }
  .bar-value { display: none; }
  .bar-label { font-size: 10px; }
  .bar-label small { display: none; }
}

@media (max-width: 520px) {
  .auth-card { padding: 26px 20px; }
  .checklist li { grid-template-columns: 22px 1fr; }
  .checklist .val { grid-column: 2; text-align: left; }
}
