/* ============================================================
   Buuble — components.css
   Componentes reutilizables: botones, badges, inputs, avatares,
   dropdowns, toggles, skeletons y animaciones nativas.
   ============================================================ */

/* ============================================================
   1. BOTONES
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  white-space: nowrap;
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  line-height: 1;
  transition: background 150ms ease, border-color 150ms ease,
              color 150ms ease, transform 100ms ease;
  user-select: none;
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* ─── Primario ─── */
.btn-primary {
  padding: 8px 16px;
  background: var(--accent);
  color: #FFFFFF;
  font-weight: var(--fw-medium);
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: scale(0.98); }

/* ─── Secundario / Ghost ─── */
.btn-secondary {
  padding: 7px 15px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  font-weight: var(--fw-regular);
}
.btn-secondary:hover {
  background: var(--bg-overlay);
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.btn-secondary:active { transform: scale(0.98); }

/* ─── Destructivo ─── */
.btn-danger {
  padding: 8px 16px;
  background: var(--error);
  color: #FFFFFF;
  font-weight: var(--fw-medium);
}
.btn-danger:hover { background: #DC2626; }
.btn-danger:active { transform: scale(0.98); }

.btn-danger-outline {
  padding: 7px 15px;
  background: transparent;
  color: var(--error);
  border: 1px solid var(--error);
  font-weight: var(--fw-medium);
}
.btn-danger-outline:hover {
  background: var(--error-bg);
}
.btn-danger-outline:active {
  transform: scale(0.98);
}

/* ─── Variantes de tamaño ─── */
.btn-sm  { padding: 5px 10px; font-size: var(--text-sm); }
.btn-lg  { padding: 11px 20px; font-size: var(--text-md); }
.btn-block { width: 100%; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ─── Botón icónico ─── */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: background 120ms ease, color 120ms ease;
}
.btn-icon:hover { background: var(--bg-overlay); color: var(--text-primary); }
.btn-icon:active { transform: scale(0.96); }
.btn-icon svg { width: 20px; height: 20px; }

/* Spinner inline para estados de carga en botones */
.btn .spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   2. BADGES DE ESTADO (punto de color a la izquierda)
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  line-height: 1.5;
  white-space: nowrap;
}

.badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: currentColor;
}

.badge-active,
.badge-done    { background: var(--status-active-bg);  color: var(--status-active-text); }
.badge-inprog  { background: var(--status-inprog-bg);  color: var(--status-inprog-text); }
.badge-review  { background: var(--status-review-bg);  color: var(--status-review-text); }
.badge-blocked { background: var(--status-blocked-bg); color: var(--status-blocked-text); }
.badge-late    { background: var(--status-late-bg);    color: var(--status-late-text); }
.badge-onleave { background: var(--status-onleave-bg); color: var(--status-onleave-text); }
.badge-todo    { background: var(--bg-overlay);        color: var(--text-secondary); }
.badge-accent   { background: var(--accent-light);      color: var(--accent-text); }
.badge-paused   { background: #FFFBEB;                  color: #92400E; }
.badge-inactive { background: #F3F4F6;                  color: #6B7280; }

/* ─── Contador numérico (rojo, p. ej. Inbox) ─── */
.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--error);
  color: #FFFFFF;
  font-size: var(--text-xs);
  font-weight: var(--fw-medium);
  line-height: 1;
}

/* ============================================================
   3. INPUTS, SELECTORES Y TEXTAREAS (focus ring animado)
   ============================================================ */
.input,
.select,
.textarea,
input.field,
select.field,
textarea.field {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--bg-surface);
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.textarea,
textarea.field {
  height: auto;
  min-height: 80px;
  padding: 10px 12px;
  line-height: var(--lh-base);
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus,
input.field:focus,
select.field:focus,
textarea.field:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.input::placeholder,
.textarea::placeholder,
input.field::placeholder,
textarea.field::placeholder {
  color: var(--text-tertiary);
}

.input:disabled,
input.field:disabled {
  background: var(--bg-overlay);
  color: var(--text-disabled);
  cursor: not-allowed;
}

/* ── Custom select (reemplazo estético del desplegable nativo) ── */
.cselect { position: relative; display: inline-block; max-width: 100%; vertical-align: middle; }
.cselect-block { display: block; width: 100%; }
.cselect-native { display: none !important; }

.cselect-trigger {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; height: 36px; padding: 0 10px 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--bg-surface); color: var(--text-primary);
  font-size: var(--text-base); font-weight: var(--fw-medium); line-height: 1;
  cursor: pointer; transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}
.cselect-trigger:hover { border-color: var(--border-strong); }
.cselect-trigger[aria-expanded="true"] {
  border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.cselect-trigger:disabled { background: var(--bg-overlay); color: var(--text-disabled); cursor: not-allowed; }
.cselect-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cselect-chevron { width: 16px; height: 16px; color: var(--text-tertiary); flex-shrink: 0; transition: transform 150ms ease; }
.cselect-trigger[aria-expanded="true"] .cselect-chevron { transform: rotate(180deg); }

.cselect-menu {
  z-index: 1200; max-height: 280px; overflow-y: auto;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg); padding: 4px;
  animation: cselectIn 120ms ease;
}
@keyframes cselectIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.cselect-option {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  font-size: var(--text-sm); font-weight: var(--fw-medium); color: var(--text-secondary);
  cursor: pointer; transition: background 100ms ease, color 100ms ease;
}
.cselect-option-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cselect-option:hover { background: var(--bg-overlay); color: var(--text-primary); }
.cselect-option.is-selected { background: var(--accent-light); color: var(--accent-text); }
.cselect-check { width: 15px; height: 15px; color: var(--accent); flex-shrink: 0; }

/* ── Custom date picker (reemplazo estético del calendario nativo) ── */
.cdate { position: relative; display: inline-block; max-width: 100%; vertical-align: middle; }
.cdate-block { display: block; width: 100%; }
.cdate-native { display: none !important; }

.cdate-trigger {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; height: 36px; padding: 0 10px 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--bg-surface); color: var(--text-primary);
  font-size: var(--text-base); font-weight: var(--fw-medium); line-height: 1;
  cursor: pointer; transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}
.cdate-trigger:hover { border-color: var(--border-strong); }
.cdate-trigger[aria-expanded="true"] {
  border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.cdate-trigger:disabled { background: var(--bg-overlay); color: var(--text-disabled); cursor: not-allowed; }
.cdate-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cdate-label.is-placeholder { color: var(--text-tertiary); font-weight: var(--fw-normal, 400); }
.cdate-icon { width: 16px; height: 16px; color: var(--text-tertiary); flex-shrink: 0; }

.cdate-pop {
  z-index: 1200; width: 268px; padding: var(--space-3);
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  animation: cselectIn 120ms ease;
}
.cdate-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-3); }
.cdate-title { font-size: var(--text-sm); font-weight: var(--fw-medium); color: var(--accent-text); text-transform: capitalize; }
.cdate-nav { display: inline-flex; gap: 2px; }
.cdate-arrow {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  color: var(--text-secondary); background: transparent; cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.cdate-arrow:hover { background: var(--bg-overlay); color: var(--text-primary); }
.cdate-arrow svg { width: 16px; height: 16px; }

.cdate-weekdays, .cdate-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cdate-weekdays { margin-bottom: 4px; }
.cdate-weekdays span {
  text-align: center; font-size: var(--text-xs); font-weight: var(--fw-medium);
  color: var(--text-tertiary); padding: 4px 0;
}
.cdate-grid { gap: 2px; }
.cdate-day {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 1 / 1; border-radius: var(--radius-sm);
  font-size: var(--text-sm); font-weight: var(--fw-medium); color: var(--text-primary);
  background: transparent; cursor: pointer;
  transition: background 100ms ease, color 100ms ease;
}
.cdate-day:hover { background: var(--bg-overlay); }
.cdate-day.is-outside { color: var(--text-disabled); }
.cdate-day.is-today { color: var(--accent); font-weight: var(--fw-semibold, 600); }
.cdate-day.is-selected { background: var(--accent); color: #fff; }
.cdate-day.is-selected:hover { background: var(--accent-hover, var(--accent)); }
.cdate-day.is-disabled { color: var(--text-disabled); cursor: not-allowed; opacity: 0.5; }
.cdate-day.is-disabled:hover { background: transparent; }

.cdate-foot { display: flex; align-items: center; justify-content: space-between; margin-top: var(--space-3); padding-top: var(--space-2); border-top: 1px solid var(--border); }
.cdate-action {
  font-size: var(--text-sm); font-weight: var(--fw-medium); color: var(--text-secondary);
  background: transparent; cursor: pointer; padding: 4px 6px; border-radius: var(--radius-sm);
  transition: background 120ms ease, color 120ms ease;
}
.cdate-action:hover { background: var(--bg-overlay); color: var(--text-primary); }
.cdate-today { color: var(--accent); }
.cdate-today:hover { color: var(--accent); }

/* ─── Grupo de campo con label ─── */
.field-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.field-label {
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
}
.field-hint {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

/* ─── Input con icono a la izquierda (buscador) ─── */
.input-search {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.input-search svg {
  position: absolute;
  left: 10px;
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
  pointer-events: none;
}
.input-search .input {
  padding-left: 34px;
}

/* ============================================================
   4. AVATARES
   ============================================================ */
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent-text);
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  text-transform: uppercase;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.avatar-xs { width: 20px; height: 20px; font-size: 10px; }
.avatar-sm { width: 24px; height: 24px; font-size: var(--text-xs); }
.avatar-lg { width: 40px; height: 40px; font-size: var(--text-base); }
.avatar-xl { width: 64px; height: 64px; font-size: var(--text-lg); }

/* ─── Grupo de avatares superpuestos ─── */
.avatar-group {
  display: inline-flex;
  align-items: center;
}
.avatar-group .avatar {
  border: 2px solid var(--bg-surface);
}
.avatar-group .avatar:not(:first-child) {
  margin-left: -8px;
}
.avatar-group .avatar-more {
  background: var(--bg-overlay);
  color: var(--text-secondary);
}

/* ============================================================
   5. DROPDOWN / MENÚ CONTEXTUAL
   ============================================================ */
.dropdown {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 4px;
  min-width: 180px;
  animation: dropIn 150ms ease-out;
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 100ms ease, color 100ms ease;
}
.dropdown-item:hover { background: var(--bg-overlay); color: var(--text-primary); }
.dropdown-item.danger { color: var(--error); }
.dropdown-item.danger:hover { background: var(--error-bg); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ============================================================
   6. TOGGLE SWITCH
   ============================================================ */
.toggle {
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: var(--border-strong);
  position: relative;
  cursor: pointer;
  transition: background 200ms ease;
  flex-shrink: 0;
}
.toggle.on { background: var(--accent); }
.toggle::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #FFFFFF;
  top: 2px;
  left: 2px;
  transition: transform 200ms ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.toggle.on::after { transform: translateX(16px); }

/* ============================================================
   7. TARJETA GENÉRICA
   ============================================================ */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--card-padding-lg);
}
.card-flat {
  background: var(--bg-overlay);
  border: none;
  border-radius: var(--radius-xl);
}

/* ============================================================
   8. ALERTA / MENSAJE DE ERROR DINÁMICO
   ============================================================ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  line-height: var(--lh-base);
}
.alert-error   { background: var(--error-bg);   color: var(--status-late-text); }
.alert-success { background: var(--success-bg); color: var(--status-active-text); }
.alert-warning { background: var(--warning-bg); color: var(--status-blocked-text); }
.alert-info    { background: var(--info-bg);    color: var(--status-inprog-text); }

/* ============================================================
   9. SKELETON LOADING (shimmer animado)
   ============================================================ */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-overlay) 25%,
    var(--border) 50%,
    var(--bg-overlay) 75%
  );
  background-size: 200px 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
  color: transparent !important;
  pointer-events: none;
  user-select: none;
}
.skeleton * { visibility: hidden; }
.skeleton-text { height: 12px; width: 100%; }
.skeleton-line { height: 14px; border-radius: var(--radius-sm); }
.skeleton-circle { border-radius: 50%; }

@keyframes shimmer {
  0%   { background-position: -200px 0; }
  100% { background-position: calc(200px + 100%) 0; }
}

/* ============================================================
   10. ANIMACIONES NATIVAS ESENCIALES
   ============================================================ */

/* fadeUp — aparición de tarjetas con stagger */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.anim-fade-up { animation: fadeUp 300ms ease-out both; }
.anim-fade-up:nth-child(1) { animation-delay: 0ms; }
.anim-fade-up:nth-child(2) { animation-delay: 50ms; }
.anim-fade-up:nth-child(3) { animation-delay: 100ms; }
.anim-fade-up:nth-child(4) { animation-delay: 150ms; }
.anim-fade-up:nth-child(5) { animation-delay: 200ms; }
.anim-fade-up:nth-child(6) { animation-delay: 250ms; }

/* dropIn — dropdowns y tooltips */
@keyframes dropIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* fadeIn — overlays */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* slideIn — drawer lateral */
@keyframes slideIn {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

/* modalIn — modales centrados */
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* pulse — badge de notificación nuevo */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.3); }
}
.badge-pulse { animation: pulse 400ms ease; }

/* blink — timer activo */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.6; }
}
.timer-active { animation: blink 1.5s ease-in-out infinite; }

/* toastIn — notificaciones toast */
@keyframes toastIn {
  from { opacity: 0; transform: translateX(calc(100% + 24px)); }
  to   { opacity: 1; transform: translateX(0); }
}
.toast { animation: toastIn 350ms cubic-bezier(0.16, 1, 0.3, 1); }

/* ─── Reducción de movimiento: solo desactiva efectos intrusivos ─── */
@media (prefers-reduced-motion: reduce) {
  .anim-fade-up,
  .toast,
  .badge-pulse,
  .timer-active {
    animation: none;
  }
  .anim-fade-up { opacity: 1; transform: none; }
}

/* ============================================================
   11. MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  animation: fadeIn 180ms ease forwards;
}
.modal {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  padding: var(--space-6);
  animation: modalIn 250ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}
.modal-title {
  font-size: var(--text-lg);
  font-weight: var(--fw-medium);
  color: var(--text-primary);
}
.modal-subtitle {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin-top: 2px;
}
.modal-body { display: flex; flex-direction: column; gap: var(--space-4); }
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-6);
}
.modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-md);
  color: var(--text-tertiary);
  transition: background 120ms ease, color 120ms ease;
  flex-shrink: 0;
}
.modal-close:hover { background: var(--bg-overlay); color: var(--text-primary); }

/* ============================================================
   12. DRAWER LATERAL
   ============================================================ */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 100;
  opacity: 0;
  animation: fadeIn 200ms ease forwards;
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 480px;
  max-width: 100vw;
  background: var(--bg-surface);
  border-left: 1px solid var(--border);
  z-index: 101;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  animation: slideIn 300ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.drawer.closing { animation: slideOut 220ms ease forwards; }
.drawer-overlay.closing { animation: fadeOut 220ms ease forwards; }
@keyframes slideOut { to { transform: translateX(100%); } }
@keyframes fadeOut { to { opacity: 0; } }

.drawer-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.drawer-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--bg-overlay);
  border-radius: var(--radius-md);
}
.drawer-tab {
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.drawer-tab.active { background: var(--bg-surface); color: var(--text-primary); box-shadow: var(--shadow-sm); }
.drawer-body { flex: 1; overflow-y: auto; padding: var(--space-5); }
.drawer-actions { margin-left: auto; display: flex; align-items: center; gap: var(--space-1); }

/* Móvil: drawer a pantalla completa */
@media (max-width: 640px) {
  .drawer { width: 100vw; border-left: none; }
  .drawer-body { padding: var(--space-4); }
}

/* Filas de propiedad dentro del drawer */
.prop-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  min-height: 36px;
}
.prop-label {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
/* Móvil: filas de propiedad apiladas (etiqueta sobre valor) */
@media (max-width: 640px) {
  .prop-row { grid-template-columns: 1fr; gap: var(--space-1); align-items: start; }
}

/* ============================================================
   13. TOAST
   ============================================================ */
.toast-stack {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 240px;
  max-width: 360px;
  padding: 10px 14px;
  background: var(--text-primary);
  color: #FFFFFF;
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  box-shadow: var(--shadow-md);
  pointer-events: auto;
}
.toast.leaving { animation: toastOut 250ms ease forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateX(calc(100% + 24px)); } }
.toast-success { background: #065F46; }
.toast-error   { background: #991B1B; }
.toast-warning { background: #92400E; }

/* ============================================================
   14. PALETA DE BÚSQUEDA (⌘K) — responsive
   ============================================================ */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 10vh var(--space-4) var(--space-4);
  animation: fadeIn 160ms ease forwards;
}
.search-modal {
  width: 100%;
  max-width: 560px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.search-input-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
}
.search-input-wrap .search-ico { display: flex; color: var(--text-tertiary); }
.search-input-wrap .search-ico svg { width: 18px; height: 18px; }
.search-input-wrap input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: var(--text-base);
  color: var(--text-primary);
}
.search-results { overflow-y: auto; padding: var(--space-2); }
.search-hint {
  padding: var(--space-4);
  text-align: center;
  color: var(--text-tertiary);
  font-size: var(--text-sm);
}

/* Móvil: paleta más cerca del borde superior */
@media (max-width: 640px) {
  .search-overlay { padding: var(--space-4); }
  .search-modal { max-height: 80vh; }
}
.toast-info    { background: var(--text-primary); }
.toast-icon { font-size: var(--text-md); line-height: 1; }

/* ============================================================
   14. EMPTY STATE
   ============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--space-3);
  padding: var(--space-12) var(--space-6);
  color: var(--text-tertiary);
}
.empty-state svg { width: 48px; height: 48px; opacity: 0.5; }
.empty-state-title { font-size: var(--text-md); font-weight: var(--fw-medium); color: var(--text-secondary); }
.empty-state-text { font-size: var(--text-base); max-width: 320px; }

/* ============================================================
   15. CHIPS DE PRIORIDAD
   ============================================================ */
.priority-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
}
.priority-chip .pdot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.priority-urgent { color: var(--priority-urgent); }
.priority-urgent .pdot { background: var(--priority-urgent); }
.priority-high { color: var(--priority-high); }
.priority-high .pdot { background: var(--priority-high); }
.priority-medium { color: var(--priority-medium); }
.priority-medium .pdot { background: var(--priority-medium); }
.priority-low { color: var(--priority-low); }
.priority-low .pdot { background: var(--priority-low); }
.priority-none { color: var(--priority-none); }
.priority-none .pdot { background: var(--priority-none); }

/* ============================================================
   16. ASIGNADOS MÚLTIPLES (avatares apilados + selector)
   ============================================================ */
.assignee-cell { display: inline-flex; align-items: center; gap: var(--space-2); }
.assignee-stack { display: inline-flex; align-items: center; }
.assignee-stack .avatar { margin-left: -7px; border: 2px solid var(--bg-surface); box-shadow: 0 0 0 1px rgba(0,0,0,0.03); }
.assignee-stack .avatar:first-child { margin-left: 0; }
.assignee-edit {
  padding: 4px 10px; border-radius: var(--radius-pill); font-size: var(--text-sm); font-weight: var(--fw-medium);
  color: var(--accent); background: var(--accent-light); transition: background 120ms ease;
}
.assignee-edit:hover { background: color-mix(in srgb, var(--accent-light) 70%, var(--accent) 12%); }

.assignee-picker {
  margin: var(--space-2) 0 var(--space-3); padding: var(--space-1);
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-surface);
  box-shadow: var(--shadow-md); max-height: 220px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
}
.assignee-picker[hidden] { display: none; }
.assignee-opt {
  display: flex; align-items: center; gap: var(--space-2); width: 100%; text-align: left;
  padding: 6px 8px; border-radius: var(--radius-md); transition: background 100ms ease;
}
.assignee-opt:hover { background: var(--bg-overlay); }
.assignee-opt.is-on { background: var(--accent-light); }
.assignee-opt-name { flex: 1; min-width: 0; font-size: var(--text-sm); color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assignee-check { color: var(--accent); font-weight: var(--fw-medium); width: 16px; text-align: center; }
