/* Painel do administrador: blocos em colunas, painel "Personalizar painel" e as aparências que cada administrador escolhe
   (cor de fundo, menu lateral escuro, espaçamento compacto). */

/* ---------- painel em blocos ---------- */
.admin-home { --gap: 22px; display: grid; gap: var(--gap); }
.admin-home .welcome { margin-bottom: 0; grid-template-columns: minmax(0, 1fr) minmax(300px, 420px); gap: 28px; align-items: center; }
.welcome-title { max-width: 24ch; text-wrap: balance; }
.welcome-custom { margin-top: 14px; }
.cta-gold .row { position: relative; z-index: 1; }
.cta-gold-art { right: -34px; bottom: -44px; width: 150px; height: 136px; opacity: .22; }
.btn-glass { background: rgba(255, 255, 255, .45); border-color: rgba(26, 18, 6, .16); color: #1a1206; }
.btn-glass:hover { background: rgba(255, 255, 255, .7); }

.dash-cols { display: grid; grid-template-columns: minmax(0, 1fr) clamp(340px, 27%, 400px); gap: var(--gap); align-items: start; }
.dash-side .mini-link > small, .dash-side .am-text small { white-space: nowrap; }
.dash-side .am-text small { display: block; overflow: hidden; text-overflow: ellipsis; }
.dash-cols.no-side, .dash-cols.no-main { grid-template-columns: minmax(0, 1fr); }
.dash-main { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.dash-main > .span-2 { grid-column: 1 / -1; }
.dash-side { display: grid; gap: var(--gap); align-content: start; }
.no-main .dash-side { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.dash-item { min-width: 0; container-type: inline-size; }
.dash-main > .dash-item > .card { height: 100%; }
.card-link { white-space: nowrap; }

/* indicadores: --cols vem do painel (conforme a largura do bloco); linhas completas, a última estica */
.stats-fit { --sg: 14px; display: flex; flex-wrap: wrap; gap: var(--sg); }
.stats-fit > .stat { flex: 1 1 calc((100% - (var(--cols) - 1) * var(--sg)) / var(--cols) - 1px); min-width: 0; }
.stat-top { min-height: 34px; }
.stat-label { line-height: 1.3; }
@container (max-width: 820px) { .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 440px) { .pipeline { grid-template-columns: minmax(0, 1fr); } }

@media (max-width: 1180px) {
  .dash-cols { grid-template-columns: minmax(0, 1fr); }
  .dash-side { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
}
@media (max-width: 900px) { .admin-home .welcome { grid-template-columns: minmax(0, 1fr); gap: 18px; } }
@media (max-width: 760px) {
  .admin-home { --gap: 16px; }
  .dash-main { grid-template-columns: minmax(0, 1fr); }
  .dash-main > .dash-item { grid-column: auto; }
  .stats-fit { --sg: 10px; }
}

/* ---------- Personalizar painel ---------- */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 90; width: min(420px, 100vw); display: flex; flex-direction: column; padding-top: var(--safe-t); padding-right: var(--safe-r);
  background: var(--surface); color: var(--text); border-left: 1px solid var(--line); box-shadow: -24px 0 60px -30px rgba(22, 18, 12, .45);
  animation: drawer-in .22s var(--ease);
}
@keyframes drawer-in { from { transform: translateX(28px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .drawer { animation: none; } }
/* em telas largas o conteúdo abre espaço para o painel, para ver o resultado ao lado */
@media (min-width: 1280px) { .shell:has(.drawer) .main-col { padding-right: 420px; } }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 16px; border-bottom: 1px solid var(--line); }
.drawer-head .kicker { margin-bottom: 2px; }
.drawer-head h2 { font-size: 20px; outline: none; }
.drawer-body { flex: 1; overflow-y: auto; padding: 4px 22px 24px; overscroll-behavior: contain; scrollbar-width: thin; }
.drawer-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 22px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface-2); }
.cz-sec { padding: 18px 0; border-bottom: 1px solid var(--line); }
.cz-sec:last-child { border-bottom: 0; }
.cz-sec h3 { margin: 0 0 10px; font-size: 14px; color: var(--ink); }
.cz-sec .hint { margin: -4px 0 6px; }
.cz-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.inline-ic { display: inline-block; vertical-align: -3px; }
.swatches { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.swatch { display: grid; place-items: center; aspect-ratio: 1.25; border-radius: 12px; border: 1px solid rgba(22, 18, 12, .16); background: var(--sw); color: var(--ink); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35); transition: transform .15s; }
.swatch:hover { transform: translateY(-1px); }
.swatch.is-on { outline: 2px solid var(--gold); outline-offset: 2px; }
.swatch.is-dark { color: #f5dc8a; }
.cz-color { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 8px 12px 8px 8px; border: 1px solid var(--line-2); border-radius: 12px; cursor: pointer; }
.cz-color:hover { border-color: var(--gold); }
.cz-color input { width: 44px; height: 34px; padding: 0; border: 0; border-radius: 8px; background: none; cursor: pointer; }
.cz-color strong { display: block; font-size: 14px; color: var(--ink); }
.cz-color small { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.seg { display: flex; gap: 3px; padding: 3px; border-radius: 11px; background: var(--surface-3); }
.seg-opt { flex: 1; min-height: 34px; padding: 0 8px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 13.5px; font-weight: 650; }
.seg-opt:hover { color: var(--ink); }
.seg-opt.is-on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(22, 18, 12, .12); }
.cz-group { margin-top: 12px; }
.cz-group-title { margin: 0 0 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.cz-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.cz-row { display: flex; align-items: center; gap: 6px; min-width: 0; min-height: 46px; padding: 5px 8px 5px 4px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); }
.cz-row.is-off .cz-name { color: var(--faint); }
.cz-row.is-dragging { opacity: .45; border-style: dashed; }
.cz-grip { display: flex; color: var(--faint); cursor: grab; }
.cz-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.cz-zone { width: auto; min-height: 32px; padding: 4px 28px 4px 9px; border-radius: 9px; font-size: 13px; background-position: right 8px center; background-size: 14px; }
.cz-move { display: flex; }
.cz-switch { margin-left: 2px; }
.cz-switch .switch-track { width: 36px; height: 20px; }
.cz-switch .switch-track span { width: 14px; height: 14px; }
.cz-switch input:checked + .switch-track span { transform: translateX(16px); }
.cz-empty { padding: 10px; border: 1px dashed var(--line-2); border-radius: 11px; color: var(--faint); font-size: 13px; text-align: center; }
.cz-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.cz-status .ic { color: var(--ok); }
.cz-status.is-bad { color: var(--bad); }
@media (max-width: 640px) {
  .drawer { width: 100vw; border-left: 0; }
  .swatches { gap: 8px; }
  .cz-two { grid-template-columns: 1fr; }
}

/* ---------- menu lateral escuro ---------- */
.side-dark .sidebar { background: #12100c; border-right-color: rgba(255, 255, 255, .06); }
.side-dark .side-word { color: #fff; }
.side-dark .side-area { background: rgba(224, 178, 74, .14); color: #f0cd72; }
.side-dark .side-title { color: rgba(255, 255, 255, .38); }
.side-dark .side-link { color: rgba(255, 255, 255, .68); }
.side-dark .side-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-dark .side-link.is-active { background: var(--grad-gold); color: #1a1206; }
.side-dark .side-link.is-active .ic { color: #1a1206; }
.side-dark .side-foot { border-top-color: rgba(255, 255, 255, .08); }
.side-dark .side-close { color: #fff; }
.side-dark .side-close:hover { background: rgba(255, 255, 255, .08); }

/* ---------- espaçamento compacto ---------- */
.density-compact .admin-home { --gap: 14px; }
.density-compact .content { padding-top: clamp(14px, 2vw, 22px); }
.density-compact .card { padding: 16px; }
.density-compact .card-head { margin-bottom: 12px; }
.density-compact .stat { padding: 12px 14px; gap: 4px; }
.density-compact .stat-value { font-size: 23px; }
.density-compact .stats-fit { --sg: 10px; }
.density-compact :is(.stack, .grid-2, .grid-3, .grid-main) { gap: 14px; }
.density-compact .side-nav { gap: 2px; }
.density-compact .side-link { min-height: 37px; }
.density-compact .welcome-title { font-size: clamp(26px, 2.6vw, 34px); }

/* ---------- fundo escuro: textos que ficam direto sobre o fundo viram claros ---------- */
.canvas-dark .topbar { border-bottom-color: rgba(255, 255, 255, .08); }
.canvas-dark :is(.topbar .icon-btn, .top-brand, .usermenu-btn) { color: #f3ecdd; }
.canvas-dark .topbar .icon-btn-ghost:hover, .canvas-dark .usermenu-btn:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .12); color: #fff; }
.canvas-dark .content :is(.page-title, .welcome-title, .sec-title, .sec-title h2) { color: #fff; }
.canvas-dark .content :is(.page-head, .welcome, .center-page) :is(.page-sub, .muted, .head-progress) { color: rgba(255, 255, 255, .72); }
.canvas-dark .content :is(.page-head, .welcome) .kicker { color: #f0cd72; }
.canvas-dark .content .back { color: rgba(255, 255, 255, .72); }
.canvas-dark .content .back:hover { color: #fff; }
.canvas-dark .welcome-custom { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .2); color: #fff; }
.canvas-dark .welcome-custom:hover:not(:disabled) { background: rgba(255, 255, 255, .14); border-color: #f0cd72; color: #fff; }
.canvas-dark .content > .page > .page-head .btn-primary { background: var(--grad-gold); color: #1a1206; }
