/* Workforce / OPERA — Components */

/* ---- Page header ---- */
.wf-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.wf-page-header h1 {
  font-size: var(--wf-font-2xl);
  font-weight: 700;
  color: var(--wf-text);
  line-height: 1.2;
}

.wf-page-header p {
  font-size: var(--wf-font-sm);
  color: var(--wf-text-muted);
  margin-top: 4px;
}

.wf-page-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* ---- Cards ---- */
.wf-card {
  background: var(--wf-surface);
  border: 1px solid var(--wf-border);
  border-radius: var(--wf-radius-md);
  box-shadow: var(--wf-shadow-sm);
  padding: 18px;
}

.wf-card + .wf-card { margin-top: 16px; }

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

.wf-card-header h3 {
  font-size: var(--wf-font-lg);
  font-weight: 600;
  color: var(--wf-text);
}

.wf-card--compact { padding: 12px; }
.wf-card--interactive { cursor: pointer; transition: box-shadow var(--wf-transition), transform var(--wf-transition); }
.wf-card--interactive:hover { box-shadow: var(--wf-shadow-md); }

/* ---- Metric cards ---- */
.wf-metric-card {
  background: var(--wf-surface);
  border: 1px solid var(--wf-border);
  border-radius: var(--wf-radius-md);
  box-shadow: var(--wf-shadow-sm);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wf-metric-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wf-metric-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--wf-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wf-metric-icon svg { width: 20px; height: 20px; }

.wf-metric-icon--blue { background: var(--wf-primary-soft); color: var(--wf-primary); }
.wf-metric-icon--green { background: var(--wf-success-soft); color: var(--wf-success); }
.wf-metric-icon--red { background: var(--wf-danger-soft); color: var(--wf-danger); }
.wf-metric-icon--yellow { background: var(--wf-warning-soft); color: var(--wf-warning); }
.wf-metric-icon--purple { background: var(--wf-purple-soft); color: var(--wf-purple); }
.wf-metric-icon--cyan { background: var(--wf-info-soft); color: var(--wf-info); }
.wf-metric-icon--gray { background: var(--wf-surface-soft); color: var(--wf-text-muted); }

.wf-metric-label { font-size: var(--wf-font-sm); color: var(--wf-text-muted); font-weight: 500; }
.wf-metric-value { font-size: 28px; font-weight: 700; color: var(--wf-text); line-height: 1.1; }
.wf-metric-sub { font-size: var(--wf-font-xs); color: var(--wf-text-soft); }

.wf-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

/* ---- Buttons ---- */
.wf-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: var(--wf-radius-sm);
  font-size: var(--wf-font-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--wf-transition);
  text-decoration: none;
  white-space: nowrap;
  font-family: inherit;
}

.wf-btn svg { width: 16px; height: 16px; }

.wf-btn-primary {
  background: var(--wf-primary);
  color: #fff;
}
.wf-btn-primary:hover { background: var(--wf-primary-hover); text-decoration: none; }

.wf-btn-secondary {
  background: var(--wf-surface);
  border-color: var(--wf-border);
  color: var(--wf-text);
}
.wf-btn-secondary:hover { background: var(--wf-surface-soft); text-decoration: none; }

.wf-btn-ghost {
  background: transparent;
  color: var(--wf-text-muted);
}
.wf-btn-ghost:hover { background: var(--wf-surface-soft); color: var(--wf-text); text-decoration: none; }

.wf-btn-danger { background: var(--wf-danger); color: #fff; }
.wf-btn-danger:hover { background: #dc2626; text-decoration: none; }

.wf-btn-success { background: var(--wf-success); color: #fff; }
.wf-btn-success:hover { background: #16a34a; text-decoration: none; }

.wf-btn-sm { padding: 5px 10px; font-size: var(--wf-font-xs); }
.wf-btn-full { width: 100%; justify-content: center; }
.wf-btn-icon-only { padding: 8px; }

.wf-btn-group { display: flex; gap: 8px; flex-wrap: wrap; }
.wf-btn-group-right { justify-content: flex-end; }
.wf-btn-group-vertical { display: flex; flex-direction: column; gap: 8px; }

.wf-person-link {
  color: var(--wf-text);
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.wf-person-link:hover { color: var(--wf-primary); text-decoration: none; }

/* ---- Pills ---- */
.wf-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: var(--wf-font-xs);
  font-weight: 600;
  white-space: nowrap;
}

.wf-pill-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

.wf-pill--green { background: var(--wf-success-soft); color: #15803d; }
.wf-pill--green .wf-pill-dot { background: var(--wf-success); }
.wf-pill--blue { background: var(--wf-primary-soft); color: #1e40af; }
.wf-pill--blue .wf-pill-dot { background: var(--wf-primary); }
.wf-pill--yellow { background: var(--wf-warning-soft); color: #b45309; }
.wf-pill--yellow .wf-pill-dot { background: var(--wf-warning); }
.wf-pill--red { background: var(--wf-danger-soft); color: #b91c1c; }
.wf-pill--red .wf-pill-dot { background: var(--wf-danger); }
.wf-pill--gray { background: var(--wf-surface-soft); color: var(--wf-text-muted); }
.wf-pill--gray .wf-pill-dot { background: var(--wf-text-soft); }
.wf-pill--purple { background: var(--wf-purple-soft); color: #6d28d9; }
.wf-pill--purple .wf-pill-dot { background: var(--wf-purple); }
.wf-pill--cyan { background: var(--wf-info-soft); color: #0e7490; }
.wf-pill--cyan .wf-pill-dot { background: var(--wf-info); }
.wf-pill--orange { background: #fff7ed; color: #c2410c; }
.wf-pill--orange .wf-pill-dot { background: #f97316; }

/* Priority pills */
.wf-priority-pill {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: var(--wf-font-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.wf-priority-pill--urgent { background: var(--wf-danger-soft); color: var(--wf-danger); }
.wf-priority-pill--high { background: #fff7ed; color: #c2410c; }
.wf-priority-pill--normal { background: var(--wf-surface-soft); color: var(--wf-text-muted); }
.wf-priority-pill--low { background: var(--wf-success-soft); color: #15803d; }

/* ---- Avatars ---- */
.wf-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50px;
  font-weight: 600;
  flex-shrink: 0;
  color: #fff;
  text-decoration: none;
  overflow: hidden;
  position: relative;
}

.wf-avatar img { width: 100%; height: 100%; object-fit: cover; }

.avatar {
  border-radius: 50px;
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 4px;
}
.avatar-initials {
  color: white;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
}
.avatar-xs { width: 20px; height: 20px; font-size: 9px; }
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-md { width: 40px; height: 40px; font-size: 14px; }
.avatar-lg { width: 64px; height: 64px; font-size: 22px; }
.avatar-xl { width: 96px; height: 96px; font-size: 32px; }

.wf-avatar--xs { width: 24px; height: 24px; font-size: 10px; }
.wf-avatar--sm { width: 32px; height: 32px; font-size: 12px; }
.wf-avatar--md { width: 40px; height: 40px; font-size: 14px; }
.wf-avatar--lg { width: 56px; height: 56px; font-size: 18px; }
.wf-avatar--xl { width: 80px; height: 80px; font-size: 26px; }

.wf-avatar-stack { display: flex; }
.wf-avatar-stack .wf-avatar { border: 2px solid var(--wf-surface); margin-left: -8px; }
.wf-avatar-stack .wf-avatar:first-child { margin-left: 0; }

.wf-avatar-link:hover { text-decoration: none; opacity: 0.85; }

/* ---- Tables ---- */
.wf-table {
  width: 100%;
  border-collapse: collapse;
}

.wf-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: var(--wf-font-xs);
  font-weight: 600;
  color: var(--wf-text-soft);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--wf-border);
}

.wf-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--wf-border-soft);
  font-size: var(--wf-font-sm);
  color: var(--wf-text);
}

.wf-table tbody tr { transition: background var(--wf-transition); }
.wf-table tbody tr:hover { background: var(--wf-surface-soft); }
.wf-table tbody tr:last-child td { border-bottom: none; }

.wf-table a { color: var(--wf-text); font-weight: 500; }
.wf-table a:hover { color: var(--wf-primary); text-decoration: none; }

.wf-table-title { font-weight: 600; color: var(--wf-text); }
.wf-table-subtitle { font-size: var(--wf-font-xs); color: var(--wf-text-soft); margin-top: 2px; }

/* ---- Collapsible list sections ---- */
.wf-list-section {
  border: 1px solid var(--wf-border);
  border-radius: var(--wf-radius-md);
  margin-bottom: 12px;
  overflow: hidden;
}

.wf-list-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  transition: background var(--wf-transition);
}

.wf-list-section-header:hover { background: var(--wf-surface-soft); }

.wf-list-section--todo .wf-list-section-header { background: var(--wf-primary-soft); }
.wf-list-section--in-progress .wf-list-section-header { background: var(--wf-warning-soft); }
.wf-list-section--completed .wf-list-section-header { background: var(--wf-success-soft); }
.wf-list-section--overdue .wf-list-section-header { background: var(--wf-danger-soft); }
.wf-list-section--backlog .wf-list-section-header { background: var(--wf-surface-soft); }

.wf-collapse-toggle {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--wf-text-muted);
  font-size: 14px;
  transition: transform var(--wf-transition);
}

.wf-list-section.is-collapsed .wf-collapse-toggle { transform: rotate(-90deg); }
.wf-list-section.is-collapsed .wf-list-section-body { display: none; }

.wf-section-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.wf-list-section--todo .wf-section-dot { background: var(--wf-primary); }
.wf-list-section--in-progress .wf-section-dot { background: var(--wf-warning); }
.wf-list-section--completed .wf-section-dot { background: var(--wf-success); }
.wf-list-section--overdue .wf-section-dot { background: var(--wf-danger); }
.wf-list-section--backlog .wf-section-dot { background: var(--wf-text-soft); }

.wf-list-section-header strong { font-size: var(--wf-font-md); font-weight: 600; }

.wf-count {
  font-size: var(--wf-font-xs);
  font-weight: 600;
  color: var(--wf-text-muted);
  background: var(--wf-surface);
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--wf-border);
}

.wf-list-section-body { padding: 4px 0; }

.wf-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--wf-border-soft);
  transition: background var(--wf-transition);
}

.wf-list-row:hover { background: var(--wf-surface-soft); }
.wf-list-row:last-child { border-bottom: none; }

.wf-list-row-title { font-weight: 600; font-size: var(--wf-font-sm); color: var(--wf-text); }
.wf-list-row-sub { font-size: var(--wf-font-xs); color: var(--wf-text-soft); margin-top: 2px; }
.wf-list-row-meta { display: flex; gap: 10px; align-items: center; margin-left: auto; flex-wrap: wrap; }

/* ---- Empty states ---- */
.wf-empty-state {
  text-align: center;
  padding: 48px 24px;
}

.wf-empty-state-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  color: var(--wf-text-soft);
  opacity: 0.5;
}

.wf-empty-state h3 {
  font-size: var(--wf-font-lg);
  font-weight: 600;
  color: var(--wf-text);
  margin-bottom: 6px;
}

.wf-empty-state p {
  font-size: var(--wf-font-sm);
  color: var(--wf-text-muted);
  margin-bottom: 16px;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

/* ---- Forms ---- */
.wf-form-group { margin-bottom: 16px; }

.wf-form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: var(--wf-font-sm);
  font-weight: 500;
  color: var(--wf-text);
}

.wf-form-group label .wf-required { color: var(--wf-danger); }

.wf-form-group input,
.wf-form-group select,
.wf-form-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--wf-border);
  border-radius: var(--wf-radius-sm);
  background: var(--wf-surface);
  color: var(--wf-text);
  font-size: var(--wf-font-md);
  font-family: inherit;
  transition: border-color var(--wf-transition), box-shadow var(--wf-transition);
}

.wf-form-group input:focus,
.wf-form-group select:focus,
.wf-form-group textarea:focus {
  outline: none;
  border-color: var(--wf-primary);
  box-shadow: 0 0 0 3px rgba(47, 128, 237, 0.12);
}

.wf-form-group textarea { resize: vertical; min-height: 80px; }

/* Checkbox toggle */
.wf-form-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--wf-primary);
  cursor: pointer;
  flex-shrink: 0;
}

.wf-checkbox-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.wf-checkbox-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }

.wf-checkbox-toggle-track {
  width: 36px;
  height: 20px;
  background: var(--wf-border);
  border-radius: 999px;
  position: relative;
  transition: background var(--wf-transition);
  flex-shrink: 0;
}

.wf-checkbox-toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--wf-transition);
  box-shadow: var(--wf-shadow-sm);
}

.wf-checkbox-toggle input:checked + .wf-checkbox-toggle-track {
  background: var(--wf-primary);
}

.wf-checkbox-toggle input:checked + .wf-checkbox-toggle-track::after {
  transform: translateX(16px);
}

.wf-checkbox-toggle-label { font-size: var(--wf-font-sm); color: var(--wf-text); }

/* Select arrow polish */
.wf-form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.wf-filter-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

.wf-form-error {
  font-size: var(--wf-font-xs);
  color: var(--wf-danger);
  margin-top: 4px;
}

.wf-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.wf-form-grid-full { grid-column: 1 / -1; }

.wf-form-section {
  background: var(--wf-surface);
  border: 1px solid var(--wf-border);
  border-radius: var(--wf-radius-md);
  box-shadow: var(--wf-shadow-sm);
  padding: 18px;
  margin-bottom: 16px;
}

.wf-form-section-header { margin-bottom: 16px; }
.wf-form-section-header h2 { font-size: var(--wf-font-lg); font-weight: 600; margin-bottom: 4px; }
.wf-form-section-header p { font-size: var(--wf-font-sm); color: var(--wf-text-muted); }

/* ---- Filters bar ---- */
.wf-filters-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 20px;
}

.wf-filter-input,
.wf-filter-select {
  padding: 7px 12px;
  border: 1px solid var(--wf-border);
  border-radius: var(--wf-radius-sm);
  background: var(--wf-surface);
  color: var(--wf-text);
  font-size: var(--wf-font-sm);
  font-family: inherit;
}

.wf-filter-input:focus,
.wf-filter-select:focus {
  outline: none;
  border-color: var(--wf-primary);
}

/* ---- Tabs ---- */
.wf-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--wf-border);
  margin-bottom: 20px;
}

.wf-tab {
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--wf-text-muted);
  font-size: var(--wf-font-sm);
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color var(--wf-transition), border-color var(--wf-transition);
  font-family: inherit;
}

.wf-tab:hover { color: var(--wf-text); }
.wf-tab.is-active { color: var(--wf-primary); border-bottom-color: var(--wf-primary); font-weight: 600; }

/* ---- Flash / Toasts ---- */
.wf-flash {
  padding: 12px 16px;
  border-radius: var(--wf-radius-sm);
  margin-bottom: 16px;
  font-size: var(--wf-font-sm);
  font-weight: 500;
}

.wf-flash--success { background: var(--wf-success-soft); color: #15803d; }
.wf-flash--error { background: var(--wf-danger-soft); color: #b91c1c; }
.wf-flash--info { background: var(--wf-info-soft); color: #0e7490; }

.wf-toast-region {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.wf-toast {
  background: var(--wf-surface);
  border: 1px solid var(--wf-border);
  border-radius: var(--wf-radius-md);
  box-shadow: var(--wf-shadow-md);
  padding: 14px 18px;
  min-width: 280px;
  max-width: 380px;
  pointer-events: auto;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  opacity: 0;
  transform: translateX(100%);
  transition: opacity 300ms ease, transform 300ms ease;
}

.wf-toast.is-visible { opacity: 1; transform: translateX(0); }

.wf-toast-icon { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; }
.wf-toast--success .wf-toast-icon { color: var(--wf-success); }
.wf-toast--error .wf-toast-icon { color: var(--wf-danger); }
.wf-toast--info .wf-toast-icon { color: var(--wf-primary); }

.wf-toast-title { font-weight: 600; font-size: var(--wf-font-sm); color: var(--wf-text); }
.wf-toast-msg { font-size: var(--wf-font-xs); color: var(--wf-text-muted); margin-top: 2px; }

/* ---- Backup toast ---- */
.wf-backup-toast {
  position: fixed;
  right: 24px;
  top: 96px;
  width: 320px;
  min-height: 86px;
  background: var(--wf-surface);
  border: 1px solid var(--wf-border);
  border-radius: 16px;
  box-shadow: var(--wf-shadow-md);
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 16px;
  z-index: 1100;
  transform: translateX(calc(100% + 40px));
  opacity: 0;
  transition: transform 360ms ease, opacity 360ms ease;
}

.wf-backup-toast.is-visible {
  transform: translateX(0);
  opacity: 1;
}

.wf-backup-spinner {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 3px solid var(--wf-border);
  border-top-color: var(--wf-primary);
  animation: wfSpin 900ms linear infinite;
  flex-shrink: 0;
}

.wf-backup-toast-title { font-weight: 600; font-size: var(--wf-font-sm); color: var(--wf-text); }
.wf-backup-toast-sub { font-size: var(--wf-font-xs); color: var(--wf-text-muted); margin-top: 2px; }

@keyframes wfSpin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .wf-backup-toast, .wf-backup-spinner { transition: none; animation: none; }
  .wf-modal.is-open, .wf-modal-content { animation: none; }
  .wf-skeleton { animation: none; }
}

/* ---- Modals ---- */
.wf-modal {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.wf-modal.is-open { display: flex; animation: wfModalFadeIn 200ms ease; }

@keyframes wfModalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.wf-modal-content {
  background: var(--wf-surface);
  border: 1px solid var(--wf-border);
  border-radius: var(--wf-radius-md);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--wf-shadow-lg);
  animation: wfModalSlideUp 240ms ease;
}

@keyframes wfModalSlideUp {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

.wf-modal-header h3 { font-size: var(--wf-font-lg); font-weight: 600; }

.wf-modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--wf-text-muted);
  font-size: 20px;
  cursor: pointer;
  border-radius: var(--wf-radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
}
.wf-modal-close:hover { background: var(--wf-surface-soft); color: var(--wf-text); }

.wf-modal-body { padding: 22px; }

.wf-modal-footer {
  padding: 16px 22px;
  border-top: 1px solid var(--wf-border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ---- Drawer ---- */
.wf-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 480px;
  max-width: 100%;
  background: var(--wf-surface);
  border-left: 1px solid var(--wf-border);
  box-shadow: var(--wf-shadow-lg);
  z-index: 1000;
  transform: translateX(100%);
  transition: transform 300ms ease;
  display: flex;
  flex-direction: column;
}

.wf-drawer.is-open { transform: translateX(0); }

.wf-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.3);
  z-index: 999;
  display: none;
}
.wf-drawer-overlay.is-visible { display: block; }

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

.wf-drawer-body { flex: 1; overflow-y: auto; padding: 22px; }
.wf-drawer-footer { padding: 16px 22px; border-top: 1px solid var(--wf-border); display: flex; gap: 8px; justify-content: flex-end; }

@media (max-width: 640px) {
  .wf-drawer { width: 100%; }
}

/* ---- Activity timeline ---- */
.wf-activity-timeline { display: flex; flex-direction: column; gap: 0; }

.wf-activity-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--wf-border-soft);
}
.wf-activity-item:last-child { border-bottom: none; }

.wf-activity-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}

.wf-activity-content { flex: 1; min-width: 0; }
.wf-activity-title { font-size: var(--wf-font-sm); font-weight: 500; color: var(--wf-text); }
.wf-activity-time { font-size: var(--wf-font-xs); color: var(--wf-text-soft); margin-top: 2px; }

/* ---- Text helpers ---- */
.wf-text-muted { color: var(--wf-text-muted); }
.wf-text-soft { color: var(--wf-text-soft); }
.wf-text-danger { color: var(--wf-danger); }
.wf-text-success { color: var(--wf-success); }
.wf-text-sm { font-size: var(--wf-font-sm); }
.wf-text-xs { font-size: var(--wf-font-xs); }
.wf-text-center { text-align: center; }
.wf-mt-2 { margin-top: 8px; }
.wf-mt-3 { margin-top: 16px; }
.wf-mt-4 { margin-top: 24px; }
.wf-mb-3 { margin-bottom: 16px; }
.wf-mono { font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace; font-size: 12px; }

/* ---- Grid helpers ---- */
.wf-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.wf-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.wf-grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }

@media (max-width: 768px) {
  .wf-grid-2, .wf-grid-3, .wf-form-grid { grid-template-columns: 1fr; }
  .wf-metric-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .wf-metric-grid { grid-template-columns: 1fr; }
  .wf-filters-bar { flex-direction: column; align-items: stretch; }
  .wf-filter-input, .wf-filter-select { width: 100%; }
}

/* ---- Loading skeleton ---- */
.wf-skeleton {
  background: linear-gradient(90deg, var(--wf-surface-soft) 25%, var(--wf-border-soft) 50%, var(--wf-surface-soft) 75%);
  background-size: 200% 100%;
  animation: wfShimmer 1.5s infinite;
  border-radius: var(--wf-radius-xs);
}

@keyframes wfShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .wf-skeleton { animation: none; }
}

/* ---- Breadcrumbs ---- */
.wf-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--wf-font-xs);
  color: var(--wf-text-soft);
  margin-bottom: 12px;
}

.wf-breadcrumbs a { color: var(--wf-text-muted); text-decoration: none; }
.wf-breadcrumbs a:hover { color: var(--wf-primary); }
.wf-breadcrumbs span { color: var(--wf-text-soft); }

/* ---- Daily progress strip 3.0 (Concepto A) ---- */
.daily-progress-strip {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  background: var(--wf-surface);
  border-top: 1px solid var(--wf-border);
  box-shadow: 0 -4px 12px rgba(16, 24, 40, 0.06);
  padding: 8px 16px;
  min-height: 56px;
  max-height: 72px;
  overflow: hidden;
  transition: max-height 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.daily-progress-strip.is-expanded {
  max-height: 480px;
  overflow-y: auto;
}
