/* Phoenix Workbench — UX improvements overlay */
:root {
  --wb-primary: #4f46e5;
  --wb-ok: #059669;
  --wb-warn: #d97706;
  --wb-danger: #dc2626;
}

#phoenixWorkbenchBar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0 0 1.25rem;
  padding: 0.9rem 1rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.wb-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.wb-tab {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.wb-tab.active {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #3730a3;
}

.wb-tab .wb-count {
  background: #e2e8f0;
  color: #475569;
  border-radius: 999px;
  padding: 0 7px;
  font-size: 0.72rem;
  min-width: 1.2rem;
  text-align: center;
}

.wb-tab.active .wb-count {
  background: #4f46e5;
  color: #fff;
}

.wb-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.wb-filters input,
.wb-filters select {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 0.45rem 0.7rem;
  font-size: 0.85rem;
  background: #fff;
  color: #0f172a;
}

.wb-filters input {
  min-width: min(100%, 240px);
  flex: 1;
}

.wb-quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.55rem;
}

.wb-quick-btn {
  border: 1px solid #dbeafe;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 8px;
  padding: 0.28rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.wb-quick-btn.success { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.wb-quick-btn.warn { background: #fffbeb; border-color: #fde68a; color: #b45309; }
.wb-quick-btn.danger { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }

.wb-toast-host {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(360px, calc(100vw - 24px));
  pointer-events: none;
}

.wb-toast {
  pointer-events: auto;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  max-width: 340px;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  color: #0f172a;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  font-size: 0.88rem;
  line-height: 1.35;
  animation: wbIn 0.22s ease;
}

.wb-toast .wb-toast-ico {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 0.78rem;
  background: rgba(29, 78, 216, 0.12);
  color: #1d4ed8;
}

.wb-toast.ok .wb-toast-ico {
  background: rgba(5, 150, 105, 0.12);
  color: #059669;
}

.wb-toast.err .wb-toast-ico {
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
}

.wb-toast.info .wb-toast-ico {
  background: rgba(29, 78, 216, 0.12);
  color: #1d4ed8;
}

.wb-toast .wb-toast-body {
  min-width: 0;
  padding-top: 2px;
}

.wb-toast .wb-toast-body strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
}

@keyframes wbIn {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.wb-bell {
  position: relative;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 10px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.wb-bell-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #dc2626;
  color: #fff;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.wb-notify-panel {
  display: none;
  position: absolute;
  right: 0;
  top: 44px;
  width: min(360px, 90vw);
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(15,23,42,.15);
  z-index: 50;
  max-height: 360px;
  overflow: auto;
}

.wb-notify-item {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.82rem;
  color: #334155;
  cursor: pointer;
}

.wb-notify-item:hover { background: #f8fafc; }
.wb-notify-item.unread { background: #eef2ff; }

.wb-panel-box {
  margin-top: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.9rem;
  background: #f8fafc;
}

.wb-panel-box h4 {
  margin: 0 0 0.6rem;
  font-size: 0.9rem;
  color: #0f172a;
}

.wb-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.35rem 0;
  font-size: 0.85rem;
}

.wb-comment {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  margin-bottom: 0.45rem;
  font-size: 0.82rem;
}

.wb-comment strong { color: #4338ca; }
.wb-comment .meta { color: #94a3b8; font-size: 0.72rem; }

.wb-queue-hint {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: #64748b;
}

@media (max-width: 900px) {
  #phoenixWorkbenchBar { margin-inline: 0; }
  .wb-filters { flex-direction: column; align-items: stretch; }
}
