
/* CRM_CUSTOMER_WORKSPACE_V2_STYLE */
.cw-filter-shell {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
  padding: 20px;
  border: 1px solid var(--line, #dbe2ea);
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--crm-primary, #2563eb) 12%, transparent), transparent 38%),
    var(--panel, #fff);
}
.cw-filter-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.cw-filter-top h2 { margin: 3px 0 5px; }
.cw-filter-top p { margin: 0; color: var(--muted, #64748b); max-width: 760px; }
.cw-period-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--soft, #f1f5f9);
}
.cw-period-switch button {
  border: 0;
  border-radius: 9px;
  padding: 8px 12px;
  background: transparent;
  color: var(--muted, #64748b);
  white-space: nowrap;
}
.cw-period-switch button.active {
  background: var(--panel, #fff);
  color: var(--crm-primary, #2563eb);
  box-shadow: 0 2px 10px rgba(15, 23, 42, .1);
  font-weight: 700;
}
.cw-filter-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) repeat(4, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
}
.cw-filter-form label {
  display: grid;
  gap: 5px;
  color: var(--muted, #64748b);
  font-size: 12px;
  font-weight: 650;
}
.cw-filter-form input,
.cw-filter-form select {
  width: 100%;
  min-height: 40px;
}
.cw-filter-actions {
  display: flex;
  gap: 8px;
}
.cw-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.cw-metric {
  display: grid;
  gap: 6px;
  min-height: 112px;
  padding: 16px;
  text-align: left;
  border: 1px solid var(--line, #dbe2ea);
  border-radius: 16px;
  background: var(--panel, #fff);
  color: inherit;
}
.cw-metric:hover {
  border-color: color-mix(in srgb, var(--crm-primary, #2563eb) 55%, var(--line, #dbe2ea));
  transform: translateY(-1px);
}
.cw-metric small { color: var(--muted, #64748b); }
.cw-metric strong { font-size: clamp(22px, 2vw, 32px); line-height: 1.1; }
.cw-metric span { color: var(--muted, #64748b); font-size: 12px; }
.cw-metric.RED { border-left: 5px solid #dc2626; }
.cw-metric.YELLOW { border-left: 5px solid #d97706; }
.cw-metric.GREEN { border-left: 5px solid #16a34a; }
.cw-metric.BLUE { border-left: 5px solid #2563eb; }
.cw-breakdown-panel { margin-bottom: 16px; }
.cw-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 18px;
}
.cw-breakdown-grid article {
  padding: 14px;
  border-radius: 14px;
  background: var(--soft, #f8fafc);
}
.cw-breakdown-grid h4 { margin: 0 0 10px; }
.cw-breakdown-list { display: grid; gap: 9px; }
.cw-breakdown-list > div {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(90px, 1.2fr) 52px;
  gap: 10px;
  align-items: center;
}
.cw-breakdown-list span { display: flex; justify-content: space-between; gap: 8px; }
.cw-breakdown-list span small { color: var(--muted, #64748b); }
.cw-breakdown-list i {
  height: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: #e2e8f0;
}
.cw-breakdown-list i em {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--crm-primary, #2563eb);
}
.cw-breakdown-list > div > strong { font-size: 12px; text-align: right; }
.cw-list-panel { margin-bottom: 20px; }
.cw-table td { vertical-align: top; }
.cw-table td small {
  display: block;
  margin-top: 3px;
  color: var(--muted, #64748b);
}
.cw-health,
.cw-priority {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 800;
}
.cw-health.GREEN { background: #dcfce7; color: #166534; }
.cw-health.YELLOW,
.cw-priority.YELLOW { background: #fef3c7; color: #92400e; }
.cw-health.RED,
.cw-health.BLOCKED,
.cw-priority.RED { background: #fee2e2; color: #991b1b; }
.cw-priority.NEUTRAL { background: #e2e8f0; color: #334155; }
.cw-debt-row.RED td:first-child,
.cw-care-row.RED td:first-child { box-shadow: inset 4px 0 #dc2626; }
.cw-debt-row.YELLOW td:first-child,
.cw-care-row.YELLOW td:first-child { box-shadow: inset 4px 0 #d97706; }
.cw-debt-row.BLOCKED td:first-child { box-shadow: inset 4px 0 #7f1d1d; }
.cw-warning-text { color: #b45309; font-weight: 700; }
.cw-danger-text { color: #b91c1c; }
.cw-create-landing {
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
}
.cw-create-landing h2 { margin: 5px 0 8px; }
.cw-create-landing p { max-width: 680px; color: var(--muted, #64748b); }

@media (max-width: 1280px) {
  .cw-filter-form { grid-template-columns: repeat(3, minmax(170px, 1fr)); }
  .cw-metric-grid { grid-template-columns: repeat(3, minmax(170px, 1fr)); }
}
@media (max-width: 900px) {
  .cw-filter-top { flex-direction: column; }
  .cw-filter-form { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  .cw-metric-grid { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  .cw-breakdown-grid { grid-template-columns: 1fr; }
  .cw-create-landing { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 600px) {
  .cw-filter-shell { padding: 14px; }
  .cw-period-switch { width: 100%; overflow-x: auto; }
  .cw-filter-form,
  .cw-metric-grid { grid-template-columns: 1fr; }
}

/* CUSTOMER_UI_HOTFIX_V332 */
.cw-table-tools { display:flex; align-items:center; justify-content:flex-end; gap:8px; position:relative; }
.cw-column-picker { position:relative; margin:0; }
.cw-column-picker>summary { list-style:none; cursor:pointer; user-select:none; white-space:nowrap; font-size:12px; padding:6px 10px; }
.cw-column-picker>summary::-webkit-details-marker { display:none; }
.cw-column-popover { position:absolute; z-index:40; top:calc(100% + 6px); right:0; width:220px; max-height:360px; overflow:auto; padding:9px; border:1px solid #d7e0e9; border-radius:11px; background:#fff; box-shadow:0 14px 34px rgba(35,55,75,.17); }
.cw-column-popover label { display:flex; align-items:center; gap:8px; min-height:30px; padding:5px 7px; border-radius:7px; color:#33485c; font-size:12px; }
.cw-column-popover label:hover { background:#f4f7fa; }
.cw-column-popover input { width:14px; height:14px; margin:0; }
.cw-column-popover>button { width:100%; margin-top:7px; }
