:root {
  --cw-primary: #0f766e;
  --cw-primary-dark: #0d5f59;
  --cw-primary-soft: #ccfbf1;
  --cw-accent: #0369a1;
  --cw-bg: #f4f6f8;
  --cw-surface: #ffffff;
  --cw-text: #1e293b;
  --cw-muted: #64748b;
  --cw-border: #e2e8f0;
  --cw-sidebar-bg: #ffffff;
  --cw-sidebar-hover: #f1f5f9;
  --cw-danger: #dc2626;
  --cw-info: #0284c7;
  --cw-warning: #d97706;
  --cw-success: #0f766e;
  --cw-radius: 10px;
  --cw-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  --font-ui: "Plus Jakarta Sans", system-ui, sans-serif;
  --sidebar-w: 232px;
  --topbar-h: 52px;
}

/* Painel Admin (hub): tom ardósia suave — distingue do teal das filiais sem exagerar */
body.cw-admin-hub {
  --cw-primary: #3d5a80;
  --cw-primary-dark: #314a6a;
  --cw-primary-soft: #e6eef6;
  --cw-accent: #4a6d8c;
  --cw-bg: #eef1f5;
  --cw-sidebar-bg: #f7f9fc;
  --cw-sidebar-hover: #e8eef5;
  --cw-border: #d8e0ea;
  --cw-success: #3d5a80;
}
body.cw-admin-hub .cw-sidebar {
  border-right-color: #cfd8e6;
  box-shadow: inset -3px 0 0 rgba(61, 90, 128, 0.18);
}
body.cw-admin-hub .cw-sidebar .brand small {
  color: var(--cw-primary);
  font-weight: 600;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.42;
  background: var(--cw-bg);
  color: var(--cw-text);
}

a { color: var(--cw-primary); text-decoration: none; }
a:hover { color: var(--cw-primary-dark); }

.cw-brand {
  font-family: var(--font-ui);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.cw-app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.cw-sidebar {
  width: var(--sidebar-w);
  background: var(--cw-sidebar-bg);
  border-right: 1px solid var(--cw-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 100;
  height: 100vh;
  overflow: hidden;
}

.cw-sidebar .brand {
  padding: 0.65rem 0.95rem;
  border-bottom: 1px solid var(--cw-border);
  min-height: var(--topbar-h);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.cw-sidebar .brand span {
  display: block;
  font-size: 1.1rem;
  color: var(--cw-primary);
  font-weight: 700;
  line-height: 1.2;
}
.cw-sidebar .brand small {
  color: var(--cw-muted);
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.1rem;
}

.cw-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.45rem 0;
}
.cw-sidebar-ver {
  flex-shrink: 0;
  padding: 0.45rem 0.95rem 0.7rem;
  border-top: 1px solid var(--cw-border);
  font-size: 0.68rem;
  color: var(--cw-muted);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.cw-nav a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.85rem;
  margin: 0 0.45rem 2px;
  border-radius: 8px;
  color: var(--cw-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.12s ease, color 0.12s ease;
}
.cw-nav a i {
  width: 1.25rem;
  text-align: center;
  font-size: 0.95rem;
  opacity: 0.9;
}
.cw-nav a:hover {
  background: var(--cw-sidebar-hover);
  color: var(--cw-text);
}
.cw-nav a.active {
  background: var(--cw-primary-soft);
  color: var(--cw-primary-dark);
  font-weight: 600;
}
.cw-nav-group {
  margin: 0 0.45rem 2px;
}
.cw-nav-group-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--cw-muted);
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
}
.cw-nav-group-btn span {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
.cw-nav-group-btn span i { width: 1.25rem; text-align: center; }
.cw-nav-group-btn:hover,
.cw-nav-group-btn.active {
  background: var(--cw-sidebar-hover);
  color: var(--cw-text);
}
.cw-nav-group-btn.active {
  background: var(--cw-primary-soft);
  color: var(--cw-primary-dark);
  font-weight: 600;
}
.cw-nav-chevron {
  font-size: 0.7rem;
  transition: transform 0.15s ease;
}
.cw-nav-group.open .cw-nav-chevron { transform: rotate(180deg); }
.cw-nav-sub {
  display: none;
  margin: 0.15rem 0 0.4rem 1.35rem;
  padding: 0.2rem 0 0.2rem 0.75rem;
  border-left: 2px solid #e2e8f0;
}
.cw-nav-group.open .cw-nav-sub { display: block; }
.cw-nav-sub a {
  margin: 0 0 2px 0;
  padding: 0.45rem 0.7rem;
  font-size: 0.86rem;
  border-radius: 8px;
}
.cw-nav-sub a i {
  font-size: 0.82rem;
  width: 1rem;
  opacity: 0.75;
}

.prod-form-top {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.prod-form-main { flex: 1; min-width: 0; }
.prod-form-side {
  flex: 0 0 160px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.prod-img-box {
  border: 1px solid var(--cw-border);
  border-radius: 10px;
  background: #f8fafc;
  padding: 0.55rem;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}
.prod-img-label {
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--cw-muted);
  text-transform: uppercase;
  letter-spacing: .03em;
}
.prod-img-preview {
  width: 100%;
  max-height: 140px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
}
.prod-img-empty {
  color: var(--cw-muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 1.5rem 0.5rem;
}
.prod-form-flags {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0 0.15rem;
}
.prod-form-flags .form-check { margin: 0; min-height: 0; }
.prod-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--cw-border);
  background: #fff;
}
.prod-thumb-empty {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  border: 1px dashed var(--cw-border);
  background: #f8fafc;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 0.75rem;
}
.pref-cadastro-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.65rem 1rem;
}
.pref-cadastro-item .form-label {
  font-weight: 600;
  color: var(--cw-muted);
}
.pref-drag-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.65rem;
}
.pref-drag-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.55rem 0.6rem 0.65rem;
  border: 1px solid var(--cw-border);
  border-radius: 10px;
  background: #f8fafc;
  min-height: 5.2rem;
  transition: box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.pref-drag-slot.has-item {
  background: #fff;
  border-color: #cbd5e1;
}
.pref-drag-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}
.pref-drag-num {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--cw-muted);
}
.pref-drag-handle {
  cursor: grab;
  color: var(--cw-muted);
  padding: 0.1rem 0.25rem;
  border-radius: 4px;
}
.pref-drag-handle:hover { color: var(--cw-text); background: var(--cw-sidebar-hover); }
.pref-drag-handle:active { cursor: grabbing; }
.pref-drag-slot .pref-clear {
  position: absolute;
  right: 0.35rem;
  bottom: 0.2rem;
  line-height: 1;
  text-decoration: none;
}
.pref-drag-ghost {
  opacity: 0.45;
  background: var(--cw-primary-soft) !important;
  border-style: dashed !important;
}
.pref-drag-chosen {
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
  border-color: var(--cw-primary);
}
.pref-drag-dragging { opacity: 0.95; }
@media (max-width: 991.98px) {
  .pref-drag-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 575.98px) {
  .pref-drag-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
  .prod-form-top { flex-direction: column; }
  .prod-form-side { flex: 1 1 auto; width: 100%; max-width: 220px; }
  .prod-form-flags { flex-direction: row; flex-wrap: wrap; gap: 1rem; }
}

.cw-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.cw-support-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  background: #c62828;
  color: #fff;
  padding: 0.45rem 1.5rem;
  font-size: 0.85rem;
  line-height: 1.3;
  flex-shrink: 0;
}
.cw-support-banner-text {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}
.cw-support-banner-text strong {
  letter-spacing: 0.04em;
}
.cw-support-banner-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}
.cw-support-banner .btn-outline-light {
  border-color: rgba(255,255,255,0.65);
  color: #fff;
}
.cw-support-banner .btn-outline-light:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

.cw-topbar {
  background: var(--cw-surface);
  border-bottom: 1px solid var(--cw-border);
  padding: 0 1rem;
  min-height: var(--topbar-h);
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-shrink: 0;
  z-index: 50;
}
.cw-topbar-start {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 1 1 auto;
  min-width: 0;
}
.cw-topbar-user {
  flex: 0 0 auto;
  max-width: 200px;
}
.cw-topbar strong { font-size: 0.95rem; font-weight: 600; }
.cw-topbar .fw-semibold { font-size: 0.85rem; }
.cw-topbar small { font-size: 0.72rem; }

.cw-empresa-switch {
  position: relative;
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(520px, 48vw);
}
.cw-empresa-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 100%;
  padding: 0.4rem 0.75rem;
  border: none;
  border-radius: 999px;
  background: var(--cw-primary);
  color: #fff;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.28);
  transition: background 0.12s ease, box-shadow 0.12s ease;
}
.cw-empresa-chip:not(.cw-empresa-chip-static):hover,
.cw-empresa-switch.open .cw-empresa-chip:not(.cw-empresa-chip-static) {
  background: var(--cw-primary-dark);
  box-shadow: 0 3px 12px rgba(15, 118, 110, 0.35);
}
.cw-empresa-chip-static {
  cursor: default;
  box-shadow: none;
  background: var(--cw-primary-soft);
  color: var(--cw-primary-dark);
}
.cw-empresa-chip-static:hover {
  background: var(--cw-primary-soft);
  color: var(--cw-primary-dark);
  box-shadow: none;
}
.cw-empresa-chip i:first-child {
  font-size: 0.78rem;
  opacity: 0.9;
  flex-shrink: 0;
}
.cw-empresa-chip-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.cw-empresa-chevron {
  font-size: 0.65rem;
  opacity: 0.85;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}
.cw-empresa-switch.open .cw-empresa-chevron {
  transform: rotate(180deg);
}
.cw-empresa-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: max(100%, 320px);
  max-width: min(440px, 92vw);
  max-height: min(360px, 60vh);
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--cw-border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
  padding: 0.35rem;
  z-index: 200;
}
.cw-empresa-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  cursor: pointer;
  font-family: inherit;
  color: var(--cw-text);
}
.cw-empresa-item:hover {
  background: var(--cw-sidebar-hover);
}
.cw-empresa-item.active {
  background: var(--cw-primary-soft);
}
.cw-empresa-item-doc {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--cw-primary-dark);
  letter-spacing: 0.01em;
}
.cw-empresa-item-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--cw-text);
}
.cw-empresa-item-name em {
  font-style: normal;
  margin-left: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--cw-primary);
  background: #fff;
  border: 1px solid var(--cw-primary-soft);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
}

.cw-content {
  padding: 0.85rem 1.1rem 1rem;
  flex: 1;
  overflow: auto;
}

.cw-app-footer {
  flex-shrink: 0;
  padding: 0.4rem 1.1rem;
  border-top: 1px solid var(--cw-border);
  font-size: 0.72rem;
  color: var(--cw-muted);
  background: var(--cw-sidebar-bg, #fff);
  font-variant-numeric: tabular-nums;
}

.cw-card {
  background: var(--cw-surface);
  border: 1px solid var(--cw-border);
  border-radius: var(--cw-radius);
  box-shadow: var(--cw-shadow);
  padding: 0.75rem 0.95rem;
}

.cw-page-title {
  font-family: var(--font-ui);
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}
.cw-page-sub {
  color: var(--cw-muted);
  margin: 0.2rem 0 0;
  font-size: 0.88rem;
}
/* Seletor de filial no cabeçalho (Configurações / Preferenciais / Dashboard) */
.cw-filial-bar {
  max-width: 42rem;
}
.cw-filial-select {
  width: 100%;
  max-width: 42rem;
  min-width: 0;
}

.cw-form-page .cw-form-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 0.65rem;
}
.cw-form-page .cw-form-toolbar .actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.cw-form-section {
  background: var(--cw-surface);
  border: 1px solid var(--cw-border);
  border-radius: var(--cw-radius);
  box-shadow: var(--cw-shadow);
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.65rem;
}
.cw-form-section h2 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}
.cw-form-section .section-help {
  color: var(--cw-muted);
  font-size: 0.78rem;
  margin: 0 0 0.5rem;
}
.cw-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.65rem 0 0.15rem;
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, transparent, var(--cw-bg) 28%);
  padding-top: 0.75rem;
  z-index: 5;
}

.cw-form-compact .cw-form-toolbar { margin-bottom: 0.55rem; }
.cw-form-compact .cw-form-section {
  padding: 0.65rem 0.8rem;
  margin-bottom: 0.55rem;
}
.cw-form-compact .cw-form-section h2 {
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}
.cw-form-compact .cw-form-section .section-help {
  font-size: 0.75rem;
  margin-bottom: 0.4rem;
}
.cw-form-compact .form-label {
  font-size: 0.75rem;
  margin-bottom: 0.15rem;
}
.cw-form-compact .cw-form-actions {
  padding-top: 0.55rem;
}

.cw-form-tabs {
  border-bottom-color: var(--cw-border);
}
.cw-form-tabs .nav-link {
  color: var(--cw-muted);
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 0.5rem 0.9rem;
}
.cw-form-tabs .nav-link:hover {
  color: var(--cw-primary);
  border-color: transparent;
}
.cw-form-tabs .nav-link.active {
  color: var(--cw-primary-dark);
  background: transparent;
  border-bottom-color: var(--cw-primary);
}

/* Configurações — itens com ajuda (?) */
.cw-cfg-form .tab-content {
  min-height: 12rem;
}
.cw-cfg-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem 1.25rem;
}
@media (min-width: 768px) {
  .cw-cfg-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.cw-cfg-item {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--cw-border);
  border-radius: 8px;
  background: #fafbfc;
}
.cw-cfg-item .form-check {
  flex: 1 1 auto;
  min-width: 0;
}
.cw-cfg-item-block {
  grid-column: 1 / -1;
  flex-direction: column;
  gap: 0.25rem;
}
.cw-cfg-help {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--cw-muted);
  padding: 0.1rem 0.15rem;
  line-height: 1;
  cursor: help;
}
.cw-cfg-help:hover,
.cw-cfg-help:focus {
  color: var(--cw-primary);
  outline: none;
}
.cw-cfg-help i {
  font-size: 0.95rem;
}

/* Suporte / chamados */
.cw-chamado-thread {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.cw-chamado-msg {
  border: 1px solid var(--cw-border);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  background: #fff;
}
.cw-chamado-msg-admin {
  background: #f0fdfa;
  border-color: #99f6e4;
}
.cw-chamado-msg-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  margin-bottom: 0.35rem;
}
.cw-chamado-msg-body {
  white-space: normal;
  font-size: 0.92rem;
}
.cw-chamado-anexos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.55rem;
}
.cw-chamado-anexo {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--cw-border);
  background: #f8fafc;
  text-decoration: none;
  color: inherit;
}
.cw-chamado-anexo:hover { color: var(--cw-primary); }

/* Notificações (sino) */
.cw-topbar-end {
  flex: 0 0 auto;
}
.cw-notif {
  position: relative;
}
.cw-notif-btn {
  position: relative;
  border: 1px solid var(--cw-border);
  background: #fff;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 8px;
  color: var(--cw-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.cw-notif-btn:hover {
  color: var(--cw-primary);
  border-color: var(--cw-primary);
}
.cw-notif-badge {
  position: absolute;
  top: -0.35rem;
  right: -0.35rem;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.cw-notif-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  width: min(360px, 92vw);
  background: #fff;
  border: 1px solid var(--cw-border);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
  z-index: 80;
  overflow: hidden;
}
.cw-notif-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--cw-border);
  background: #fafbfc;
}
.cw-notif-list {
  max-height: 360px;
  overflow: auto;
}
.cw-notif-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--cw-border);
  background: #fff;
  padding: 0.65rem 0.75rem;
  cursor: pointer;
}
.cw-notif-item:hover { background: #f8fafc; }
.cw-notif-item-unread { background: #ecfeff; }
.cw-notif-item-unread:hover { background: #cffafe; }

.cw-relacoes-filtros .form-label {
  font-size: 0.8rem;
  margin-bottom: 0.2rem;
}

/* Seta para abrir cadastro vinculado (à esquerda do campo/texto) */
.cw-cad-goto {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 6px;
  border: 1px solid var(--cw-border);
  background: var(--cw-surface);
  color: var(--cw-primary);
  font-size: 0.72rem;
  line-height: 1;
  text-decoration: none;
}
.cw-cad-goto:hover {
  background: var(--cw-primary-soft);
  color: var(--cw-primary-dark);
  border-color: #99f6e4;
}
.cw-cad-goto.is-disabled {
  opacity: 0.35;
  cursor: not-allowed;
  color: var(--cw-muted);
  background: #f8fafc;
  pointer-events: none;
}
.cw-cad-link-field {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.cw-cad-link-field > .form-control,
.cw-cad-link-field > .form-select {
  flex: 1 1 auto;
  min-width: 0;
}
.cw-cad-link-inline {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
}
.cw-cad-link-inline > .cw-cad-goto {
  margin-top: 0.1rem;
}
.cli-emp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.35rem 1rem;
}
.cli-emp-grid .form-check {
  margin: 0;
  min-height: 0;
}

.btn-cw {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--cw-primary);
  --bs-btn-border-color: var(--cw-primary);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--cw-primary-dark);
  --bs-btn-hover-border-color: var(--cw-primary-dark);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--cw-primary-dark);
  --bs-btn-active-border-color: var(--cw-primary-dark);
  background: var(--cw-primary);
  border-color: var(--cw-primary);
  color: #fff;
  font-size: 0.9rem;
  padding: 0.4rem 0.9rem;
}
.btn-cw:hover,
.btn-cw:focus,
.btn-cw:active,
.btn-cw:focus-visible {
  background: var(--cw-primary-dark) !important;
  border-color: var(--cw-primary-dark) !important;
  color: #fff !important;
}
.btn-accent {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--cw-accent);
  --bs-btn-border-color: var(--cw-accent);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #025a8a;
  --bs-btn-hover-border-color: #025a8a;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #025a8a;
  --bs-btn-active-border-color: #025a8a;
  background: var(--cw-accent);
  border-color: var(--cw-accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
}
.btn-accent:hover,
.btn-accent:focus,
.btn-accent:active,
.btn-accent:focus-visible {
  background: #025a8a !important;
  border-color: #025a8a !important;
  color: #fff !important;
  filter: none;
}

.btn-sm { font-size: 0.84rem; padding: 0.3rem 0.65rem; }

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--cw-muted);
  margin-bottom: 0.2rem;
}
.form-control, .form-select {
  font-size: 0.9rem;
  padding: 0.4rem 0.65rem;
  min-height: 36px;
  border-color: var(--cw-border);
  border-radius: 8px;
}
.form-control-sm, .form-select-sm {
  min-height: 32px;
  font-size: 0.86rem;
  padding: 0.3rem 0.55rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--cw-primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}
.form-check-label { font-size: 0.9rem; }
.form-check-input { margin-top: 0.25em; }

.table {
  font-size: 0.9rem;
  margin-bottom: 0;
  --bs-table-bg: transparent;
}
.table > :not(caption) > * > * {
  padding: 0.4rem 0.55rem;
  vertical-align: middle;
}
.table thead th {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cw-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--cw-border);
  background: #f8fafc;
  white-space: nowrap;
  padding: 0.4rem 0.55rem;
}
.table-sm > :not(caption) > * > * {
  padding: 0.32rem 0.5rem;
}
.table-hover tbody tr:hover { background: #f8fafc; }

.badge { font-size: 0.74rem; font-weight: 600; padding: 0.32em 0.55em; }
.badge-status-aberta { background: #0f766e; }
.badge-status-pendente { background: #d97706; color: #fff; }
.badge-status-fechada { background: #0284c7; }
.badge-status-cancelada { background: #dc2626; }

.alert {
  font-size: 0.88rem;
  padding: 0.5rem 0.8rem;
  margin-bottom: 0.65rem;
  border-radius: 8px;
}

.modal-header { padding: 0.7rem 0.95rem; }
.modal-body { padding: 0.75rem 0.95rem; }
.modal-footer { padding: 0.55rem 0.95rem; }
.modal-title { font-size: 1rem; font-weight: 700; }

.nav-pills .nav-link {
  font-size: 0.82rem;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
}
.nav-pills .nav-link.active {
  background: var(--cw-primary);
}

.pagination { margin: 0.55rem 0 0; }
.pagination .page-link {
  font-size: 0.8rem;
  padding: 0.3rem 0.55rem;
}

/* Compactação global de espaçamentos comuns nas telas */
.cw-content > .mb-3,
.cw-content > .d-flex.mb-3,
.cw-content > .row.mb-3,
.cw-content > .cw-card.mb-3,
.cw-content > .alert.mb-3 {
  margin-bottom: 0.6rem !important;
}
.cw-content > .mb-4 {
  margin-bottom: 0.75rem !important;
}
.cw-content .row.g-3 {
  --bs-gutter-x: 0.65rem;
  --bs-gutter-y: 0.65rem;
}

.comanda-card {
  border-radius: 10px;
  border: 1px solid var(--cw-border);
  background: #fff;
  padding: 0.75rem 0.85rem;
  cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
  border-left: 4px solid var(--cw-success);
  height: 100%;
}
.comanda-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--cw-shadow);
}
.comanda-card.pendente { border-left-color: var(--cw-warning); }
.comanda-card.fechada { border-left-color: var(--cw-info); }
.comanda-card.cancelada { border-left-color: var(--cw-danger); }
.comanda-card-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.15rem;
  min-width: 0;
}
.comanda-card-check {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  line-height: 1;
}
.comanda-card-check .form-check-input {
  margin: 0;
  float: none;
  position: static;
  cursor: pointer;
}
.comanda-card .numero {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  min-width: 0;
  line-height: 1.2;
}
.comanda-card .meta { color: var(--cw-muted); font-size: 0.875rem; line-height: 1.45; }
.comanda-card .total {
  font-weight: 700;
  font-size: 1.05rem;
  margin-top: 0.55rem;
  color: var(--cw-text);
}

/* Tela de detalhe da comanda — layout compacto */
.cw-content:has(.comanda-screen) {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 1rem 0.85rem;
  overflow: hidden;
}
.comanda-screen {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
  min-height: 0;
}
.comanda-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.comanda-top-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}
.comanda-num {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.comanda-meta-line {
  font-size: 0.8rem;
  color: var(--cw-muted);
  margin-top: 0.1rem;
}
.comanda-top-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.comanda-header-fields {
  flex-shrink: 0;
  padding: 0.65rem 0.85rem !important;
}
.comanda-header-fields .form-label {
  margin-bottom: 0.15rem;
  font-size: 0.72rem;
}
.comanda-body {
  display: flex;
  gap: 0.65rem;
  flex: 1;
  min-height: 0;
}
.comanda-itens {
  flex: 1 1 auto;
  width: auto;
  max-width: none;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--cw-border);
  border-radius: var(--cw-radius);
  overflow: visible;
}
.comanda-body--full .comanda-itens {
  flex: 1 1 100%;
  width: 100%;
  max-width: 100%;
}
.comanda-busca {
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid var(--cw-border);
  position: relative;
  flex-shrink: 0;
  z-index: 40;
  border-radius: var(--cw-radius) var(--cw-radius) 0 0;
}
.comanda-busca .form-control {
  width: 100%;
}
.comanda-busca-list,
.cw-live-search-list {
  max-height: 260px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--cw-border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  box-sizing: border-box;
}
.cw-live-search-list {
  display: none;
  margin: 0;
  /* Largura vem do JS (igual ao input); nunca 100% da viewport */
  width: auto;
  max-width: calc(100vw - 16px);
}
.cw-live-search-list.w-100 {
  width: auto !important;
}
.cw-live-search-list .list-group-item {
  text-align: left;
  white-space: normal;
  word-break: break-word;
}
.cw-live-search-list .btn {
  max-width: 100%;
}
.cw-prod-search-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.cw-prod-search-desc {
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.25;
  color: var(--cw-text);
}
.cw-prod-search-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  font-size: 0.75rem;
  color: var(--cw-muted);
}
.cw-prod-search-meta strong {
  font-weight: 600;
  color: #475569;
}
.cw-prod-search-preco {
  margin-left: auto;
  font-weight: 700;
  color: var(--cw-primary-dark);
  font-size: 0.82rem;
}
.cw-row-focus > * {
  background: var(--cw-primary-soft) !important;
}
.cw-row-focus {
  outline: 2px solid rgba(15, 118, 110, 0.35);
  outline-offset: -2px;
  animation: cw-row-focus-pulse 1.4s ease-out 1;
}
@keyframes cw-row-focus-pulse {
  0% { box-shadow: inset 0 0 0 0 rgba(15, 118, 110, 0.25); }
  100% { box-shadow: inset 0 0 0 0 transparent; }
}
.comanda-itens-table {
  flex: 1;
  overflow: auto;
  min-height: 0;
  border-radius: 0 0 var(--cw-radius) var(--cw-radius);
}
.comanda-itens-table .table {
  font-size: 0.85rem;
}
.comanda-itens-table .table > :not(caption) > * > * {
  padding: 0.35rem 0.5rem;
}
.comanda-itens-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  font-size: 0.68rem;
}
.comanda-col-qtd,
.comanda-col-desc {
  width: 6.5rem;
  min-width: 6.5rem;
}
.comanda-col-obs {
  width: 8.5rem;
  min-width: 7rem;
  max-width: 12rem;
}
.comanda-input-num {
  min-width: 5.5rem;
  width: 100%;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}
.comanda-input-obs {
  width: 100%;
  min-width: 5rem;
  font-size: 0.8rem;
}
.comanda-itens-foot {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.45rem 0.75rem;
  border-top: 1px solid var(--cw-border);
  background: #f8fafc;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.comanda-prefs {
  flex: 0 0 var(--pref-aside, 30%);
  width: var(--pref-aside, 30%);
  max-width: var(--pref-aside, 30%);
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--cw-border);
  border-radius: var(--cw-radius);
  overflow: hidden;
}
.comanda-prefs-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cw-muted);
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--cw-border);
  flex-shrink: 0;
}
.comanda-pref-grid {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 0.35rem;
  display: grid;
  grid-template-columns: repeat(var(--pref-cols, 5), minmax(0, 1fr));
  grid-template-rows: repeat(6, minmax(0, 1fr));
  gap: 0.28rem;
  align-content: stretch;
}
.comanda-pref-grid .pref-btn {
  min-height: 0 !important;
  height: 100%;
  padding: 0.2rem 0.15rem;
  font-size: 0.62rem;
  line-height: 1.15;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.05rem;
  overflow: hidden;
}
.comanda-pref-grid .pref-btn .pref-pos {
  font-size: 0.55rem;
  opacity: 0.5;
  font-weight: 700;
  line-height: 1;
}
.comanda-pref-grid .pref-btn small {
  display: block;
  font-size: 0.55rem;
  opacity: 0.75;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 991px) {
  .cw-content:has(.comanda-screen) {
    overflow: auto;
    height: auto;
  }
  .comanda-screen { height: auto; }
  .cw-content:has(.caixa-screen) {
    overflow: auto;
    height: auto;
  }
  .caixa-screen { height: auto; }
  .caixa-mov-card { min-height: 220px; max-height: 55vh; }
  .caixa-mov-scroll { max-height: none; }
  .comanda-body {
    flex-direction: column;
    min-height: auto;
  }
  .comanda-itens,
  .comanda-prefs {
    flex: none;
    width: 100%;
    max-width: 100%;
  }
  .comanda-itens {
    min-height: 320px;
  }
  .comanda-prefs {
    max-height: none;
    height: auto;
  }
  .comanda-pref-grid {
    grid-template-columns: repeat(var(--pref-cols, 5), minmax(0, 1fr));
    grid-template-rows: repeat(6, minmax(52px, auto));
    overflow: visible;
    height: auto;
  }
}

.pref-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 0.6rem;
}
.pref-btn {
  border: 1px solid var(--cw-border);
  background: #f8fafc;
  border-radius: 10px;
  padding: 0.6rem 0.4rem;
  min-height: 76px;
  font-size: 0.8rem;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
}
.pref-btn:hover { background: var(--cw-primary-soft); border-color: var(--cw-primary); }
.pref-btn.empty {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

.stat-box {
  background: #fff;
  border: 1px solid var(--cw-border);
  border-radius: var(--cw-radius);
  padding: 0.6rem 0.8rem;
}
.stat-box .label { color: var(--cw-muted); font-size: 0.78rem; font-weight: 500; }
.stat-box .value {
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: 0.15rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

/* Dashboard multifilial */
.cw-dash-filtros {
  padding: 1rem 1.15rem;
}
.cw-period-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.cw-period-chip {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--cw-border);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--cw-muted);
  background: #fff;
  cursor: pointer;
  user-select: none;
}
.cw-period-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.cw-period-chip.is-active,
.cw-period-chip:has(input:checked) {
  border-color: var(--cw-primary, #0d6b4c);
  background: rgba(13, 107, 76, 0.08);
  color: var(--cw-primary, #0d6b4c);
}
.cw-dash-conta {
  min-width: min(100%, 14rem);
  flex: 1 1 14rem;
  max-width: 22rem;
}
.cw-dash-conta .form-select,
.cw-dash-filial .form-select {
  width: 100%;
  min-width: 0;
}
.cw-dash-filial {
  min-width: min(100%, 18rem);
  flex: 1 1 18rem;
}
/* Caixa: layout compacto + Movimentação com rolagem até o rodapé */
.cw-content:has(.caixa-screen) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0.85rem 1.1rem 0.75rem;
}
.caixa-screen {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 0.55rem;
}
.caixa-screen-top,
.caixa-screen-stats,
.caixa-screen-filter {
  flex-shrink: 0;
}
.caixa-screen-stats .stat-box {
  padding: 0.55rem 0.75rem;
}
.caixa-screen-filter {
  padding: 0.55rem 0.75rem;
}
.caixa-mov-card {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-bottom: 0 !important;
  padding: 0.65rem 0.85rem 0.55rem;
}
.caixa-mov-title {
  flex-shrink: 0;
  margin: 0 0 0.4rem;
  font-size: 1rem;
  font-weight: 600;
}
.caixa-mov-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  margin: 0 -0.15rem;
  padding: 0 0.15rem;
}
.caixa-mov-scroll .table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--cw-surface);
  box-shadow: 0 1px 0 var(--cw-border);
}

.cw-caixa-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}
.cw-caixa-badge.is-open {
  color: #0a5c3a;
  background: rgba(25, 135, 84, 0.12);
}
.cw-caixa-badge.is-closed {
  color: #842029;
  background: rgba(220, 53, 69, 0.1);
}
.cw-dash-total-row td {
  border-top: 2px solid var(--cw-border);
  background: #f7f8f7;
}

.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1080;
}
.toast { font-size: 0.95rem; }

.cw-confirm-modal {
  border: 0;
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
}
.cw-confirm-icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 0.85rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cw-primary-soft);
  color: var(--cw-primary);
  font-size: 1.25rem;
}
.cw-confirm-icon.is-danger {
  background: #fee2e2;
  color: var(--cw-danger);
}
.cw-confirm-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}
.cw-confirm-msg {
  font-size: 0.9rem;
  line-height: 1.45;
}

@media (max-width: 991px) {
  .cw-app { height: auto; min-height: 100vh; overflow: visible; }
  .cw-main { height: auto; overflow: visible; }
  .cw-sidebar {
    position: fixed;
    left: calc(-1 * var(--sidebar-w) - 10px);
    transition: left 0.2s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,0.08);
  }
  .cw-sidebar.open { left: 0; }
  .cw-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    z-index: 99;
  }
  .cw-sidebar-backdrop.show { display: block; }
  .cw-content { padding: 0.75rem 0.85rem 0.9rem; }
  .cw-topbar {
    height: auto;
    min-height: var(--topbar-h);
    flex-wrap: wrap;
    padding: 0.65rem 1rem;
  }
  .cw-empresa-switch {
    max-width: 100%;
    flex: 1 1 auto;
  }
  .cw-empresa-menu {
    left: 0;
    right: auto;
    min-width: 100%;
  }
  .cw-topbar-user { max-width: none; }
}

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: linear-gradient(135deg, #f0fdfa 0%, #f4f6f8 40%, #e0f2fe 100%);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid var(--cw-border);
  border-radius: 16px;
  padding: 2rem 1.85rem;
  box-shadow: 0 10px 32px rgba(15, 23, 42, 0.06);
}
.auth-card-empresas {
  max-width: min(560px, 100%);
}
.auth-empresa-list {
  overflow: hidden;
}
.auth-empresa-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
}
.auth-empresa-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.auth-empresa-text strong {
  display: block;
  font-size: 0.95rem;
  line-height: 1.35;
  white-space: normal;
}

.landing-hero {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 15% 20%, rgba(15, 118, 110, 0.12), transparent 50%),
    radial-gradient(ellipse at 85% 15%, rgba(3, 105, 161, 0.1), transparent 45%),
    linear-gradient(165deg, #f8fafc 0%, #f0fdfa 50%, #e0f2fe 100%);
  color: var(--cw-text);
  position: relative;
  overflow: hidden;
}
.landing-hero .navbar-brand,
.landing-hero .cw-brand { color: var(--cw-primary) !important; }
.landing-hero .btn-outline-light {
  border-color: var(--cw-border);
  color: var(--cw-text);
  background: #fff;
}
.landing-hero .btn-outline-light:hover {
  background: var(--cw-sidebar-hover);
  color: var(--cw-text);
  border-color: #cbd5e1;
}

.plan-card {
  background: #fff;
  border-radius: 16px;
  padding: 1.75rem;
  border: 1px solid var(--cw-border);
  height: 100%;
  color: var(--cw-text);
  position: relative;
}
.plan-card.featured {
  border: 2px solid var(--cw-primary);
  box-shadow: 0 12px 32px rgba(15, 118, 110, 0.12);
}
.plan-card .price {
  font-size: 2.15rem;
  font-weight: 700;
  color: var(--cw-primary);
}
.plan-badge {
  position: absolute;
  top: -11px;
  right: 14px;
  background: var(--cw-primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
}

.print-80mm {
  width: 80mm;
  max-width: 80mm;
  margin: 0 auto;
  font-family: "Courier New", monospace;
  font-size: 12px;
}
@media print {
  .no-print { display: none !important; }
}
/* Impressão térmica 80mm (comanda) — isolada para não zerar páginas A4 */
@media print {
  body:has(.print-80mm) * { visibility: hidden; }
  body:has(.print-80mm) .print-80mm,
  body:has(.print-80mm) .print-80mm * { visibility: visible; }
  body:has(.print-80mm) .print-80mm {
    position: absolute;
    left: 0;
    top: 0;
    width: 80mm;
  }
}

/* Modal pagamento — layout em 2 colunas */
.modal-pagamento {
  --bs-modal-width: 760px;
}
.pg-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
}
.pg-resumo {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--cw-border, #e5e7eb);
}
.pg-modal-right .pg-lista {
  max-height: 280px;
  overflow-y: auto;
}
@media (max-width: 767.98px) {
  .pg-modal-grid {
    grid-template-columns: 1fr;
  }
  .pg-modal-right .pg-lista {
    max-height: 200px;
  }
}

/* Relatórios */
.cw-rel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
}
.cw-rel-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--cw-border, #e5e7eb);
  border-radius: 0.5rem;
  background: var(--cw-surface, #fff);
  text-decoration: none;
  color: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.cw-rel-card:hover {
  border-color: var(--cw-primary, #0f766e);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
  color: inherit;
}
.cw-rel-card-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.45rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 118, 110, 0.1);
  color: var(--cw-primary, #0f766e);
  flex-shrink: 0;
}
.cw-rel-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
}
.cw-rel-card-desc {
  font-size: 0.8rem;
  color: var(--cw-muted, #64748b);
  margin: 0;
  line-height: 1.35;
}
.cw-rel-card-go {
  margin-left: auto;
  color: var(--cw-muted, #64748b);
  align-self: center;
}
@media print {
  .cw-sidebar, .cw-topbar, .cw-form-toolbar .actions, .cw-dash-filtros, .cw-form-actions {
    display: none !important;
  }
  .cw-content { padding: 0 !important; }
  .cw-rel-result { border: none; box-shadow: none; }
}
