/* =====================================================================
   Palato Essence — base design system para WineCRM v2
   Cores, tipografia, espaços, componentes partilhados.
   Carregar DEPOIS de v2-vendor.css.
   ===================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Work+Sans:wght@400;500;600;700;800;900&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,400..700,0..1,-50..200&display=swap");

:root {
  /* Marca */
  --pl-wine: #5c1d4a;
  --pl-wine-dark: #420433;
  --pl-wine-soft: #f8e8f2;
  --pl-rose: #fff3f3;
  --pl-rose-border: #f2d4d8;

  /* Superfícies */
  --pl-bg: #fcf8fa;
  --pl-surface: #ffffff;
  --pl-surface-soft: #f8f1f5;
  --pl-surface-dim: #f1e7ee;

  /* Texto */
  --pl-text: #0b1c30;
  --pl-text-muted: #51434a;
  --pl-text-subtle: #83737b;
  --pl-text-faint: #b7a5ad;

  /* Linhas e estados */
  --pl-border: #efe3ea;
  --pl-border-strong: #d5c1ca;
  --pl-success: #166534;
  --pl-success-bg: #ecfdf5;
  --pl-warning: #92400e;
  --pl-warning-bg: #fff8eb;
  --pl-danger: #93000a;
  --pl-danger-bg: #fff1f2;

  /* Sombras (subtis, com toque vinho) */
  --pl-shadow-sm: 0 1px 2px rgba(92, 29, 74, .04);
  --pl-shadow-md: 0 4px 12px rgba(92, 29, 74, .06);
  --pl-shadow-lg: 0 12px 28px rgba(92, 29, 74, .08);
  --pl-shadow-xl: 0 24px 48px rgba(92, 29, 74, .12);

  /* Espaços (8px grid) */
  --pl-space-1: 4px;
  --pl-space-2: 8px;
  --pl-space-3: 12px;
  --pl-space-4: 16px;
  --pl-space-5: 20px;
  --pl-space-6: 24px;
  --pl-space-8: 32px;
  --pl-space-10: 40px;
  --pl-space-12: 48px;

  /* Layout */
  --pl-sidebar-w: 232px;
  --pl-topbar-h: 56px;
  --pl-radius-sm: 4px;
  --pl-radius: 8px;
  --pl-radius-lg: 10px;
  --pl-radius-xl: 14px;
}

/* Reset suave do quadradinho dos ícones que o v2-vendor.css impõe.
   Repõe a fonte real Material Symbols Outlined. */
.material-symbols-outlined,
.pl-icon {
  font-family: "Material Symbols Outlined", sans-serif !important;
  font-weight: 400 !important;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  text-indent: 0 !important;
  white-space: nowrap;
  width: auto !important;
  height: auto !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  -webkit-font-feature-settings: "liga";
  font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
}
.material-symbols-outlined::before,
.pl-icon::before { content: none !important; background: none !important; }

/* ====== Shell global ====== */
html, body { margin: 0; padding: 0; }
body.pl-app {
  background: var(--pl-bg);
  color: var(--pl-text);
  font-family: "Work Sans", "Aptos", "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.pl-app a { color: inherit; text-decoration: none; }
.pl-app h1, .pl-app h2, .pl-app h3, .pl-app h4 { margin: 0; font-weight: 700; }
.pl-app h1 { font-size: 26px; line-height: 32px; letter-spacing: -.035em; }
.pl-app h2 { font-size: 19px; line-height: 26px; letter-spacing: -.025em; }
.pl-app h3 { font-size: 16px; line-height: 22px; letter-spacing: -.015em; font-weight: 700; }
.pl-app h4 { font-size: 14px; line-height: 20px; letter-spacing: -.005em; }

/* ====== Sidebar ====== */
.pl-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--pl-sidebar-w);
  background: var(--pl-bg);
  border-right: 1px solid var(--pl-border);
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
  gap: 2px;
  z-index: 50;
}

.pl-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 6px;
  margin-bottom: 14px;
  position: relative;
}
.pl-sidebar__close {
  display: none;
  position: absolute;
  top: -4px;
  right: 4px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--pl-border);
  background: var(--pl-surface);
  color: var(--pl-text-muted);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.pl-sidebar__close:hover { background: var(--pl-wine); color: #fff; border-color: var(--pl-wine); }
.pl-sidebar__close .material-symbols-outlined { font-size: 18px; }
.pl-sidebar__logo {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--pl-wine);
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: .02em;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(92, 29, 74, .22);
}
.pl-sidebar__brand-name {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: .14em;
  color: var(--pl-wine);
  line-height: 1;
  text-transform: uppercase;
}
.pl-sidebar__brand-sub {
  font-size: 9px;
  color: var(--pl-text-subtle);
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-top: 2px;
}

.pl-sidebar__nav { flex: 1; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.pl-sidebar__group-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--pl-text-faint);
  padding: 10px 12px 4px;
}
.pl-sidebar__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: var(--pl-radius);
  color: var(--pl-text-muted);
  font-size: 13px;
  font-weight: 500;
  min-height: 32px;
  transition: background .15s ease, color .15s ease;
  position: relative;
}
.pl-sidebar__link .material-symbols-outlined { font-size: 20px; color: inherit; }
.pl-sidebar__link:hover { background: rgba(92, 29, 74, .04); color: var(--pl-wine); }
.pl-sidebar__link.is-active {
  background: var(--pl-surface);
  color: var(--pl-wine);
  font-weight: 700;
  box-shadow: var(--pl-shadow-sm);
}
.pl-sidebar__link.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  bottom: 5px;
  width: 3px;
  background: var(--pl-wine);
  border-radius: 0 3px 3px 0;
}
.pl-sidebar__sublinks {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: -1px 0 4px 42px;
}
.pl-sidebar__sublink {
  color: var(--pl-text-subtle);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
  padding: 4px 10px;
  border-radius: 7px;
  text-decoration: none;
}
.pl-sidebar__sublink:hover {
  background: rgba(92, 29, 74, .04);
  color: var(--pl-wine);
}
.pl-sidebar__sublink.is-active {
  background: var(--pl-wine-soft);
  color: var(--pl-wine);
}

.pl-sidebar__footer {
  border-top: 1px solid var(--pl-border);
  padding-top: 10px;
  margin-top: 6px;
}
.pl-sidebar__user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-radius: var(--pl-radius);
}
.pl-sidebar__user-av {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--pl-wine-soft);
  color: var(--pl-wine);
  font-weight: 800;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pl-sidebar__user-name { font-size: 12px; font-weight: 700; color: var(--pl-text); line-height: 1.2; }
.pl-sidebar__user-role { font-size: 10px; color: var(--pl-text-faint); margin-top: 2px; }

/* ====== Topbar ====== */
.pl-topbar {
  position: fixed;
  top: 0;
  left: var(--pl-sidebar-w);
  right: 0;
  height: var(--pl-topbar-h);
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--pl-border);
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(260px, 480px) auto;
  align-items: center;
  padding: 0 20px;
  gap: 14px;
}
.pl-topbar__menu {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--pl-border);
  background: var(--pl-surface);
  color: var(--pl-text-muted);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: inherit;
  transition: background .15s ease, color .15s ease;
}
.pl-topbar__menu:hover { background: var(--pl-wine); color: #fff; border-color: var(--pl-wine); }
.pl-topbar__menu .material-symbols-outlined { font-size: 22px; }
.pl-topbar__search {
  width: 100%;
  max-width: 480px;
  min-width: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-self: start;
}
.pl-topbar__search .material-symbols-outlined {
  position: absolute;
  left: 12px;
  color: var(--pl-text-faint);
  font-size: 18px;
  pointer-events: none;
}
.pl-topbar__search input {
  width: 100%;
  background: var(--pl-surface-soft);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 7px 12px 7px 36px;
  font-size: 13px;
  font-family: inherit;
  color: var(--pl-text);
  transition: border-color .15s ease, background .15s ease;
}
.pl-topbar__search input:focus {
  outline: none;
  border-color: var(--pl-wine);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(92, 29, 74, .08);
}
.pl-topbar__actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: 0;
  min-width: 0;
  justify-self: end;
}
.pl-topbar__icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pl-text-muted);
  transition: background .15s ease, color .15s ease;
  cursor: pointer;
  position: relative;
}
.pl-topbar__icon:hover { background: var(--pl-wine-soft); color: var(--pl-wine); }
.pl-topbar__icon[data-badge]::after {
  content: attr(data-badge);
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--pl-wine);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

/* ====== Main canvas ====== */
.pl-main {
  margin-left: var(--pl-sidebar-w);
  padding: calc(var(--pl-topbar-h) + 16px) 24px 32px;
  min-height: 100vh;
}
.pl-canvas {
  max-width: 1480px;
  margin: 0 auto;
}

/* ====== Components ====== */
.pl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--pl-radius);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .01em;
  border: 1px solid transparent;
  background: var(--pl-wine);
  color: #fff;
  cursor: pointer;
  transition: background .15s ease, transform .1s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.pl-btn:hover { background: var(--pl-wine-dark); box-shadow: var(--pl-shadow-md); }
.pl-btn:active { transform: scale(.97); }
.pl-btn--secondary {
  background: #fff;
  color: var(--pl-wine);
  border-color: var(--pl-wine);
}
.pl-btn--secondary:hover { background: var(--pl-wine-soft); }
.pl-btn--ghost {
  background: transparent;
  color: var(--pl-text-muted);
  border-color: transparent;
}
.pl-btn--ghost:hover { background: var(--pl-surface-soft); color: var(--pl-wine); }
.pl-btn--sm { padding: 5px 10px; font-size: 11px; min-height: 28px; }
.pl-btn--lg { padding: 12px 20px; font-size: 13px; }
.pl-btn .material-symbols-outlined { font-size: 16px; }

.pl-card {
  background: var(--pl-surface);
  border: 1px solid var(--pl-border);
  border-radius: var(--pl-radius-lg);
  padding: 16px;
  box-shadow: var(--pl-shadow-sm);
}
.pl-card--inset { padding: 12px; }
.pl-card--flat { box-shadow: none; }

.pl-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.pl-section-head h2,
.pl-section-head h3 { color: var(--pl-text); }
.pl-section-head__action {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--pl-text-faint);
  transition: color .15s ease;
}
.pl-section-head__action:hover { color: var(--pl-wine); }

.pl-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  background: var(--pl-wine-soft);
  color: var(--pl-wine);
}
.pl-badge--solid { background: var(--pl-wine); color: #fff; }
.pl-badge--success { background: var(--pl-success-bg); color: var(--pl-success); }
.pl-badge--warning { background: var(--pl-warning-bg); color: var(--pl-warning); }
.pl-badge--danger { background: var(--pl-danger-bg); color: var(--pl-danger); }
.pl-badge--neutral { background: var(--pl-surface-soft); color: var(--pl-text-muted); }
.v2-demo-chip,
.pl-mode-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(92, 29, 74, .16);
  background: var(--pl-wine-soft);
  color: var(--pl-wine);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.v2-demo-chip::before,
.pl-mode-chip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: .75;
}

.pl-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  background: var(--pl-surface-soft);
  color: var(--pl-text-muted);
  border: 1px solid var(--pl-border);
}

.pl-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--pl-text-faint);
}

/* Hero crítico — wine-deep + soft rose */
.pl-hero {
  background: linear-gradient(135deg, #fff 0%, var(--pl-rose) 100%);
  border: 1px solid var(--pl-rose-border);
  border-left: 5px solid var(--pl-wine);
  border-radius: var(--pl-radius-lg);
  padding: 20px 22px;
  box-shadow: var(--pl-shadow-md);
}
.pl-hero--ok {
  background: linear-gradient(135deg, #fff 0%, #f6fbf6 100%);
  border-color: #d2e9d3;
  border-left-color: var(--pl-success);
}
.pl-hero__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}
.pl-hero h1 {
  color: var(--pl-wine);
  font-size: clamp(20px, 2.2vw, 26px);
  line-height: 1.15;
  margin-top: 6px;
}
.pl-hero--ok h1 { color: var(--pl-success); }
.pl-hero__lede {
  color: var(--pl-text-muted);
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 6px;
}
.pl-hero__value {
  text-align: right;
  flex-shrink: 0;
}
.pl-hero__value strong {
  display: block;
  color: var(--pl-wine);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -.02em;
}
.pl-hero__value span {
  display: block;
  font-size: 10px;
  color: var(--pl-text-faint);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-top: 2px;
}
.pl-hero__actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* KPI cards */
.pl-kpi {
  background: var(--pl-surface);
  border: 1px solid var(--pl-border);
  border-radius: var(--pl-radius-lg);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.pl-kpi:hover { box-shadow: var(--pl-shadow-md); }
.pl-kpi__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--pl-text-faint);
  margin-bottom: 2px;
  display: block;
}
.pl-kpi__value {
  font-size: 20px;
  font-weight: 800;
  color: var(--pl-text);
  letter-spacing: -.02em;
  line-height: 1;
}
.pl-kpi__icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--pl-wine-soft);
  color: var(--pl-wine);
  flex-shrink: 0;
}
.pl-kpi__icon .material-symbols-outlined { font-size: 18px; }
.pl-kpi--danger { border-left: 3px solid var(--pl-danger); }
.pl-kpi--danger .pl-kpi__value { color: var(--pl-danger); }
.pl-kpi--warning { border-left: 3px solid var(--pl-warning); }
.pl-kpi--success { border-left: 3px solid var(--pl-success); }

/* Stage / pipeline pills */
.pl-stage-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}
.pl-stage {
  display: block;
  min-width: 168px;
  flex-shrink: 0;
  background: var(--pl-surface);
  border: 1px solid var(--pl-border);
  border-radius: var(--pl-radius-lg);
  padding: 18px 20px;
  text-align: left;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
  cursor: pointer;
}
.pl-stage:hover { box-shadow: var(--pl-shadow-md); }
.pl-stage:hover { transform: translateY(-2px); }
.pl-stage__count {
  font-size: 26px;
  font-weight: 900;
  color: var(--pl-wine);
  letter-spacing: -.02em;
  line-height: 1;
}
.pl-stage__label {
  display: block;
  margin-top: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--pl-text-faint);
}
.pl-stage__bar {
  height: 4px;
  background: var(--pl-surface-soft);
  border-radius: 999px;
  margin-top: 14px;
  overflow: hidden;
}
.pl-stage__bar-fill {
  display: block;
  height: 100%;
  background: var(--pl-wine);
  border-radius: inherit;
  transition: width .4s ease;
}
.pl-stage.is-active {
  border-color: var(--pl-wine);
  background: linear-gradient(180deg, #fff 0%, var(--pl-wine-soft) 100%);
}

/* Timeline (agenda) */
.pl-timeline { display: flex; flex-direction: column; gap: 12px; }
.pl-timeline__item {
  position: relative;
  padding-left: 16px;
  border-left: 2px solid var(--pl-border);
}
.pl-timeline__item::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pl-border);
}
.pl-timeline__item.is-now {
  border-left-color: var(--pl-wine);
}
.pl-timeline__item.is-now::before {
  background: var(--pl-wine);
  box-shadow: 0 0 0 4px rgba(92, 29, 74, .12);
}
.pl-timeline__time {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--pl-text-faint);
}
.pl-timeline__item.is-now .pl-timeline__time { color: var(--pl-wine); }
.pl-timeline__title {
  margin-top: 2px;
  font-size: 13px;
  font-weight: 700;
  color: var(--pl-text);
  line-height: 1.3;
}
.pl-timeline__desc {
  font-size: 11px;
  color: var(--pl-text-subtle);
  margin-top: 2px;
}

/* List items / inbox / leads */
.pl-list { display: flex; flex-direction: column; gap: 2px; }
.pl-list__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--pl-radius);
  transition: background .15s ease;
  cursor: pointer;
  border: 1px solid transparent;
}
.pl-list__item:hover {
  background: var(--pl-surface-soft);
  border-color: var(--pl-border);
}
.pl-list__item.is-hot {
  background: var(--pl-wine-soft);
  border-color: rgba(92, 29, 74, .12);
}
.pl-list__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--pl-surface-soft);
  color: var(--pl-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  flex-shrink: 0;
  border: 1px solid var(--pl-border);
}
.pl-list__item.is-hot .pl-list__avatar {
  background: var(--pl-wine);
  color: #fff;
  border-color: var(--pl-wine);
}
.pl-list__body { min-width: 0; flex: 1; }
.pl-list__title {
  font-size: 12px;
  font-weight: 700;
  color: var(--pl-text);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pl-list__sub {
  font-size: 11px;
  color: var(--pl-text-subtle);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pl-list__meta {
  font-size: 10px;
  color: var(--pl-text-faint);
  font-weight: 700;
  letter-spacing: .04em;
  flex-shrink: 0;
}

/* Status dot */
.pl-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pl-success);
  margin-right: 6px;
  vertical-align: middle;
}
.pl-dot--warning { background: var(--pl-warning); }
.pl-dot--danger { background: var(--pl-danger); animation: pl-pulse 2s infinite; }
@keyframes pl-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(147, 0, 10, .35); }
  50% { box-shadow: 0 0 0 6px rgba(147, 0, 10, 0); }
}

/* Skeleton */
.pl-skeleton {
  display: block;
  background: linear-gradient(90deg, #efe3ea 0%, #f7eef2 50%, #efe3ea 100%);
  background-size: 200% 100%;
  animation: pl-shimmer 1.4s ease-in-out infinite;
  border-radius: 6px;
  height: 14px;
}
.pl-skeleton--lg { height: 32px; border-radius: 8px; }
.pl-skeleton--xl { height: 80px; border-radius: 12px; }
@keyframes pl-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.pl-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--pl-text-subtle);
}
.pl-empty .material-symbols-outlined {
  font-size: 32px;
  color: var(--pl-text-faint);
  margin-bottom: 8px;
}
.pl-empty__title { font-weight: 700; color: var(--pl-text-muted); margin-bottom: 4px; }
.pl-empty__sub { font-size: 12px; }

/* Status pill (op status header) */
.pl-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--pl-border);
  font-size: 12px;
  font-weight: 700;
  color: var(--pl-text-muted);
  box-shadow: var(--pl-shadow-sm);
}
.pl-status-pill--ok { color: var(--pl-success); border-color: #cfe6d2; }
.pl-status-pill--warning { color: var(--pl-warning); border-color: #f3dfb6; }
.pl-status-pill--danger { color: var(--pl-danger); border-color: #f4cccd; }

/* Generic page header (shared across pages) */
.pl-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.pl-page-header h1 {
  margin-top: 6px;
  font-size: clamp(22px, 2.6vw, 28px);
  letter-spacing: -.035em;
  line-height: 1.1;
  color: var(--pl-text);
}
.pl-page-lede {
  margin-top: 4px;
  color: var(--pl-text-muted);
  font-size: 13px;
  max-width: 640px;
  margin-bottom: 0;
}
.pl-page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.pl-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.pl-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.pl-3col {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.pl-actions-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pl-section-card {
  margin-bottom: 16px;
}

.pl-stack { display: flex; flex-direction: column; gap: 16px; }

/* Generic chip filter bar */
.pl-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.pl-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--pl-text-muted);
  background: var(--pl-surface);
  border: 1px solid var(--pl-border);
  padding: 8px 14px;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.pl-chip:hover { color: var(--pl-wine); border-color: var(--pl-wine); }
.pl-chip.is-active {
  background: var(--pl-wine);
  color: #fff;
  border-color: var(--pl-wine);
}
.pl-chip__count {
  font-size: 11px;
  font-weight: 800;
  background: rgba(0, 0, 0, .06);
  padding: 2px 7px;
  border-radius: 999px;
}
.pl-chip.is-active .pl-chip__count {
  background: rgba(255, 255, 255, .25);
  color: #fff;
}

/* Definition list / metric pairs */
.pl-dl {
  display: grid;
  gap: 8px;
}
.pl-dl__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--pl-border);
  font-size: 13px;
}
.pl-dl__row:last-child { border-bottom: 0; }
.pl-dl__label { color: var(--pl-text-faint); font-weight: 600; }
.pl-dl__value { color: var(--pl-text); font-weight: 700; text-align: right; word-break: break-word; max-width: 60%; }
.pl-dl__value a { color: var(--pl-wine); text-decoration: none; }

/* Toast (shared) */
.pl-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--pl-text);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--pl-radius);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--pl-shadow-xl);
  z-index: 200;
  animation: pl-toast-in .25s ease;
}
.pl-toast.is-error { background: var(--pl-danger); }
.pl-toast.is-success { background: var(--pl-success); }
@keyframes pl-toast-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* Sidebar backdrop (mobile) */
.pl-sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 28, 48, .45);
  backdrop-filter: blur(2px);
  z-index: 49;
  animation: pl-fade-in .2s ease;
}
@keyframes pl-fade-in { from { opacity: 0; } to { opacity: 1; } }

body.pl-sidebar-open { overflow: hidden; }

/* ====== Tablet/mobile breakpoint ====== */
@media (max-width: 1180px) {
  .pl-sidebar {
    width: min(280px, 86vw);
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: var(--pl-shadow-xl);
    z-index: 60;
    padding: 14px 10px;
    overflow: hidden;
  }
  .pl-sidebar.is-open { transform: translateX(0); }
  .pl-sidebar__close { display: inline-flex; }
  .pl-sidebar__brand { margin-bottom: 8px; padding-right: 42px; }
  .pl-sidebar__nav { overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 8px; }
  .pl-sidebar__group-label { padding: 8px 10px 3px; font-size: 9px; }
  .pl-sidebar__link {
    min-height: 40px;
    padding: 8px 10px;
    gap: 9px;
    font-size: 13px;
    line-height: 16px;
  }
  .pl-sidebar__link .material-symbols-outlined { font-size: 19px; width: 22px; flex: 0 0 22px; text-align: center; }
  .pl-sidebar__footer { display: none; }

  .pl-topbar {
    left: 0;
    right: 0;
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 0 12px;
    gap: 8px;
    overflow: hidden;
  }
  .pl-topbar__menu { display: inline-flex; }
  .pl-topbar__action {
    /* esconde acções secundárias em mobile — fica só search + status pill */
    display: none;
  }
  .pl-topbar__actions { gap: 8px; margin-left: 0; }
  .pl-topbar__search { max-width: none; min-width: 0; justify-self: stretch; }
  .pl-topbar__search input { font-size: 14px; padding: 8px 10px 8px 36px; }
  .pl-status-pill { padding: 6px 10px; font-size: 11px; }
  .pl-status-pill span:not(.pl-dot) {
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .pl-main {
    margin-left: 0;
    padding: calc(var(--pl-topbar-h) + 16px) 16px 32px;
  }
  .pl-canvas { max-width: none; }

  .pl-2col, .pl-3col { grid-template-columns: 1fr; }
  .pl-page-header { flex-direction: column; align-items: stretch; }
  .pl-page-actions { justify-content: flex-start; flex-wrap: wrap; }
  /* Touch targets mínimos */
  .pl-btn { min-height: 44px; }
  .pl-btn--sm { min-height: 38px; }
  .pl-chip { min-height: 38px; padding: 8px 14px; }
  .pl-list__item { min-height: 56px; }
}

@media (max-width: 600px) {
  /* search ainda mais compacto, esconde label visual */
  .pl-topbar__search input::placeholder {
    font-size: 13px;
  }
  .pl-status-pill span:not(.pl-dot) { display: none; }
  .pl-status-pill { padding: 8px; }
  .pl-status-pill .pl-dot { margin: 0; }

  .pl-hero { padding: 20px; }
  .pl-hero h1 { font-size: 22px; }
  .pl-hero__head { flex-direction: column; gap: 12px; }
  .pl-hero__value { text-align: left; }

  .pl-card { padding: 16px; }
  .pl-section-head h2 { font-size: 18px; }
  .pl-section-head h3 { font-size: 16px; }
}

/* =====================================================================
   PRIMITIVOS DE OPERADOR (Fase 0) — decisão+ação reutilizável em todas as
   páginas. Generaliza o cp-card/gate de Campanhas. Só tokens --pl-*.
   ===================================================================== */
.pl-decision-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: var(--pl-space-4); }
.pl-decision-card { display: flex; flex-direction: column; gap: var(--pl-space-3); border: 1px solid var(--pl-border); border-radius: var(--pl-radius-lg); background: var(--pl-surface); padding: var(--pl-space-5); box-shadow: var(--pl-shadow-sm); }
.pl-decision-card--act { border-color: var(--pl-rose-border); background: var(--pl-rose); }
.pl-decision-card--block { border-color: #f0dcae; background: var(--pl-warning-bg); }
.pl-decision-card--ok { border-color: #bfe6cf; background: var(--pl-success-bg); }
.pl-decision-card__top { display: flex; align-items: center; gap: 10px; }
.pl-decision-card__icon { width: 38px; height: 38px; border-radius: var(--pl-radius); display: grid; place-items: center; background: var(--pl-wine-soft); color: var(--pl-wine); flex: none; }
.pl-decision-card__icon .material-symbols-outlined { font-size: 21px; }
.pl-decision-card__kicker { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; font-weight: 700; color: var(--pl-text-subtle); }
.pl-decision-card__headline { font-size: 16px; font-weight: 700; color: var(--pl-text); line-height: 1.25; margin-top: 1px; }
.pl-decision-card__sub { font-size: 13px; color: var(--pl-text-muted); line-height: 1.45; flex: 1; }
.pl-decision-card__sub b { color: var(--pl-text); }
.pl-decision-card__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pl-decision-card__actions .pl-btn { flex: 1; min-width: 120px; justify-content: center; }

/* número COM ação ao lado (inventário) — nunca um número solto */
.pl-inventory-stat { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--pl-border); border-radius: var(--pl-radius); background: var(--pl-surface); padding: var(--pl-space-4); }
.pl-inventory-stat__num { font-size: 26px; font-weight: 800; color: var(--pl-text); font-variant-numeric: tabular-nums; line-height: 1; }
.pl-inventory-stat__label { font-size: 12px; color: var(--pl-text-subtle); margin-top: 3px; }
.pl-inventory-stat--act .pl-inventory-stat__num { color: var(--pl-wine); }

/* gate de confirmação de gasto + toast (partilhados via PL.gate / PL.toast) */
.pl-gate { position: fixed; inset: 0; background: rgba(66, 4, 51, .34); display: grid; place-items: center; z-index: 80; padding: 18px; backdrop-filter: blur(2px); }
.pl-gate__box { background: var(--pl-surface); border: 1px solid var(--pl-border); border-radius: var(--pl-radius-lg); box-shadow: var(--pl-shadow-xl); max-width: 420px; width: 100%; padding: var(--pl-space-6); }
.pl-gate__box h3 { margin: 0 0 8px; font-size: 16px; color: var(--pl-text); }
.pl-gate__box p { font-size: 13px; color: var(--pl-text-muted); line-height: 1.5; margin: 0 0 10px; }
.pl-gate__cost { font-size: 12px; font-weight: 700; color: var(--pl-warning); background: var(--pl-warning-bg); border: 1px solid #f0dcae; border-radius: var(--pl-radius); padding: 8px 10px; margin-bottom: 14px; }
.pl-gate__actions { display: flex; gap: 8px; justify-content: flex-end; }
.pl-toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--pl-text); color: #fff; font-size: 13px; padding: 10px 16px; border-radius: 999px; box-shadow: var(--pl-shadow-lg); z-index: 90; opacity: 0; transition: opacity .2s; pointer-events: none; }
.pl-toast.show { opacity: 1; }
.pl-toast--err { background: var(--pl-danger); }

/* ---- agentes: linhas ricas de lead/promoção + diff de preview (aditivo, só --pl-*) ---- */
.pl-lead-list { display: flex; flex-direction: column; gap: 8px; }
.pl-lead-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; border: 1px solid var(--pl-border); border-radius: var(--pl-radius); background: var(--pl-surface); padding: 10px 12px; }
.pl-lead-row--act { border-color: var(--pl-rose-border); background: var(--pl-rose); }
.pl-lead-row__main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 200px; }
.pl-lead-row__title { font-size: 13px; font-weight: 700; color: var(--pl-text); }
.pl-lead-row__meta { font-size: 12px; color: var(--pl-text-muted); line-height: 1.4; }
.pl-lead-row__actions { display: flex; flex-wrap: wrap; gap: 6px; }
.pl-diff { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; padding: 6px 10px; border-radius: var(--pl-radius); background: var(--pl-surface-soft); margin-bottom: 4px; }
.pl-diff--create { border-left: 3px solid var(--pl-success); }
.pl-diff--gap { border-left: 3px solid var(--pl-warning); }
.pl-diff--conflict { border-left: 3px solid var(--pl-danger); }
.pl-diff strong { color: var(--pl-text); font-weight: 700; }
.pl-diff span { color: var(--pl-text-muted); text-align: right; word-break: break-word; }
.pl-sublabel { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--pl-text-subtle); margin: 10px 0 6px; }
.pl-filter-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
