/**
 * Work Suite - UI Components Library (2026 SaaS Edition)
 */

/* Cards & Surfaces */
.ws-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-smooth);
}

.ws-card-glass {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.ws-card:hover {
  border-color: var(--border-strong);
}

.ws-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.ws-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Stat & Metric Cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 90px;
  height: 90px;
  background: radial-gradient(circle, var(--accent-cyan-glow) 0%, transparent 70%);
  opacity: 0.6;
  pointer-events: none;
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-family: var(--font-mono);
}

.stat-subtext {
  font-size: 0.78rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all var(--transition-smooth);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-indigo) 100%);
  color: #ffffff;
  box-shadow: 0 4px 16px -2px rgba(6, 182, 212, 0.35);
}

.btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px -2px rgba(6, 182, 212, 0.45);
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: var(--border-strong);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
}

.btn-danger {
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  color: #ffffff;
}

.btn-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
}

.btn-ghost {
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 14px 26px;
  font-size: 1rem;
}

/* Badges & Status Indicators */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.70rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1.2;
}

/* Modern Status Pill with Pulsing Dot */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 9999px;
  font-size: 0.70rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1.2;
  flex-shrink: 0;
  transition: all var(--transition-smooth);
}

.status-pill.status-connected,
.status-pill.status-success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #10b981;
}

.status-pill.status-dual,
.status-pill.status-accent {
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.35);
  color: var(--accent-cyan);
}

.status-pill.status-warning {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #f59e0b;
}

.status-pill.status-danger,
.status-pill.status-failed {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #f43f5e;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  animation: pulseRadar 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
  flex-shrink: 0;
}

/* Metadata chip for secondary connection details */
.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.meta-chip-cyan {
  color: var(--accent-cyan);
  border-color: rgba(6, 182, 212, 0.25);
  background: rgba(6, 182, 212, 0.06);
}

.meta-chip-purple {
  color: var(--accent-purple);
  border-color: rgba(168, 85, 247, 0.25);
  background: rgba(168, 85, 247, 0.06);
}

.badge-asana {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.15) 0%, rgba(249, 115, 22, 0.15) 100%);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #f43f5e;
}

.badge-custom {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(168, 85, 247, 0.15) 100%);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #818cf8;
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #10b981;
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #f59e0b;
}

.badge-danger {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #f43f5e;
}

.badge-accent {
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.35);
  color: #06b6d4;
}

.badge-category-my {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #60a5fa;
}

.badge-category-assisted {
  background: rgba(236, 72, 153, 0.15);
  border: 1px solid rgba(236, 72, 153, 0.35);
  color: #f472b6;
}

.badge-client-tag,
.task-client-badge {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #c084fc;
  text-transform: none !important;
  font-weight: 600;
  letter-spacing: normal;
}

.btn-category-toggle {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
}

.btn-category-toggle:hover {
  border-color: var(--border-medium);
  color: var(--text-main);
}

.btn-category-toggle.active-my {
  background: rgba(59, 130, 246, 0.2);
  border-color: #3b82f6;
  color: #60a5fa;
  font-weight: 700;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.25);
}

.btn-category-toggle.active-assisted {
  background: rgba(236, 72, 153, 0.2);
  border-color: #ec4899;
  color: #f472b6;
  font-weight: 700;
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.25);
}

/* Priority Badges */
.priority-urgent {
  color: #f43f5e;
  background: rgba(244, 63, 94, 0.12);
}
.priority-high {
  color: #f97316;
  background: rgba(249, 115, 22, 0.12);
}
.priority-medium {
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.12);
}
.priority-low {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.12);
}

/* Visual 5-Stage Stepper */
.stage-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  margin: 20px 0;
}

.stage-stepper::before {
  content: '';
  position: absolute;
  top: 15px;
  left: 30px;
  right: 30px;
  height: 2px;
  background: var(--border-subtle);
  z-index: 1;
}

.stepper-item {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform var(--transition-smooth);
}

.stepper-item:hover {
  transform: translateY(-2px);
}

.stepper-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-surface-elevated);
  border: 2px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  transition: all var(--transition-smooth);
}

.stepper-item.completed .stepper-circle {
  background: var(--accent-emerald);
  border-color: var(--accent-emerald);
  color: #ffffff;
}

.stepper-item.active .stepper-circle {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  color: #090d16;
  box-shadow: 0 0 16px var(--accent-cyan-glow);
}

.stepper-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dim);
  text-align: center;
}

.stepper-item.active .stepper-label {
  color: var(--accent-cyan);
}

.stepper-item.completed .stepper-label {
  color: var(--text-main);
}

/* Forms & Inputs */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.9rem;
  transition: all var(--transition-smooth);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.18);
  outline: none;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(5, 8, 15, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-smooth);
  padding: 16px;
  box-sizing: border-box;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: min(90vh, 760px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 48px -8px rgba(0, 0, 0, 0.6);
  transform: scale(0.96);
  transition: transform var(--transition-smooth);
  position: relative;
}

.modal-card > form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.modal-overlay.open .modal-card {
  transform: scale(1);
}

.modal-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.modal-body {
  padding: 18px 22px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

/* Suggestion Pills / Chips */
.suggestion-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
}

.suggestion-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 0.73rem;
  font-weight: 600;
  background: var(--bg-surface-elevated, rgba(255, 255, 255, 0.05));
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.suggestion-pill:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent-indigo, #6366f1);
  color: #a5b4fc;
  transform: translateY(-1px);
}

.suggestion-pill.active {
  background: rgba(99, 102, 241, 0.25);
  border-color: #818cf8;
  color: #ffffff;
  font-weight: 700;
}

.suggestion-pill-featured {
  border-color: rgba(99, 102, 241, 0.4);
  color: var(--accent-cyan, #06b6d4);
}

.btn-manage-clients {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--accent-cyan, #06b6d4);
  background: rgba(6, 182, 212, 0.08);
  border: 1px dashed rgba(6, 182, 212, 0.35);
  border-radius: var(--radius-sm, 6px);
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-top: 8px;
}

.btn-manage-clients:hover {
  background: rgba(6, 182, 212, 0.16);
  border-color: var(--accent-cyan, #06b6d4);
  color: #fff;
}

@media (max-width: 640px) {
  .modal-overlay {
    padding: 8px;
  }
  .modal-card {
    max-width: 100%;
    max-height: 94vh;
    border-radius: var(--radius-md);
  }
  .modal-header {
    padding: 12px 16px;
  }
  .modal-body {
    padding: 14px 16px;
  }
  .modal-footer {
    padding: 10px 16px;
  }
  .form-row {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .suggestion-pills-row {
    gap: 4px;
  }
  .suggestion-pill {
    padding: 2px 7px;
    font-size: 0.70rem;
  }
}

/* Slide-over Task Drawer */
.task-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(5, 8, 15, 0.65);
  backdrop-filter: blur(6px);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-smooth);
}

.task-drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.task-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 92%;
  max-width: 1080px;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-strong);
  z-index: 95;
  transform: translateX(100%);
  transition: transform var(--transition-smooth);
  display: flex;
  flex-direction: column;
}

.task-drawer-overlay.open .task-drawer {
  transform: translateX(0);
}

.drawer-header {
  padding: 18px 28px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-content-3col {
  flex: 1;
  display: grid;
  grid-template-columns: 320px 1fr 340px;
  overflow: hidden;
}

.drawer-col {
  padding: 24px;
  overflow-y: auto;
}

.drawer-col-left {
  border-right: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.drawer-col-center {
  background: var(--bg-base);
}

.drawer-col-right {
  border-left: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

@media (max-width: 992px) {
  .drawer-content-3col {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
}

/* Command Palette (Ctrl + K) */
.cmd-palette-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(5, 8, 15, 0.75);
  backdrop-filter: blur(12px);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-smooth);
}

.cmd-palette-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.cmd-palette-box {
  width: 90%;
  max-width: 640px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px -12px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

.cmd-search-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.cmd-search-input {
  flex: 1;
  font-size: 1.1rem;
  color: var(--text-main);
  background: none;
  border: none;
  outline: none;
}

.cmd-results-list {
  max-height: 380px;
  overflow-y: auto;
  padding: 10px;
}

.cmd-group-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 8px 12px 4px;
}

.cmd-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: all 150ms ease;
}

.cmd-item:hover, .cmd-item.selected {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
}

/* Toast Container */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: 420px;
  animation: slideInRight 0.3s ease;
}

.toast.toast-success {
  border-left: 4px solid var(--accent-emerald);
}

.toast.toast-error {
  border-left: 4px solid var(--accent-rose);
}

.toast.toast-info {
  border-left: 4px solid var(--accent-cyan);
}

/* ==========================================================================
   Task Selection, Batch Actions Bar & Deletion
   ========================================================================== */

.task-select-chk {
  appearance: none;
  -webkit-appearance: none;
  width: 17px;
  height: 17px;
  border: 1.5px solid var(--border-strong);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  background-color: var(--bg-surface-elevated);
  vertical-align: middle;
  transition: all 150ms cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-grid;
  place-content: center;
  flex-shrink: 0;
  margin: 0;
}

.task-select-chk::before {
  content: "";
  width: 9px;
  height: 9px;
  transform: scale(0);
  transition: 120ms transform ease-in-out;
  box-shadow: inset 1em 1em var(--bg-base);
  background-color: #fff;
  transform-origin: center;
  clip-path: polygon(14% 44%, 0 60%, 40% 100%, 100% 18%, 80% 0%, 35% 65%);
}

.task-select-chk:checked {
  background-color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.task-select-chk:checked::before {
  transform: scale(1);
}

.task-select-chk:indeterminate {
  background-color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.task-select-chk:indeterminate::before {
  transform: scale(1);
  clip-path: polygon(0 40%, 100% 40%, 100% 60%, 0 60%);
}

.task-select-chk:hover {
  border-color: var(--accent-cyan);
}

/* Task card selected highlight */
.task-card-item {
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease, background 150ms ease, opacity 250ms ease;
}

.task-card-item.selected {
  border-color: rgba(6, 182, 212, 0.6) !important;
  background: rgba(6, 182, 212, 0.04) !important;
  box-shadow: 0 0 0 1px rgba(6, 182, 212, 0.35), 0 4px 16px -2px rgba(6, 182, 212, 0.15);
}

.task-card-item.task-card-today {
  border-color: rgba(16, 185, 129, 0.45) !important;
  box-shadow: 0 4px 16px -4px rgba(16, 185, 129, 0.15);
}

.task-day-header {
  user-select: none;
}

/* Single delete button on card */
.btn-delete-task {
  opacity: 0.55;
  color: var(--text-dim);
  padding: 3px 6px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  transition: all 150ms ease;
  background: transparent;
  border: none;
  cursor: pointer;
}

.btn-delete-task:hover {
  opacity: 1;
  color: var(--accent-rose, #f43f5e) !important;
  background: rgba(244, 63, 94, 0.12);
  transform: scale(1.1);
}

/* Select all label */
.task-select-all-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  user-select: none;
  transition: all 150ms ease;
}

.task-select-all-label:hover {
  border-color: var(--border-strong);
  color: var(--text-main);
}

/* Floating Batch Actions Toolbar */
.tasks-batch-bar {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  opacity: 0;
  pointer-events: none;
  z-index: 180;
  transition: transform 250ms cubic-bezier(0.16, 1, 0.3, 1), opacity 200ms ease;
}

.tasks-batch-bar.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.batch-bar-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 18px 10px 20px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .batch-bar-inner {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.batch-bar-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

.batch-count-pill {
  background: var(--accent-cyan);
  color: #0f172a;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 9999px;
  min-width: 20px;
  text-align: center;
}

.batch-bar-divider {
  width: 1px;
  height: 20px;
  background: var(--border-strong);
}

.batch-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   Trending Sync Center Cards & Progress HUD
   ========================================================================== */

/* Redesigned Provider Card Header */
.sync-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: var(--radius-lg);
  padding: 22px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-smooth);
}

.sync-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.35);
}

.sync-card-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.sync-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.sync-card-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.sync-card-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}

.sync-card-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-main);
  line-height: 1.3;
  word-break: normal;
}

.sync-card-actions-top {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* Provider Switch / Toggle button */
.provider-toggle-btn {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 9999px;
  cursor: pointer;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface-elevated);
  color: var(--text-muted);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.provider-toggle-btn:hover {
  background: var(--bg-surface);
  color: var(--text-main);
  border-color: var(--accent-indigo);
}
.provider-toggle-btn.is-active:hover {
  color: var(--accent-rose);
  border-color: rgba(244, 63, 94, 0.4);
  background: rgba(244, 63, 94, 0.08);
}
.provider-toggle-btn.is-deactivated {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-emerald);
  border-color: rgba(16, 185, 129, 0.3);
}
.provider-toggle-btn.is-deactivated:hover {
  background: rgba(16, 185, 129, 0.2);
}

.sync-card.is-deactivated {
  opacity: 0.72;
  background: var(--bg-surface-elevated);
  border-color: var(--border-subtle);
}

.sync-card.is-deactivated:hover {
  opacity: 0.95;
  border-color: var(--border-strong);
}

.sync-card.is-deactivated .sync-card-tags .meta-chip {
  opacity: 0.6;
  filter: grayscale(80%);
}

.status-pill.status-deactivated {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-muted);
  border: 1px solid rgba(148, 163, 184, 0.25);
}
.status-pill.status-deactivated .pulse-dot {
  background: var(--text-dim);
  animation: none;
  box-shadow: none;
}

.sync-card-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* Inline Card Progress Bar (Animated during card sync) */
.sync-card-progress {
  height: 4px;
  background: var(--bg-surface-elevated);
  border-radius: 9999px;
  overflow: hidden;
  margin: 12px 0;
  display: none;
}

.sync-card-progress.active {
  display: block;
}

.sync-card-progress-bar {
  height: 100%;
  width: 100%;
  background: var(--primary-gradient);
  background-size: 200% 100%;
  animation: shimmerGradient 1.5s infinite linear;
  border-radius: 9999px;
}

.sync-card-meta {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Global Sync Progress Modal / HUD */
.sync-hud-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.25s ease-out;
}

.sync-hud-overlay.active {
  display: flex;
}

.sync-hud-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 100%;
  max-width: 540px;
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.65), 0 0 40px -8px var(--accent-glow);
  position: relative;
  overflow: hidden;
}

.sync-hud-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.sync-hud-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sync-hud-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s infinite linear;
}

.sync-hud-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.sync-hud-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.sync-hud-bar-container {
  height: 8px;
  background: var(--bg-surface-elevated);
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid var(--border-subtle);
}

.sync-hud-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--primary-gradient);
  background-size: 200% 100%;
  animation: shimmerGradient 1.5s infinite linear;
  border-radius: 9999px;
  transition: width 0.4s ease;
}

.sync-hud-status-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.sync-step-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.sync-step-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all 0.25s ease;
}

.sync-step-item.active {
  border-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.08);
  box-shadow: 0 0 16px -4px var(--accent-glow);
}

.sync-step-item.completed {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.06);
}

.sync-step-item.skipped {
  opacity: 0.55;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border-subtle);
}

.sync-step-item.skipped .sync-step-name {
  color: var(--text-dim);
}

.sync-step-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sync-step-icon {
  font-size: 1.1rem;
}

.sync-step-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
}

.sync-step-badge {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
}

.badge-secondary {
  background: var(--bg-surface-elevated, rgba(255, 255, 255, 0.06));
  color: var(--text-dim, #94a3b8);
  border: 1px solid var(--border-subtle);
}

/* ==========================================================================
   Theme Customizer Dropdown & Studio
   ========================================================================== */

.theme-dropdown {
  position: absolute;
  top: 50px;
  right: 0;
  width: 280px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 12px;
  z-index: 100;
  box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.5), 0 0 20px -4px var(--accent-glow);
  display: none;
  animation: popIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.theme-dropdown.open {
  display: block;
}

.theme-dropdown-header {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  padding: 6px 8px 10px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 8px;
}

.theme-menu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.theme-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  transition: all var(--transition-smooth);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.theme-menu-item:hover {
  border-color: var(--accent-cyan);
  color: var(--text-main);
  transform: translateY(-1px);
}

.theme-menu-item.active {
  border-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.12);
  color: var(--accent-cyan);
}

.theme-color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

/* Settings Theme Studio Cards */
.theme-studio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin: 16px 0;
}

.theme-studio-card {
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: all var(--transition-smooth);
  background: var(--bg-surface-elevated);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

.theme-studio-card:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -4px var(--accent-glow);
}

.theme-studio-card.active {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 1px var(--accent-cyan), 0 8px 24px -4px var(--accent-glow);
}

.theme-preview-palette {
  display: flex;
  gap: 6px;
  height: 24px;
  border-radius: var(--radius-xs);
  overflow: hidden;
}

.theme-palette-block {
  flex: 1;
  height: 100%;
}

/* ==========================================================================
   Responsive Table Container & Scroller
   ========================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  position: relative;
}

.table-responsive::-webkit-scrollbar {
  height: 6px;
}

.table-responsive::-webkit-scrollbar-track {
  background: var(--bg-surface-elevated);
  border-radius: 3px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 3px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

/* ==========================================================================
   Responsive Grid & Task Card Layouts
   ========================================================================== */

/* Split Grid for Dashboard and Detail Views */
.grid-split {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
}

@media (max-width: 1024px) {
  .grid-split {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* Responsive Stat Grid */
@media (max-width: 768px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px;
  }
  
  .stat-card {
    padding: 14px;
  }
  
  .stat-value {
    font-size: 1.4rem;
  }
}

@media (max-width: 440px) {
  .stat-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Task Card Responsive Layout on Mobile */
@media (max-width: 768px) {
  .task-card-item {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    padding: 14px 16px !important;
  }

  .task-card-item > div:first-child {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 8px;
    width: 100%;
  }

  .task-card-item .task-badge-row {
    margin-left: 28px;
  }

  .task-card-item .task-card-actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle);
  }
}


