/* ============================================================
   Workspace — Espacio de Trabajo Styles
   All classes prefixed with ws- to avoid collision
   Uses existing CSS variables from style.css
   ============================================================ */

/* ── Icon helpers ────────────────────────────────────────────── */
.ws-icon { width: 16px; height: 16px; vertical-align: middle; }
.ws-icon-sm { width: 14px; height: 14px; vertical-align: middle; }
.ws-icon-lg { width: 20px; height: 20px; vertical-align: middle; }

/* ── Layout ──────────────────────────────────────────────────── */
.ws-container {
  display: flex;
  height: calc(100vh - var(--topbar-h));
  overflow: hidden;
}

.ws-sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.ws-main {
  flex: 1;
  overflow-y: auto;
  background: var(--bg-base);
  display: flex;
  flex-direction: column;
}

.ws-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  min-height: 48px;
  flex-shrink: 0;
}

.ws-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.ws-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ws-content {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

/* ── Project Selector (sidebar) ──────────────────────────────── */
.ws-project-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.ws-project-selector {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  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='%2378716c' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

.ws-project-selector:focus {
  border-color: var(--accent-orange);
  outline: none;
  box-shadow: 0 0 0 3px rgba(249,115,22,.15);
}

.ws-project-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

/* ── Sidebar Nav ─────────────────────────────────────────────── */
.ws-nav-section {
  padding: 8px 0;
}

.ws-nav-label {
  padding: 6px 16px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  font-weight: 600;
}

.ws-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: background .15s, color .15s;
  border-left: 3px solid transparent;
}

.ws-nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.ws-nav-item.active {
  background: var(--bg-active);
  color: var(--accent-orange);
  border-left-color: var(--accent-orange);
  font-weight: 600;
}

.ws-nav-icon {
  font-size: 15px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.ws-nav-badge {
  margin-left: auto;
  background: var(--accent-orange);
  color: var(--text-inverse);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* ── List Items (sidebar) ────────────────────────────────────── */
.ws-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px 6px 28px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: background .15s;
}

.ws-list-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.ws-list-item.active {
  color: var(--accent-orange);
  font-weight: 600;
}

.ws-list-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.ws-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
}

.ws-btn:hover {
  background: var(--bg-hover);
  border-color: var(--text-muted);
}

.ws-btn-primary {
  background: var(--accent-orange);
  color: var(--text-inverse);
  border-color: var(--accent-orange);
}

.ws-btn-primary:hover {
  background: var(--accent-warm);
  border-color: var(--accent-warm);
}

.ws-btn-sm {
  padding: 4px 10px;
  font-size: 11px;
}

.ws-btn-ghost {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 4px 8px;
}

.ws-btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.ws-btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  transition: background .15s, color .15s;
}

.ws-btn-icon:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.ws-btn-danger {
  color: var(--accent-red);
  border-color: var(--accent-red);
}

.ws-btn-danger:hover {
  background: rgba(239,68,68,.15);
}

/* ── View Tabs ───────────────────────────────────────────────── */
.ws-view-tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  padding: 3px;
}

.ws-view-tab {
  padding: 5px 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.ws-view-tab:hover {
  color: var(--text-primary);
}

.ws-view-tab.active {
  background: var(--bg-surface);
  color: var(--accent-orange);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* ── Empty States ────────────────────────────────────────────── */
.ws-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  gap: 12px;
}

.ws-empty-icon {
  font-size: 48px;
  opacity: .4;
}

.ws-empty-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.ws-empty-text {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 360px;
}

/* ── Kanban Board ────────────────────────────────────────────── */
.ws-kanban-board {
  display: flex;
  gap: 16px;
  padding: 20px;
  overflow-x: auto;
  min-height: calc(100vh - var(--topbar-h) - 96px);
  align-items: flex-start;
}

.ws-kanban-column {
  min-width: 280px;
  max-width: 320px;
  width: 280px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--topbar-h) - 136px);
  flex-shrink: 0;
}

.ws-kanban-column-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.ws-kanban-column-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ws-kanban-column-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.ws-kanban-column-count {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 1px 7px;
  border-radius: 10px;
  font-weight: 600;
}

.ws-kanban-cards {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 60px;
}

.ws-kanban-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .1s;
}

.ws-kanban-card:hover {
  border-color: var(--accent-orange);
  box-shadow: 0 2px 8px rgba(249,115,22,.12);
}

.ws-kanban-card.sortable-ghost {
  opacity: .4;
  transform: scale(.98);
}

.ws-kanban-card.sortable-drag {
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  transform: rotate(2deg);
}

.ws-kanban-card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.4;
}

.ws-kanban-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ws-kanban-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  margin: 4px 8px 8px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: border-color .15s, color .15s;
  width: calc(100% - 16px);
}

.ws-kanban-add-btn:hover {
  border-color: var(--accent-orange);
  color: var(--accent-orange);
}

/* ── Task List View ──────────────────────────────────────────── */
.ws-task-list {
  display: flex;
  flex-direction: column;
}

.ws-task-list-header {
  display: grid;
  grid-template-columns: 1fr 120px 100px 100px 120px 32px;
  gap: 8px;
  padding: 8px 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}

.ws-task-row {
  display: grid;
  grid-template-columns: 1fr 120px 100px 100px 120px 32px;
  gap: 8px;
  padding: 10px 16px;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background .1s;
}

.ws-task-row:hover {
  background: var(--bg-hover);
}

.ws-task-title-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ws-task-checkbox {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 2px solid var(--border);
  flex-shrink: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s, background .15s;
}

.ws-task-checkbox:hover {
  border-color: var(--accent-orange);
}

.ws-task-checkbox.checked {
  background: var(--accent-green);
  border-color: var(--accent-green);
}

.ws-task-checkbox.checked::after {
  content: '✓';
  color: white;
  font-size: 10px;
  font-weight: 700;
}

.ws-task-title-text {
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ws-task-row.completed .ws-task-title-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* ── Priority Badge ──────────────────────────────────────────── */
.ws-priority-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.ws-priority-urgent {
  background: rgba(239,68,68,.15);
  color: #ef4444;
}

.ws-priority-high {
  background: rgba(249,115,22,.15);
  color: #f97316;
}

.ws-priority-normal {
  background: rgba(56,189,248,.1);
  color: #38bdf8;
}

.ws-priority-low {
  background: rgba(107,114,128,.15);
  color: #9ca3af;
}

/* ── Status Badge ────────────────────────────────────────────── */
.ws-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-elevated);
}

.ws-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

/* ── Tag Pill ────────────────────────────────────────────────── */
.ws-tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .3px;
}

/* ── Assignee Avatars ────────────────────────────────────────── */
.ws-assignees {
  display: flex;
  align-items: center;
}

.ws-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-purple);
  color: white;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-surface);
  margin-left: -6px;
  text-transform: uppercase;
}

.ws-avatar:first-child {
  margin-left: 0;
}

.ws-avatar-sm {
  width: 20px;
  height: 20px;
  font-size: 8px;
}

.ws-avatar-more {
  background: var(--bg-active);
  color: var(--text-muted);
}

/* ── Due Date ────────────────────────────────────────────────── */
.ws-due-date {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.ws-due-date.overdue {
  color: var(--accent-red);
}

.ws-due-date.due-soon {
  color: var(--accent-gold);
}

/* ── Task Detail Modal ───────────────────────────────────────── */
.ws-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: ws-fadeIn .15s ease-out;
}

.ws-modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 720px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: ws-slideUp .2s var(--ease-out);
}

.ws-modal-sm {
  max-width: 440px;
}

.ws-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.ws-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.ws-modal-body {
  padding: 20px 24px;
}

.ws-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@keyframes ws-fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes ws-slideUp {
  from { opacity: 0; transform: translateY(20px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Task Detail Layout ──────────────────────────────────────── */
.ws-task-detail {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 20px;
}

.ws-task-detail-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ws-task-detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-left: 20px;
  border-left: 1px solid var(--border);
}

.ws-detail-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ws-detail-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text-muted);
  font-weight: 600;
}

.ws-detail-value {
  font-size: 13px;
  color: var(--text-primary);
}

/* ── Form Fields ─────────────────────────────────────────────── */
.ws-input {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 13px;
  transition: border-color .15s;
}

.ws-input:focus {
  border-color: var(--accent-orange);
  outline: none;
  box-shadow: 0 0 0 3px rgba(249,115,22,.15);
}

.ws-textarea {
  width: 100%;
  min-height: 80px;
  padding: 8px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 13px;
  resize: vertical;
}

.ws-textarea:focus {
  border-color: var(--accent-orange);
  outline: none;
}

.ws-select {
  padding: 8px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 13px;
}

.ws-select:focus {
  border-color: var(--accent-orange);
  outline: none;
}

.ws-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.ws-form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ── Comments Section ────────────────────────────────────────── */
.ws-comments {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ws-comment {
  display: flex;
  gap: 10px;
}

.ws-comment-body {
  flex: 1;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  padding: 10px 14px;
}

.ws-comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.ws-comment-user {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.ws-comment-time {
  font-size: 11px;
  color: var(--text-muted);
}

.ws-comment-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.ws-comment-input-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

/* ── Activity Log ────────────────────────────────────────────── */
.ws-activity {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ws-activity-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 0;
}

.ws-activity-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  margin-top: 5px;
  flex-shrink: 0;
}

.ws-activity-user {
  font-weight: 600;
  color: var(--text-secondary);
}

/* ── Tabs (inside task detail) ───────────────────────────────── */
.ws-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}

.ws-tab {
  padding: 8px 16px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
  margin-bottom: -1px;
}

.ws-tab:hover {
  color: var(--text-primary);
}

.ws-tab.active {
  color: var(--accent-orange);
  border-bottom-color: var(--accent-orange);
  font-weight: 600;
}

/* ── Calendar View ───────────────────────────────────────────── */
.ws-calendar {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 20px;
}

.ws-calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.ws-calendar-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.ws-calendar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ws-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.ws-calendar-day-header {
  padding: 8px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  background: var(--bg-surface);
}

.ws-calendar-cell {
  min-height: 100px;
  background: var(--bg-surface);
  padding: 6px;
  cursor: pointer;
  transition: background .1s;
}

.ws-calendar-cell:hover {
  background: var(--bg-hover);
}

.ws-calendar-cell.other-month {
  opacity: .35;
}

.ws-calendar-cell.today {
  background: rgba(249,115,22,.08);
}

.ws-calendar-date {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.ws-calendar-cell.today .ws-calendar-date {
  color: var(--accent-orange);
}

.ws-calendar-task {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 2px;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.ws-calendar-task:hover {
  opacity: .85;
}

.ws-calendar-more {
  font-size: 10px;
  color: var(--text-muted);
  padding: 2px 6px;
  cursor: pointer;
}

.ws-calendar-more:hover {
  color: var(--accent-orange);
}

/* ── Filters Bar ─────────────────────────────────────────────── */
.ws-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.ws-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color .15s;
}

.ws-filter-chip:hover {
  border-color: var(--accent-orange);
}

.ws-filter-chip.active {
  background: rgba(249,115,22,.15);
  border-color: var(--accent-orange);
  color: var(--accent-orange);
}

.ws-filter-chip-remove {
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  margin-left: 2px;
}

.ws-filter-chip-remove:hover {
  color: var(--accent-red);
}

.ws-search-input {
  padding: 5px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-primary);
  font-size: 12px;
  width: 200px;
}

.ws-search-input:focus {
  border-color: var(--accent-orange);
  outline: none;
}

/* ── Share Modal ─────────────────────────────────────────────── */
.ws-share-modal .ws-user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
}

.ws-share-modal .ws-user-row:last-child {
  border-bottom: none;
}

.ws-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: var(--bg-elevated);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-primary);
}

.ws-user-chip-remove {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 14px;
}

.ws-user-chip-remove:hover {
  color: var(--accent-red);
}

/* ── Presence Bar ────────────────────────────────────────────── */
.ws-presence-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
}

.ws-presence-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  animation: ws-pulse 2s infinite;
}

@keyframes ws-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}

.ws-presence-user {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Subtask Indicator ───────────────────────────────────────── */
.ws-subtask-count {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--text-muted);
}

.ws-subtask-bar {
  width: 40px;
  height: 4px;
  background: var(--bg-active);
  border-radius: 2px;
  overflow: hidden;
}

.ws-subtask-bar-fill {
  height: 100%;
  background: var(--accent-green);
  border-radius: 2px;
  transition: width .3s;
}

/* ── Attachments ─────────────────────────────────────────────── */
.ws-attachments {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ws-attachment {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-secondary);
}

.ws-attachment-icon {
  font-size: 16px;
}

.ws-attachment-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ws-attachment-size {
  font-size: 10px;
  color: var(--text-muted);
}

/* ── Project Creation Modal ──────────────────────────────────── */
.ws-color-picker {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ws-color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color .15s, transform .1s;
}

.ws-color-swatch:hover {
  transform: scale(1.15);
}

.ws-color-swatch.selected {
  border-color: var(--text-primary);
  box-shadow: 0 0 0 2px var(--bg-surface), 0 0 0 4px currentColor;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .ws-task-detail {
    grid-template-columns: 1fr;
  }
  .ws-task-detail-sidebar {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--border);
    padding-top: 14px;
  }
}

/* Old mobile rules removed — handled by comprehensive section at bottom */

/* ════════════════════════════════════════════════════════════════
   Documentos — Document Tree, Editor, Quill Dark Theme
   ════════════════════════════════════════════════════════════════ */

/* ── Document Layout ─────────────────────────────────────────── */
.ws-doc-container {
  height: calc(100vh - var(--topbar-h));
}

.ws-doc-tree-sidebar {
  width: 280px;
  min-width: 280px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ws-doc-tree-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.ws-doc-tree-search {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
}

.ws-doc-tree {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

.ws-doc-editor-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-base);
}

/* ── Document Tree Items ─────────────────────────────────────── */
.ws-doc-tree-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  cursor: pointer;
  transition: background .1s;
  position: relative;
}

.ws-doc-tree-item:hover {
  background: var(--bg-hover);
}

.ws-doc-tree-item.active {
  background: var(--bg-active);
}

.ws-doc-tree-item.active .ws-doc-tree-name {
  color: var(--accent-orange);
  font-weight: 600;
}

.ws-doc-tree-toggle {
  width: 16px;
  font-size: 10px;
  color: var(--text-muted);
  cursor: pointer;
  text-align: center;
  flex-shrink: 0;
  user-select: none;
}

.ws-doc-tree-toggle:hover {
  color: var(--text-primary);
}

.ws-doc-tree-spacer {
  width: 16px;
  flex-shrink: 0;
}

.ws-doc-tree-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.ws-doc-tree-name {
  font-size: 13px;
  color: var(--text-secondary);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.ws-doc-tree-actions {
  display: none;
  gap: 2px;
  margin-left: auto;
  flex-shrink: 0;
}

.ws-doc-tree-item:hover .ws-doc-tree-actions {
  display: flex;
}

/* ── Document Editor Toolbar ─────────────────────────────────── */
.ws-doc-toolbar-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.ws-doc-title-input {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 4px 0;
  outline: none;
  min-width: 200px;
  flex: 1;
  transition: border-color .15s;
}

.ws-doc-title-input:focus {
  border-bottom-color: var(--accent-orange);
}

/* ── Document Preview (version history) ──────────────────────── */
.ws-doc-preview {
  min-height: 200px;
  max-height: 400px;
  overflow-y: auto;
}

/* ── Remote Cursor ───────────────────────────────────────────── */
.ws-doc-remote-cursor {
  position: absolute;
  width: 2px;
  border-left: 2px solid;
  pointer-events: none;
  z-index: 10;
  transition: left .1s, top .1s;
}

.ws-doc-remote-cursor-label {
  position: absolute;
  top: -18px;
  left: -1px;
  font-size: 10px;
  color: white;
  padding: 1px 6px;
  border-radius: 3px;
  white-space: nowrap;
  font-weight: 600;
}

/* ══════════════════════════════════════════════════════════════
   Quill.js — Dark Theme Overrides
   ══════════════════════════════════════════════════════════════ */

#ws-quill-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#ws-quill-container .ql-toolbar.ql-snow {
  background: var(--bg-surface);
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 8px 12px;
}

#ws-quill-container .ql-container.ql-snow {
  border: none;
  flex: 1;
  overflow-y: auto;
  font-family: var(--font-ui);
  font-size: 14px;
}

#ws-quill-container .ql-editor {
  background: var(--bg-base);
  color: var(--text-primary);
  padding: 24px 40px;
  min-height: 300px;
  line-height: 1.7;
}

#ws-quill-container .ql-editor.ql-blank::before {
  color: var(--text-muted);
  font-style: italic;
}

/* Toolbar button colors */
#ws-quill-container .ql-snow .ql-stroke {
  stroke: var(--text-secondary);
}

#ws-quill-container .ql-snow .ql-fill {
  fill: var(--text-secondary);
}

#ws-quill-container .ql-snow .ql-picker-label {
  color: var(--text-secondary);
}

#ws-quill-container .ql-snow .ql-picker-options {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

#ws-quill-container .ql-snow .ql-picker-item {
  color: var(--text-primary);
}

#ws-quill-container .ql-snow .ql-picker-item:hover {
  color: var(--accent-orange);
}

#ws-quill-container .ql-snow button:hover .ql-stroke,
#ws-quill-container .ql-snow .ql-picker-label:hover .ql-stroke {
  stroke: var(--accent-orange);
}

#ws-quill-container .ql-snow button:hover .ql-fill,
#ws-quill-container .ql-snow .ql-picker-label:hover .ql-fill {
  fill: var(--accent-orange);
}

#ws-quill-container .ql-snow button.ql-active .ql-stroke {
  stroke: var(--accent-orange);
}

#ws-quill-container .ql-snow button.ql-active .ql-fill {
  fill: var(--accent-orange);
}

#ws-quill-container .ql-snow .ql-active .ql-picker-label {
  color: var(--accent-orange);
}

#ws-quill-container .ql-snow .ql-active .ql-picker-label .ql-stroke {
  stroke: var(--accent-orange);
}

/* Tooltip */
#ws-quill-container .ql-snow .ql-tooltip {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  box-shadow: var(--shadow);
}

#ws-quill-container .ql-snow .ql-tooltip input[type="text"] {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
}

#ws-quill-container .ql-snow .ql-tooltip a.ql-action,
#ws-quill-container .ql-snow .ql-tooltip a.ql-remove {
  color: var(--accent-orange);
}

/* Editor content styles */
#ws-quill-container .ql-editor h1 {
  color: var(--text-primary);
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 12px;
}

#ws-quill-container .ql-editor h2 {
  color: var(--text-primary);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 10px;
}

#ws-quill-container .ql-editor h3 {
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

#ws-quill-container .ql-editor blockquote {
  border-left: 4px solid var(--accent-orange);
  padding-left: 16px;
  color: var(--text-secondary);
  margin: 12px 0;
}

#ws-quill-container .ql-editor pre.ql-syntax {
  background: var(--bg-elevated);
  color: var(--accent-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 13px;
  overflow-x: auto;
}

#ws-quill-container .ql-editor code {
  background: var(--bg-elevated);
  color: var(--accent-warm);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 13px;
}

#ws-quill-container .ql-editor a {
  color: var(--accent-orange);
  text-decoration: underline;
}

#ws-quill-container .ql-editor img {
  max-width: 100%;
  border-radius: var(--radius);
  margin: 8px 0;
}

#ws-quill-container .ql-editor ul,
#ws-quill-container .ql-editor ol {
  padding-left: 24px;
}

#ws-quill-container .ql-editor li {
  margin-bottom: 4px;
}

/* Version preview quill */
.ws-doc-preview .ql-toolbar {
  display: none;
}

.ws-doc-preview .ql-container.ql-snow {
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.ws-doc-preview .ql-editor {
  background: var(--bg-elevated);
  color: var(--text-primary);
  padding: 16px;
  min-height: 100px;
  font-size: 13px;
}

/* Old Documentos responsive removed — handled by comprehensive section at bottom */

/* ================================================================
   PIZARRA (Whiteboard) — Phase 4
   ================================================================ */

/* ── Layout ─────────────────────────────────────────────────────── */
.ws-pizarra-container {
  display: flex;
  height: calc(100vh - 60px);
  overflow: hidden;
}

.ws-pizarra-sidebar {
  width: 240px;
  min-width: 200px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ws-pizarra-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.ws-pizarra-editor-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg-base);
}

/* ── Board List ─────────────────────────────────────────────────── */
.ws-board-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
}

.ws-board-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.15s;
}

.ws-board-list-item:hover {
  background: var(--bg-elevated);
}

.ws-board-list-item.active {
  background: rgba(249, 115, 22, 0.1);
  border-left: 3px solid var(--accent-orange);
  padding-left: 11px;
}

.ws-board-list-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.ws-board-list-name {
  flex: 1;
  font-size: 13px;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ws-board-list-actions {
  display: none;
  gap: 2px;
}

.ws-board-list-item:hover .ws-board-list-actions {
  display: flex;
}

/* ── Toolbar ────────────────────────────────────────────────────── */
.ws-pizarra-toolbar-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  flex-wrap: wrap;
  min-height: 44px;
  position: relative;
  z-index: 10;
}

.ws-pizarra-tools {
  display: flex;
  align-items: center;
  gap: 2px;
}

.ws-pizarra-tool {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 15px;
  transition: all 0.15s;
}

.ws-pizarra-tool:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border);
}

.ws-pizarra-tool.active {
  background: rgba(249, 115, 22, 0.15);
  color: var(--accent-orange);
  border-color: var(--accent-orange);
}

.ws-pizarra-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 4px;
}

/* ── Shapes Dropdown ───────────────────────────────────────────── */
.ws-pizarra-dropdown-wrap {
  position: relative;
}

.ws-pizarra-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  min-width: 170px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 100;
  padding: 4px;
}

.ws-pizarra-dropdown.open {
  display: flex;
  flex-direction: column;
}

.ws-pizarra-dropdown button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  border-radius: calc(var(--radius) - 2px);
  white-space: nowrap;
  transition: background 0.12s;
}

.ws-pizarra-dropdown button:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.ws-pizarra-dropdown-sep {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.ws-pizarra-dropdown-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 6px 10px 2px;
}

/* ── Diagram Template Grid ─────────────────────────────────────── */
.ws-diagram-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.ws-diagram-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text-secondary);
  font-family: inherit;
  text-align: center;
}

.ws-diagram-card:hover {
  border-color: var(--accent-orange);
  background: rgba(249, 115, 22, 0.06);
}

.ws-diagram-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.ws-diagram-card-desc {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.3;
}

/* ── Canvas Wrapper ─────────────────────────────────────────────── */
.ws-pizarra-canvas-wrapper {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #1a1614;
}

.ws-pizarra-canvas-wrapper canvas {
  display: block;
}

/* ── Remote Cursors ─────────────────────────────────────────────── */
.ws-pizarra-remote-cursor {
  position: absolute;
  pointer-events: none;
  z-index: 1000;
  display: none;
  transition: left 0.1s, top 0.1s;
}

.ws-pizarra-remote-cursor::before {
  content: '';
  display: block;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 10px solid currentColor;
  transform: rotate(-30deg);
}

.ws-pizarra-cursor-label {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  color: #fff;
  white-space: nowrap;
  margin-left: 8px;
  margin-top: -2px;
}

/* Old Pizarra responsive removed — handled by comprehensive section at bottom */

/* ================================================================
   PROJECT LIST + DETAIL + TABS — Refactored Architecture
   ================================================================ */

/* ── Project List Page ──────────────────────────────────────── */
.ws-projects-page {
  padding: 24px;
  max-width: 1200px;
  overflow-y: auto;
  height: 100%;
}

.ws-projects-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.ws-projects-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.ws-projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.ws-project-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}

.ws-project-card:hover {
  border-color: var(--accent-orange);
  box-shadow: 0 0 0 3px rgba(249,115,22,.1);
}

.ws-project-card-color {
  height: 6px;
  width: 100%;
}

.ws-project-card-body {
  padding: 16px;
}

.ws-project-card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.ws-project-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ws-project-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ws-project-card-role {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-orange);
  background: rgba(249,115,22,.1);
  padding: 2px 8px;
  border-radius: 4px;
}

/* ── Project Detail ─────────────────────────────────────────── */
.ws-project-detail {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 60px);
  overflow: hidden;
}

.ws-project-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.ws-project-detail-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ws-project-detail-info {
  flex: 1;
  min-width: 0;
}

.ws-project-detail-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ws-project-detail-desc {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Project Tabs ───────────────────────────────────────────── */
.ws-project-tabs {
  display: flex;
  gap: 0;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  flex-shrink: 0;
  overflow-x: auto;
}

.ws-project-tab {
  padding: 10px 20px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
  margin-bottom: -1px;
  white-space: nowrap;
}

.ws-project-tab:hover {
  color: var(--text-primary);
}

.ws-project-tab.active {
  color: var(--accent-orange);
  border-bottom-color: var(--accent-orange);
  font-weight: 600;
}

/* ── Tab Content Area ───────────────────────────────────────── */
.ws-project-tab-content {
  flex: 1;
  overflow: hidden;
}

.ws-project-tab-content .ws-container {
  height: 100%;
}

.ws-project-tab-content .ws-pizarra-container {
  height: 100%;
}

.ws-project-tab-content .ws-doc-container {
  height: 100%;
}

/* ── Miembros Tab ───────────────────────────────────────────── */
.ws-miembros-page {
  padding: 24px;
  max-width: 900px;
  overflow-y: auto;
  height: 100%;
}

.ws-miembros-header {
  margin-bottom: 20px;
}

.ws-miembros-add {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.ws-miembros-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
}
.ws-miembros-list .ws-user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}

/* ── Task Check (checkmark icon) ───────────────────────────── */
.ws-task-check {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 4px;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: transparent;
  transition: all .15s;
  margin-right: 8px;
}

.ws-task-check:hover {
  border-color: var(--accent-orange);
  color: var(--accent-orange);
}

.ws-task-check.checked {
  background: var(--accent-green, #22c55e);
  border-color: var(--accent-green, #22c55e);
  color: #fff;
}

/* ── Inline Editable Fields (list view) ────────────────────── */
.ws-inline-select {
  background: var(--bg-surface);
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 12px;
  padding: 3px 6px;
  cursor: pointer;
  transition: border-color .15s;
  max-width: 130px;
}

.ws-inline-select:hover,
.ws-inline-select:focus {
  border-color: var(--border);
  outline: none;
}

.ws-inline-date {
  background: var(--bg-surface);
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 12px;
  padding: 3px 6px;
  cursor: pointer;
  transition: border-color .15s;
  max-width: 140px;
}

.ws-inline-date:hover,
.ws-inline-date:focus {
  border-color: var(--border);
  outline: none;
}

/* Priority colors on inline select */
.ws-inline-select.ws-priority-urgent { color: var(--accent-red); }
.ws-inline-select.ws-priority-high { color: var(--accent-orange); }
.ws-inline-select.ws-priority-normal { color: var(--accent-blue); }
.ws-inline-select.ws-priority-low { color: var(--text-muted); }

/* ── List Item Row (edit/delete actions) ────────────────────── */
.ws-list-item-row {
  display: flex;
  align-items: center;
  gap: 2px;
}

.ws-list-item-row .ws-list-item {
  flex: 1;
}

.ws-list-item-row .ws-list-action {
  opacity: 0;
  transition: opacity .15s;
}

.ws-list-item-row:hover .ws-list-action {
  opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE — COMPREHENSIVE OVERHAUL
   ═══════════════════════════════════════════════════════════════ */

/* ── Mobile sidebar toggle button ────────────────────────────── */
.ws-mobile-sidebar-toggle {
  display: none;
}

/* ── Mobile sidebar overlay ──────────────────────────────────── */
.ws-mobile-sidebar-overlay {
  display: none;
}

@media (max-width: 768px) {

  /* ── Base layout: stack everything ────────────────────────── */
  .ws-container {
    height: auto;
    min-height: calc(100vh - var(--topbar-h) - 100px);
    overflow: visible;
  }

  /* ── Sidebar → hidden drawer ─────────────────────────────── */
  .ws-sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 260px;
    min-width: 260px;
    height: 100vh;
    z-index: 200;
    transition: left .25s ease;
    box-shadow: none;
  }
  .ws-sidebar.mobile-open {
    left: 0;
    box-shadow: 4px 0 24px rgba(0,0,0,.5);
  }

  /* Overlay behind open sidebar */
  .ws-mobile-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 199;
  }
  .ws-mobile-sidebar-overlay.visible {
    display: block;
  }

  /* Toggle button — visible on mobile */
  .ws-mobile-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
  }
  .ws-mobile-sidebar-toggle:active {
    background: var(--bg-active);
  }

  /* ── ws-main fills full width ────────────────────────────── */
  .ws-main {
    flex: 1;
    width: 100%;
    min-height: 0;
  }

  /* ── Project list page ───────────────────────────────────── */
  .ws-projects-page {
    padding: 12px;
  }
  .ws-projects-header {
    flex-wrap: wrap;
    gap: 10px;
  }
  .ws-projects-grid {
    grid-template-columns: 1fr;
  }

  /* ── Project detail header ───────────────────────────────── */
  .ws-project-detail-header {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
  }
  .ws-project-detail-name {
    font-size: 16px;
  }
  .ws-project-detail-desc {
    font-size: 11px;
  }

  /* ── Project tabs — horizontal scroll ────────────────────── */
  .ws-project-tabs {
    padding: 0 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    gap: 2px;
  }
  .ws-project-tabs::-webkit-scrollbar {
    display: none;
  }
  .ws-project-tab {
    padding: 8px 10px;
    font-size: 11px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* ── Toolbar ─────────────────────────────────────────────── */
  .ws-toolbar {
    padding: 8px 10px;
    gap: 6px;
    flex-wrap: wrap;
    min-height: 40px;
  }
  .ws-toolbar-left {
    gap: 6px;
    flex-wrap: wrap;
  }

  /* ── View tabs — compact on mobile ───────────────────────── */
  .ws-view-tabs {
    gap: 2px;
  }
  .ws-view-tab {
    padding: 4px 8px;
    font-size: 11px;
  }

  /* ── Content area ────────────────────────────────────────── */
  .ws-content {
    padding: 10px;
  }

  /* ── Filters bar — wrap on mobile ────────────────────────── */
  .ws-filters {
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px;
  }
  .ws-search-input {
    width: 100%;
    font-size: 14px;
    min-height: 40px;
  }
  .ws-filters .ws-select {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    min-height: 36px;
  }

  /* ── Task list — card-style rows ─────────────────────────── */
  .ws-task-list-header {
    display: none;
  }
  .ws-task-list {
    gap: 6px;
    padding: 6px;
  }
  .ws-task-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px;
    border-radius: var(--radius);
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    grid-template-columns: unset;
  }
  .ws-task-title-cell {
    width: 100%;
    flex-basis: 100%;
  }
  .ws-task-row > div:nth-child(n+2) {
    display: flex;
    flex-shrink: 0;
  }
  .ws-task-row > div:nth-child(2),
  .ws-task-row > div:nth-child(3) {
    flex: 0 0 auto;
  }
  .ws-task-row > div:nth-child(5) {
    margin-left: auto;
  }
  .ws-inline-select {
    font-size: 12px;
    padding: 4px 6px;
    min-height: 28px;
  }
  .ws-inline-date {
    font-size: 12px;
    padding: 4px 6px;
    min-height: 28px;
  }

  /* ── Kanban board — full-width single column scroll ──────── */
  .ws-kanban-board {
    padding: 8px;
    gap: 10px;
  }
  .ws-kanban-column {
    min-width: calc(100vw - 50px);
    width: calc(100vw - 50px);
    flex-shrink: 0;
  }
  .ws-kanban-card {
    padding: 10px;
  }
  .ws-kanban-card-title {
    font-size: 13px;
  }
  .ws-kanban-add-btn {
    padding: 10px;
    font-size: 13px;
    min-height: 40px;
  }

  /* ── Calendar view ───────────────────────────────────────── */
  .ws-calendar {
    padding: 8px;
  }
  .ws-calendar-header {
    padding: 8px;
  }
  .ws-calendar-grid {
    gap: 1px;
  }
  .ws-calendar-day-header {
    font-size: 9px;
    padding: 4px 2px;
  }
  .ws-calendar-cell {
    min-height: 50px;
    padding: 2px;
  }
  .ws-calendar-date {
    font-size: 10px;
  }
  .ws-calendar-task {
    font-size: 8px;
    padding: 1px 3px;
  }
  .ws-calendar-more {
    font-size: 8px;
  }

  /* ── Modals — full width on mobile ───────────────────────── */
  .ws-modal {
    width: 96% !important;
    max-width: 96% !important;
    max-height: 92vh;
    margin: 4vh 2%;
  }
  .ws-modal-sm {
    width: 96% !important;
    max-width: 96% !important;
  }
  .ws-modal-header {
    padding: 12px 14px;
  }
  .ws-modal-body {
    padding: 14px;
  }
  .ws-modal-footer {
    padding: 10px 14px;
  }
  .ws-modal-title {
    font-size: 15px;
  }

  /* ── Task detail modal — stack sidebar below main ────────── */
  .ws-task-detail {
    grid-template-columns: 1fr !important;
  }
  .ws-task-detail-sidebar {
    border-left: none !important;
    padding-left: 0 !important;
    border-top: 1px solid var(--border);
    padding-top: 14px;
  }
  .ws-detail-field .ws-select {
    min-height: 36px;
    font-size: 13px;
  }
  .ws-comment-input-row {
    flex-wrap: wrap;
    gap: 8px;
  }
  .ws-comment-input-row .ws-avatar {
    display: none;
  }
  .ws-comment-input-row > div {
    width: 100%;
  }

  /* ── Buttons — touch-friendly sizing ─────────────────────── */
  .ws-btn {
    min-height: 36px;
    padding: 8px 14px;
    font-size: 13px;
  }
  .ws-btn-sm {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 12px;
  }
  .ws-btn-icon {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  /* ── Form inputs — prevent zoom on iOS (16px font) ───────── */
  .ws-input {
    font-size: 16px;
    min-height: 40px;
    padding: 8px 12px;
  }
  .ws-select {
    font-size: 16px;
    min-height: 40px;
  }
  .ws-textarea {
    font-size: 16px;
    min-height: 80px;
  }

  /* ── Document editor — sidebar as drawer ─────────────────── */
  .ws-doc-tree-sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 280px;
    min-width: 280px;
    height: 100vh;
    z-index: 200;
    transition: left .25s ease;
    box-shadow: none;
  }
  .ws-doc-tree-sidebar.mobile-open {
    left: 0;
    box-shadow: 4px 0 24px rgba(0,0,0,.5);
  }
  .ws-doc-editor-area {
    width: 100%;
    flex: 1;
  }
  .ws-doc-toolbar-bar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px;
  }
  .ws-doc-title-input {
    width: 100%;
    font-size: 16px;
  }

  /* ── Pizarra — sidebar as drawer ─────────────────────────── */
  .ws-pizarra-sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 240px;
    min-width: 240px;
    height: 100vh;
    z-index: 200;
    transition: left .25s ease;
    box-shadow: none;
  }
  .ws-pizarra-sidebar.mobile-open {
    left: 0;
    box-shadow: 4px 0 24px rgba(0,0,0,.5);
  }
  .ws-pizarra-editor-area {
    width: 100%;
    flex: 1;
  }
  .ws-pizarra-toolbar-bar {
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 8px;
  }
  .ws-pizarra-tools {
    flex-wrap: wrap;
    gap: 2px;
    order: 10;
    width: 100%;
  }
  .ws-pizarra-tool {
    width: 36px;
    height: 36px;
  }

  /* ── Miembros tab ────────────────────────────────────────── */
  .ws-miembros-page {
    padding: 12px;
    max-width: 100%;
  }
  .ws-miembros-add {
    flex-wrap: wrap;
  }
  .ws-miembros-add .ws-input {
    width: 100%;
    flex: none;
  }
  .ws-miembros-add .ws-select {
    flex: 1;
  }
  .ws-miembros-add .ws-btn {
    flex: 1;
  }
  .ws-miembros-list {
    grid-template-columns: 1fr;
  }

  /* ── Empty states ────────────────────────────────────────── */
  .ws-empty {
    padding: 24px 16px;
  }
  .ws-empty-title {
    font-size: 15px;
  }
  .ws-empty-text {
    font-size: 12px;
  }

  /* ── Kanban column header ────────────────────────────────── */
  .ws-kanban-column-header {
    padding: 10px 12px;
  }

  /* ── Avatars ─────────────────────────────────────────────── */
  .ws-avatar {
    width: 28px;
    height: 28px;
    font-size: 10px;
  }

  /* ── Create Task modal — stack grid on mobile ────────────── */
  .ws-modal-body [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   GANTT CHART
   ═══════════════════════════════════════════════════════════════ */

/* ── Toolbar ───────────────────────────────────────────────── */
.ws-gantt-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  flex-shrink: 0;
}

.ws-gantt-toolbar-left {
  display: flex;
  align-items: center;
}

.ws-gantt-toolbar-right {
  display: flex;
  gap: 4px;
}

/* ── Wrapper (labels + timeline side by side) ──────────────── */
.ws-gantt-wrapper {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* ── Labels column (left, fixed width) ─────────────────────── */
.ws-gantt-labels-col {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--bg-surface);
  z-index: 2;
}

.ws-gantt-labels-header {
  display: flex;
  align-items: flex-end;
  padding: 0 12px 8px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.ws-gantt-labels-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Hide scrollbar on labels (synced from timeline) */
.ws-gantt-labels-body::-webkit-scrollbar { width: 0; }
.ws-gantt-labels-body { scrollbar-width: none; }

.ws-gantt-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,.04));
  cursor: pointer;
  transition: background .1s;
}

.ws-gantt-label:hover {
  background: var(--bg-hover);
}

.ws-gantt-status-dot {
  width: 8px;
  height: 8px;
  min-width: 8px;
  border-radius: 50%;
}

.ws-gantt-label-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.ws-gantt-label-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ws-gantt-label-title.done {
  text-decoration: line-through;
  opacity: .6;
}

.ws-gantt-label-meta {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Timeline column (right, scrollable both axes) ─────────── */
.ws-gantt-timeline-col {
  flex: 1;
  overflow: auto;
  min-width: 0;
}

/* ── Header (months + days, sticky) ────────────────────────── */
.ws-gantt-timeline-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}

.ws-gantt-months {
  display: flex;
  border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,.04));
}

.ws-gantt-month {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 8px;
  border-right: 1px solid var(--border-subtle, rgba(255,255,255,.04));
  white-space: nowrap;
  overflow: hidden;
  text-transform: capitalize;
  box-sizing: border-box;
  flex-shrink: 0;
}

.ws-gantt-days {
  display: flex;
}

.ws-gantt-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2px 0;
  font-size: 10px;
  color: var(--text-muted);
  border-right: 1px solid var(--border-subtle, rgba(255,255,255,.04));
  box-sizing: border-box;
  flex-shrink: 0;
}

.ws-gantt-day.weekend {
  background: rgba(255, 255, 255, .02);
  opacity: .6;
}

.ws-gantt-day.today {
  color: var(--accent-orange);
  font-weight: 700;
  opacity: 1;
}

.ws-gantt-day-name {
  font-size: 9px;
  text-transform: uppercase;
}

.ws-gantt-day-num {
  font-size: 11px;
  font-weight: 500;
}

/* ── Timeline body (grid + bars + today line) ──────────────── */
.ws-gantt-timeline-body {
  position: relative;
}

.ws-gantt-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
}

.ws-gantt-grid-col {
  position: absolute;
  top: 0;
  bottom: 0;
  border-right: 1px solid var(--border-subtle, rgba(255,255,255,.04));
  box-sizing: border-box;
}

.ws-gantt-grid-col.weekend {
  background: rgba(255, 255, 255, .015);
}

/* ── Today line ────────────────────────────────────────────── */
.ws-gantt-today-line {
  position: absolute;
  top: 0;
  width: 2px;
  background: var(--accent-orange);
  z-index: 1;
  opacity: .8;
  pointer-events: none;
}

.ws-gantt-today-line::before {
  content: '';
  position: absolute;
  top: 0;
  left: -3px;
  width: 8px;
  height: 8px;
  background: var(--accent-orange);
  border-radius: 50%;
}

/* ── Task rows & bars ──────────────────────────────────────── */
.ws-gantt-bars {
  position: relative;
}

.ws-gantt-row {
  position: relative;
  border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,.04));
  cursor: pointer;
  transition: background .1s;
}

.ws-gantt-row:hover {
  background: var(--bg-hover);
}

.ws-gantt-bar {
  position: absolute;
  border-radius: 4px;
  display: flex;
  align-items: center;
  overflow: hidden;
  transition: opacity .15s;
  min-width: 24px;
}

.ws-gantt-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  border-radius: 4px 0 0 4px;
  transition: width .3s;
}

.ws-gantt-bar-text {
  position: relative;
  z-index: 1;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 8px 0 6px;
}

.ws-gantt-bar.done {
  opacity: .55;
}

.ws-gantt-bar.overdue {
  box-shadow: inset 0 0 0 1px var(--accent-red);
}

.ws-gantt-bar-overdue {
  position: relative;
  z-index: 1;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-red);
  margin-left: auto;
  padding-right: 6px;
}

/* ── Legend ─────────────────────────────────────────────────── */
.ws-gantt-legend {
  display: flex;
  gap: 16px;
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
  flex-shrink: 0;
}

.ws-gantt-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
}

.ws-gantt-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* ── Gantt responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
  .ws-gantt-labels-col {
    width: 110px !important;
  }
  .ws-gantt-label {
    padding: 0 6px;
    gap: 4px;
  }
  .ws-gantt-label-title {
    font-size: 10px;
  }
  .ws-gantt-label-meta {
    font-size: 9px;
  }
  .ws-gantt-toolbar {
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px;
  }
  .ws-gantt-toolbar-right {
    gap: 2px;
  }
  .ws-gantt-toolbar-right .ws-btn {
    min-height: 32px;
    padding: 4px 8px;
    font-size: 11px;
  }
  .ws-gantt-legend {
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 10px;
  }
  .ws-gantt-legend-item {
    font-size: 10px;
  }
}
