/* =========================================
   RECREATIVO — TABLEROS ESTILO KANBAN
========================================= */

:root {
  --brand: #0f766e;
  --brand-hover: #115e59;
  --brand-soft: #e6f5f2;

  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f1f2f4;
  --surface-3: #e4e6ea;

  --text: #172b4d;
  --text-2: #44546f;
  --text-3: #8590a2;
  --border: #dcdfe4;

  --danger: #c9372c;
  --danger-soft: #ffeceb;
  --success: #1f845a;
  --warning: #b38600;

  --list-bg: #f1f2f4;
  --card-shadow: 0 1px 1px rgba(9, 30, 66, 0.25), 0 0 1px rgba(9, 30, 66, 0.31);
  --pop-shadow: 0 8px 24px rgba(9, 30, 66, 0.18), 0 0 1px rgba(9, 30, 66, 0.31);

  --radius: 12px;
  --radius-sm: 8px;
  --appbar-h: 52px;
  --boardbar-h: 56px;
  --ease: 0.16s ease;

  /* Etiquetas */
  --label-green: #4bce97;
  --label-yellow: #f5cd47;
  --label-orange: #fea362;
  --label-red: #f87168;
  --label-purple: #9f8fef;
  --label-blue: #579dff;
}

/* Fondos de tablero */
[data-bg="lagoon"] { --board-bg: linear-gradient(135deg, #0b3b46 0%, #0e7c7b 55%, #2bb3a3 100%); --board-solid: #0e7c7b; }
[data-bg="ocean"]  { --board-bg: linear-gradient(135deg, #0b1f4d 0%, #1d4ed8 60%, #38bdf8 100%); --board-solid: #1d4ed8; }
[data-bg="aurora"] { --board-bg: linear-gradient(135deg, #312e81 0%, #7c3aed 50%, #db2777 100%); --board-solid: #6d28d9; }
[data-bg="grape"]  { --board-bg: linear-gradient(135deg, #2e1065 0%, #6d28d9 60%, #a78bfa 100%); --board-solid: #5b21b6; }
[data-bg="rose"]   { --board-bg: linear-gradient(135deg, #881337 0%, #e11d48 55%, #fb7185 100%); --board-solid: #be123c; }
[data-bg="sunset"] { --board-bg: linear-gradient(135deg, #7c2d12 0%, #ea580c 50%, #f59e0b 100%); --board-solid: #c2410c; }
[data-bg="amber"]  { --board-bg: linear-gradient(135deg, #78350f 0%, #b45309 50%, #eab308 100%); --board-solid: #a16207; }
[data-bg="mint"]   { --board-bg: linear-gradient(135deg, #064e3b 0%, #059669 55%, #6ee7b7 100%); --board-solid: #047857; }
[data-bg="forest"] { --board-bg: linear-gradient(135deg, #14281d 0%, #355e3b 55%, #7a9e7e 100%); --board-solid: #2f5233; }
[data-bg="night"]  { --board-bg: linear-gradient(135deg, #020617 0%, #1e293b 55%, #475569 100%); --board-solid: #1e293b; }

/* RESET */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { min-height: 100%; }

body {
  min-height: 100vh;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: var(--brand); }
svg { width: 16px; height: 16px; fill: currentColor; flex-shrink: 0; }
[hidden] { display: none !important; }
.hidden { display: none !important; }

:focus-visible {
  outline: 2px solid #388bff;
  outline-offset: 2px;
}

/* =========================================
   BOTONES Y CONTROLES
========================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 6px;
  font-weight: 600;
  white-space: nowrap;
  transition: background var(--ease), box-shadow var(--ease), transform var(--ease);
}

.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn-sm { min-height: 32px; padding: 4px 12px; font-size: 13px; }

.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); }

.btn-secondary { background: rgba(9, 30, 66, 0.06); color: var(--text); }
.btn-secondary:hover { background: rgba(9, 30, 66, 0.12); }

.btn-ghost { color: var(--text-2); }
.btn-ghost:hover { background: rgba(9, 30, 66, 0.08); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #ae2e24; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  color: var(--text-2);
  transition: background var(--ease), color var(--ease);
}

.icon-btn:hover { background: rgba(9, 30, 66, 0.1); color: var(--text); }

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}

.form-field small { font-weight: 400; color: var(--text-3); }
.required { color: var(--danger); }

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 9px 12px;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 400;
  resize: vertical;
  transition: border-color var(--ease);
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: #388bff;
}

.check-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
}

.check-field input { margin-top: 3px; accent-color: var(--brand); }
.check-field em { font-style: normal; color: var(--text-3); }

/* =========================================
   AUTENTICACIÓN
========================================= */

.login-page { background: #f6f8f9; }

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(380px, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

/* Panel visual */

.login-showcase {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  padding: 40px 48px 48px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 85% 10%, rgba(43, 179, 163, 0.55), transparent 45%),
    radial-gradient(circle at 10% 90%, rgba(56, 189, 248, 0.35), transparent 45%),
    linear-gradient(150deg, #06262e 0%, #0b3b46 45%, #0e7c7b 100%);
}

/* Cuadrícula sutil de fondo */
.login-showcase::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(circle at 50% 45%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(circle at 50% 45%, #000 20%, transparent 75%);
}

.login-showcase > * { position: relative; }

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.login-showcase .brand-icon { background: rgba(255, 255, 255, 0.16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25); }
.login-brand-mobile { display: none; margin-bottom: 28px; color: var(--text); }

.showcase-board {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  align-self: center;
  transform: perspective(1200px) rotateX(8deg) rotateZ(-3deg);
}

.showcase-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 172px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(241, 242, 244, 0.94);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  animation: float 6s ease-in-out infinite;
}

.showcase-list:nth-child(2) { margin-top: 26px; animation-delay: -2s; }
.showcase-list:nth-child(3) { margin-top: 8px; animation-delay: -4s; }

.showcase-list-title { padding: 2px 4px 4px; color: #172b4d; font-size: 12px; font-weight: 700; }

.showcase-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--card-shadow);
}

.showcase-card b { display: block; height: 7px; border-radius: 4px; background: #dcdfe4; }
.showcase-card b.short { width: 60%; }
.sc-label { display: block; width: 36px; height: 7px; border-radius: 4px; background: var(--c); }

.showcase-card em {
  align-self: flex-start;
  padding: 1px 6px;
  border-radius: 4px;
  background: #1f845a;
  color: #fff;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}

.showcase-card-lift { transform: rotate(-4deg) translateX(10px); box-shadow: 0 12px 24px rgba(9, 30, 66, 0.3); }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.showcase-copy { max-width: 440px; }
.showcase-copy h2 { font-size: clamp(24px, 2.6vw, 32px); font-weight: 800; line-height: 1.2; letter-spacing: -0.8px; }
.showcase-copy p { margin-top: 12px; color: rgba(255, 255, 255, 0.78); font-size: 15px; line-height: 1.6; }

/* Formulario */

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.login-card { width: 100%; max-width: 380px; }

.login-card h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.8px; }
.login-sub { margin: 6px 0 30px; color: var(--text-2); font-size: 15px; }

.login-form { display: flex; flex-direction: column; gap: 18px; }
.login-form.shake { animation: shake 0.35s ease; }

@keyframes shake {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.login-field { display: flex; flex-direction: column; gap: 7px; color: var(--text); font-size: 13px; font-weight: 600; }

.login-input {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 6px 0 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text-3);
  transition: border-color var(--ease), box-shadow var(--ease);
}

.login-input:hover { border-color: #b3b9c4; }
.login-input:focus-within { border-color: #0e7c7b; box-shadow: 0 0 0 4px rgba(14, 124, 123, 0.14); color: #0e7c7b; }
.login-input svg { width: 18px; height: 18px; }

.login-input input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  font-weight: 400;
}

.login-input input::placeholder { color: #a5adba; }

.toggle-pass {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--text-3);
}

.toggle-pass:hover { background: var(--surface-2); color: var(--text); }
.toggle-pass[aria-pressed="true"] { color: #0e7c7b; }

.login-error {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #ffd2cc;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
  font-weight: 500;
}

.login-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 50px;
  margin-top: 4px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0b3b46, #0e7c7b);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(14, 124, 123, 0.3);
  transition: transform var(--ease), box-shadow var(--ease), filter var(--ease);
}

.login-submit:hover { filter: brightness(1.08); box-shadow: 0 10px 24px rgba(14, 124, 123, 0.38); }
.login-submit:hover svg { transform: translateX(3px); }
.login-submit svg { width: 18px; height: 18px; transition: transform var(--ease); }
.login-submit:active { transform: translateY(1px); }
.login-submit:disabled { cursor: progress; filter: saturate(0.6); }

.login-submit.loading svg { display: none; }
.login-submit.loading::after {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.login-note {
  display: flex;
  gap: 10px;
  margin-top: 28px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #eaf4f3;
  color: #0b3b46;
  font-size: 13px;
  line-height: 1.5;
}

.login-note svg { width: 18px; height: 18px; margin-top: 1px; color: #0e7c7b; }

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-showcase { display: none; }
  .login-brand-mobile { display: flex; }
  .login-panel {
    align-items: flex-start;
    padding: 56px 16px 32px;
    background:
      radial-gradient(circle at 100% 0%, rgba(43, 179, 163, 0.18), transparent 45%),
      #f6f8f9;
  }
}

/* =========================================
   BARRA SUPERIOR
========================================= */

.appbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--appbar-h);
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  text-decoration: none;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}

.appbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 420px;
  margin-left: auto;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-3);
}

.appbar-search:focus-within { border-color: #388bff; box-shadow: 0 0 0 1px #388bff; }
.appbar-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); }

.account { position: relative; }

.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.avatar-lg { width: 40px; height: 40px; font-size: 16px; }

.account-menu { position: absolute; top: 40px; right: 0; width: 260px; }

.account-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px 12px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.account-email { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 13px; color: var(--text-2); }

/* Barra traslúcida sobre el fondo del tablero */
.appbar-glass {
  background: rgba(0, 0, 0, 0.22);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
}

.appbar-glass .brand { color: #fff; }
.appbar-glass .brand-icon { background: rgba(255, 255, 255, 0.22); }
.appbar-glass .avatar { background: rgba(255, 255, 255, 0.25); }

.appbar-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
}

.appbar-link:hover { background: rgba(255, 255, 255, 0.18); }
.appbar-spacer { flex: 1; }

/* =========================================
   POPOVER, MENÚS, TOASTS
========================================= */

.popover {
  position: fixed;
  z-index: 300;
  width: 280px;
  max-width: calc(100vw - 16px);
  padding: 12px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--pop-shadow);
  animation: pop-in 0.12s ease;
}

.account-menu.popover { position: absolute; }

.popover-title {
  margin: -2px 0 10px;
  text-align: center;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
}

.popover-label { margin: 4px 0 8px; color: var(--text-2); font-size: 12px; font-weight: 600; }
.popover hr { margin: 8px 0; border: 0; border-top: 1px solid var(--border); }

.menu-item {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border-radius: 4px;
  text-align: left;
  color: var(--text);
}

.menu-item:hover { background: var(--surface-2); }
.menu-item-danger { color: var(--danger); }
.menu-item-danger:hover { background: var(--danger-soft); }

@keyframes pop-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

.toast-stack {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  padding: 10px 16px;
  border-radius: 8px;
  background: #172b4d;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--pop-shadow);
  animation: toast-in 0.2s ease;
}

.toast-error { background: var(--danger); }
.toast.leaving { animation: toast-out 0.2s ease forwards; }

@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* =========================================
   MODALES
========================================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px;
  overflow-y: auto;
  background: rgba(9, 30, 66, 0.55);
  animation: fade-in 0.15s ease;
}

.confirm-overlay { z-index: 400; align-items: center; }

@keyframes fade-in { from { opacity: 0; } }

.modal {
  position: relative;
  width: 100%;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(9, 30, 66, 0.3);
  animation: modal-in 0.18s ease;
}

@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } }

.modal-sm { max-width: 380px; padding: 22px; }
.modal-md { max-width: 440px; }

.confirm-message { margin-bottom: 18px; font-size: 15px; line-height: 1.5; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 0 20px;
}

.modal-header h2 { font-size: 16px; font-weight: 700; }

.modal-body { display: flex; flex-direction: column; gap: 16px; padding: 16px 20px 20px; }

.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Vista previa y colores al crear tablero */

.board-preview {
  display: grid;
  place-items: center;
  height: 120px;
  border-radius: var(--radius-sm);
  background: var(--board-bg);
  transition: background 0.3s ease;
}

.board-preview-lists { display: flex; gap: 8px; }

.board-preview-lists span {
  width: 54px;
  height: 64px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.75);
}

.board-preview-lists span:nth-child(2) { height: 46px; }
.board-preview-lists span:nth-child(3) { height: 30px; }

.swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.swatches-sm { grid-template-columns: repeat(5, 1fr); }

.swatch {
  position: relative;
  height: 34px;
  border-radius: 6px;
  background: var(--board-bg);
  transition: transform var(--ease), box-shadow var(--ease);
}

.swatch:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(9, 30, 66, 0.25); }

.swatch[aria-checked="true"]::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 10px;
  height: 6px;
  border: solid #fff;
  border-width: 0 0 2.5px 2.5px;
  transform: translateY(-2px) rotate(-45deg);
}

/* =========================================
   DASHBOARD
========================================= */

.workspace {
  display: flex;
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 36px 24px 48px;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 220px;
  flex-shrink: 0;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 6px;
  color: var(--text-2);
  font-weight: 600;
  text-align: left;
}

.side-link:hover { background: var(--surface-3); color: var(--text); }
.side-link.active { background: var(--brand-soft); color: var(--brand); }

.boards-page { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 36px; }

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
}

.section-title svg { width: 20px; height: 20px; color: var(--text-2); }

.section-count {
  padding: 1px 8px;
  border-radius: 10px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
}

.boards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  gap: 14px;
}

.board-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 108px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--board-bg);
  color: #fff;
  text-decoration: none;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(9, 30, 66, 0.2);
  transition: transform var(--ease), box-shadow var(--ease);
}

.board-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background var(--ease);
}

.board-tile:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(9, 30, 66, 0.25); }
.board-tile:hover::before { background: rgba(0, 0, 0, 0.12); }
.board-tile > * { position: relative; }

.board-tile-name {
  padding-right: 24px;
  font-size: 15px;
  font-weight: 700;
  overflow-wrap: anywhere;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.board-tile-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12px;
  opacity: 0.9;
}

.board-tile-meta { margin-top: auto; font-size: 11px; font-weight: 500; opacity: 0.85; }

.tile-star,
.tile-delete {
  position: absolute;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: #fff;
  opacity: 0;
  transition: opacity var(--ease), background var(--ease), transform var(--ease);
}

.tile-star { right: 8px; bottom: 8px; }
.tile-delete { right: 8px; top: 8px; }

.board-tile:hover .tile-star,
.board-tile:hover .tile-delete,
.tile-star:focus-visible,
.tile-delete:focus-visible,
.tile-star.on { opacity: 1; }

.tile-star:hover, .tile-delete:hover { background: rgba(255, 255, 255, 0.22); }
.tile-star:hover svg { transform: scale(1.15); }
.tile-star.on { color: #f5cd47; }

.board-tile-new {
  align-items: center;
  justify-content: center;
  background: var(--surface-3);
  color: var(--text-2);
  font-weight: 500;
  box-shadow: none;
}

.board-tile-new:hover { background: #d5d9df; color: var(--text); box-shadow: none; }

.empty-search { padding: 20px 0; color: var(--text-3); }

/* =========================================
   VISTA DEL TABLERO
========================================= */

.board-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--board-solid);
  background-image: var(--board-bg);
  background-attachment: fixed;
  transition: background 0.3s ease;
}

.board-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--boardbar-h);
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.12);
  color: #fff;
  flex-shrink: 0;
}

.board-title {
  max-width: 50vw;
  padding: 4px 10px;
  border-radius: 6px;
  overflow: hidden;
  font-size: 18px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.board-title:hover { background: rgba(255, 255, 255, 0.2); }

.board-title-input {
  width: min(50vw, 360px);
  padding: 4px 10px;
  border: 2px solid #388bff;
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  outline: none;
}

.bar-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  color: #fff;
  transition: background var(--ease);
}

.bar-btn:hover { background: rgba(255, 255, 255, 0.2); }
.star-btn.on { color: #f5cd47; }
.bar-spacer { flex: 1; }

.bar-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  transition: background var(--ease);
}

.bar-filter:focus-within { background: #fff; color: var(--text-2); }

.bar-filter input {
  width: 150px;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
}

.bar-filter input::placeholder { color: rgba(255, 255, 255, 0.85); }
.bar-filter:focus-within input::placeholder { color: var(--text-3); }

.board-canvas {
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 0;
  padding: 12px 16px 16px;
  overflow-x: auto;
  overflow-y: hidden;
}

.board-canvas::-webkit-scrollbar { height: 12px; }
.board-canvas::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.4); border-radius: 6px; border: 3px solid transparent; background-clip: padding-box; }
.board-canvas::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.15); border-radius: 6px; margin: 0 16px; }

.board-loading { margin: auto; padding: 24px; color: #fff; font-weight: 600; text-align: center; }
.board-loading a { color: #fff; }

/* Listas */

.list {
  flex: 0 0 272px;
  width: 272px;
  max-height: 100%;
  display: flex;
}

.list-inner {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: 100%;
  border-radius: var(--radius);
  background: var(--list-bg);
  box-shadow: 0 1px 1px rgba(9, 30, 66, 0.25);
}

.list-header {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 8px 4px 8px;
  cursor: grab;
  user-select: none;
}

.list-title {
  flex: 1;
  min-width: 0;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.list-title:hover { background: rgba(9, 30, 66, 0.06); }

.list-title-input {
  flex: 1;
  min-width: 0;
  padding: 4px 7px;
  border: 2px solid #388bff;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  outline: none;
}

.list-count {
  padding: 0 7px;
  border-radius: 10px;
  background: rgba(9, 30, 66, 0.08);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
}

.cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 4px;
  padding: 4px 8px 2px;
  overflow-y: auto;
  overflow-x: hidden;
}

.cards::-webkit-scrollbar { width: 8px; }
.cards::-webkit-scrollbar-thumb { background: rgba(9, 30, 66, 0.2); border-radius: 4px; }

.list-footer { padding: 6px 8px 8px; }

.add-card-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 7px 8px;
  border-radius: 6px;
  color: var(--text-2);
  font-weight: 500;
  text-align: left;
}

.add-card-btn:hover { background: rgba(9, 30, 66, 0.1); color: var(--text); }

/* Tarjetas */

.card {
  position: relative;
  flex-shrink: 0;
  padding: 8px 12px 9px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--card-shadow);
  cursor: pointer;
  user-select: none;
  overflow-wrap: anywhere;
  transition: box-shadow var(--ease), background var(--ease);
}

.card:hover { box-shadow: 0 0 0 2px #388bff; }
.card:focus-visible { outline: none; box-shadow: 0 0 0 2px #388bff; }
.card.filtered-out { display: none; }

.card-labels { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }

.label-pill {
  width: 40px;
  height: 8px;
  border-radius: 4px;
  background: var(--label-color);
}

.card-title { font-size: 14px; line-height: 1.4; }

.card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 6px;
  color: var(--text-2);
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  padding: 0 4px;
  border-radius: 4px;
}

.badge svg { width: 14px; height: 14px; }
.badge-complete { background: var(--success); color: #fff; }

.due-done    { background: var(--success); color: #fff; }
.due-overdue { background: var(--danger); color: #fff; }
.due-soon    { background: var(--label-yellow); color: #533f04; }

/* Colores de etiquetas */
[data-color="green"]  { --label-color: var(--label-green); }
[data-color="yellow"] { --label-color: var(--label-yellow); }
[data-color="orange"] { --label-color: var(--label-orange); }
[data-color="red"]    { --label-color: var(--label-red); }
[data-color="purple"] { --label-color: var(--label-purple); }
[data-color="blue"]   { --label-color: var(--label-blue); }

/* Compositor */

.composer textarea,
.add-list-form input {
  width: 100%;
  padding: 8px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--card-shadow);
  resize: none;
  outline: none;
}

.add-list-form input { box-shadow: inset 0 0 0 2px #388bff; }

.composer-actions { display: flex; align-items: center; gap: 4px; margin-top: 8px; }

/* Añadir lista */

.add-list {
  flex: 0 0 272px;
  width: 272px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.24);
  transition: background var(--ease);
}

.add-list:hover { background: rgba(255, 255, 255, 0.32); }
.add-list.open { padding: 8px; background: var(--list-bg); }

.add-list-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 12px;
  color: #fff;
  font-weight: 600;
  text-align: left;
}

/* Arrastrar y soltar */

.is-dragging,
.is-dragging * { cursor: grabbing !important; user-select: none; }

.drag-source { display: none !important; }

.drag-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  pointer-events: none;
  box-shadow: 0 12px 28px rgba(9, 30, 66, 0.35);
  opacity: 0.96;
  transition: none;
}

.drag-ghost-list .list-inner { height: 100%; overflow: hidden; }

.card-placeholder {
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: rgba(9, 30, 66, 0.1);
}

.list-placeholder {
  flex: 0 0 272px;
  max-height: 100%;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.18);
}

.lift-ready { transform: scale(1.03); box-shadow: 0 8px 20px rgba(9, 30, 66, 0.3); }

/* =========================================
   DETALLE DE TARJETA
========================================= */

.modal-card { max-width: 760px; padding: 20px 20px 24px; background: var(--surface-2); }

.modal-x { position: absolute; top: 10px; right: 10px; }

.cm-header { display: flex; gap: 12px; padding-right: 36px; margin-bottom: 18px; }
.cm-icon, .cm-section-head svg { width: 22px; height: 22px; margin-top: 6px; color: var(--text-2); }
.cm-header-body { flex: 1; min-width: 0; }

.cm-title {
  width: 100%;
  padding: 4px 8px;
  margin-left: -8px;
  border: 2px solid transparent;
  border-radius: 6px;
  background: transparent;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  resize: none;
  overflow: hidden;
}

.cm-title:focus { outline: none; border-color: #388bff; background: #fff; }

.cm-sub { margin-top: 2px; color: var(--text-2); font-size: 13px; }

.cm-sub select {
  padding: 2px 4px;
  border: 0;
  border-radius: 4px;
  background: rgba(9, 30, 66, 0.06);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.cm-grid { display: grid; grid-template-columns: minmax(0, 1fr) 170px; gap: 24px; }
.cm-main { display: flex; flex-direction: column; gap: 24px; padding-left: 34px; }

.cm-meta { display: flex; flex-wrap: wrap; gap: 20px 28px; }
.cm-meta:not(:has(.cm-meta-block:not([hidden]))) { display: none; }

.cm-meta h4, .cm-side h4 {
  margin-bottom: 6px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
}

.cm-labels { display: flex; flex-wrap: wrap; gap: 4px; }

.label-chip {
  display: inline-flex;
  align-items: center;
  min-width: 48px;
  height: 32px;
  padding: 0 12px;
  border-radius: 4px;
  background: var(--label-color);
  color: #172b4d;
  font-size: 13px;
  font-weight: 600;
}

.cm-labels .icon-btn { background: rgba(9, 30, 66, 0.06); }

.label-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 3px 0;
}

.label-option .label-chip { flex: 1; transition: filter var(--ease); }
.label-option:hover .label-chip { filter: brightness(0.92); }
.label-tick { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 4px; border: 2px solid var(--border); color: transparent; }
.label-option.selected .label-tick { background: #0c66e4; border-color: #0c66e4; color: #fff; }

.cm-due { display: flex; align-items: center; gap: 8px; }
.cm-due input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--success); }

.cm-due input[type="date"] {
  height: 32px;
  padding: 0 8px;
  border: 0;
  border-radius: 4px;
  background: rgba(9, 30, 66, 0.06);
  font-weight: 500;
}

.due-status { padding: 1px 6px; border-radius: 3px; font-size: 12px; font-weight: 600; }
.due-status:empty { display: none; }

.cm-section-head { display: flex; align-items: center; gap: 12px; margin: 0 0 10px -34px; }
.cm-section-head svg { margin-top: 0; }
.cm-section-head h3 { font-size: 16px; font-weight: 700; }

.cm-desc {
  width: 100%;
  min-height: 70px;
  padding: 10px 12px;
  border: 0;
  border-radius: 6px;
  background: rgba(9, 30, 66, 0.06);
  resize: vertical;
  line-height: 1.5;
}

.cm-desc:hover { background: rgba(9, 30, 66, 0.1); }
.cm-desc:focus { outline: none; background: #fff; box-shadow: inset 0 0 0 2px #388bff; min-height: 120px; }
.cm-desc-actions { display: flex; gap: 6px; margin-top: 8px; }

.progress { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.progress-pct { width: 32px; color: var(--text-2); font-size: 11px; }
.progress-track { flex: 1; height: 8px; border-radius: 4px; background: rgba(9, 30, 66, 0.1); overflow: hidden; }
.progress-bar { height: 100%; border-radius: 4px; background: #0c66e4; transition: width 0.25s ease, background 0.25s ease; }
.progress-bar.complete { background: var(--success); }

.checklist { list-style: none; display: flex; flex-direction: column; }

.check-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: -6px;
  padding: 5px 6px;
  border-radius: 6px;
}

.check-item:hover { background: rgba(9, 30, 66, 0.06); }
.check-item input { width: 16px; height: 16px; accent-color: #0c66e4; }
.check-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.check-item.done .check-text { color: var(--text-3); text-decoration: line-through; }
.check-delete { width: 26px; height: 26px; opacity: 0; }
.check-item:hover .check-delete, .check-delete:focus-visible { opacity: 1; }

.checklist-add { display: flex; gap: 6px; margin-top: 8px; }

.checklist-add input {
  flex: 1;
  min-width: 0;
  height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: rgba(9, 30, 66, 0.06);
}

.checklist-add input:focus { outline: none; background: #fff; box-shadow: inset 0 0 0 2px #388bff; }

.cm-side { display: flex; flex-direction: column; gap: 8px; }
.cm-side h4:not(:first-child) { margin-top: 14px; }

.side-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 10px;
  border-radius: 4px;
  background: rgba(9, 30, 66, 0.06);
  color: var(--text);
  font-weight: 500;
  text-align: left;
}

.side-btn:hover { background: rgba(9, 30, 66, 0.12); }
.side-btn svg { color: var(--text-2); }
.side-btn-danger:hover { background: var(--danger); color: #fff; }
.side-btn-danger:hover svg { color: #fff; }

/* =========================================
   GESTIÓN DE USUARIOS Y DIÁLOGOS
========================================= */

a.menu-item { text-decoration: none; }
a.side-link { text-decoration: none; }

.appbar-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--text-2);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
}

.appbar-back:hover { background: var(--surface-2); color: var(--text); }

.users-page { max-width: 880px; margin: 0 auto; padding: 36px 24px 48px; }

.users-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 22px;
}

.users-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.6px; }
.users-head p { margin-top: 4px; color: var(--text-2); }

.users-table {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.users-table .empty-search { padding: 20px; }

.user-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
}

.user-row + .user-row { border-top: 1px solid var(--border); }
.user-row:hover { background: #fafbfc; }

.user-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.user-email { display: flex; align-items: center; gap: 8px; font-weight: 600; overflow-wrap: anywhere; }
.user-meta { color: var(--text-3); font-size: 12px; }

.tag {
  padding: 0 6px;
  border-radius: 4px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
}

.role {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.role-admin { background: #e3f4f2; color: #0e7c7b; }

.user-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; min-width: 236px; }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }

.input-row { display: flex; gap: 8px; }
.input-row input { flex: 1; min-width: 0; font-family: ui-monospace, Consolas, monospace; }

.form-error {
  padding: 9px 12px;
  border-radius: 6px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
}

.pass-dialog { display: flex; flex-direction: column; gap: 14px; }
.pass-title { font-size: 17px; font-weight: 700; }
.pass-sub { margin-top: -8px; color: var(--text-2); font-size: 13px; }

.account-menu hr { margin: 6px 0; border: 0; border-top: 1px solid var(--border); }

/* =========================================
   RESPONSABLES
========================================= */

.avatar-xs { width: 24px; height: 24px; font-size: 11px; }
.avatar-md { width: 32px; height: 32px; font-size: 13px; }

.card-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
  margin-top: 6px;
}

.card-footer .card-badges { margin-top: 0; }
.card-people { display: flex; flex-direction: row-reverse; margin-left: auto; }
.card-people .avatar { margin-left: -4px; box-shadow: 0 0 0 2px var(--surface); }

.cm-assignees { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.cm-assignees .icon-btn { border-radius: 50%; background: rgba(9, 30, 66, 0.06); }

.assignee-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px;
  border-radius: 6px;
  text-align: left;
}

.assignee-option:hover { background: var(--surface-2); }
.assignee-email { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.assignee-option.selected .label-tick { background: #0c66e4; border-color: #0c66e4; color: #fff; }
.popover-hint { margin-top: 8px; color: var(--text-3); font-size: 12px; }

/* =========================================
   NOTIFICACIONES
========================================= */

.notif { position: relative; }

.notif-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--text-2);
  transition: background var(--ease);
}

.notif-btn svg { width: 20px; height: 20px; }
.notif-btn:hover, .notif-btn[aria-expanded="true"] { background: var(--surface-2); color: var(--text); }
.appbar-glass .notif-btn { color: #fff; }
.appbar-glass .notif-btn:hover, .appbar-glass .notif-btn[aria-expanded="true"] { background: rgba(255, 255, 255, 0.2); color: #fff; }

.notif-count {
  position: absolute;
  top: 2px;
  right: 1px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 17px;
  box-shadow: 0 0 0 2px var(--surface);
}

.appbar-glass .notif-count { box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.25); }

.notif-panel {
  position: absolute;
  top: 42px;
  right: -8px;
  z-index: 200;
  width: min(380px, calc(100vw - 16px));
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-sm);
  box-shadow: var(--pop-shadow);
  animation: pop-in 0.12s ease;
  overflow: hidden;
}

.notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.notif-read-all { color: #0c66e4; font-size: 12px; font-weight: 600; }
.notif-read-all:hover { text-decoration: underline; }

.notif-list { max-height: min(70vh, 460px); overflow-y: auto; }

.notif-item {
  position: relative;
  display: flex;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--surface-2);
}

.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: #f0f6ff; }
.notif-item.unread:hover { background: #e4efff; }

.notif-item.unread::after {
  content: "";
  position: absolute;
  top: 16px;
  right: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0c66e4;
}

.notif-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface-3);
  font-size: 14px;
}

.notif-assigned  { background: #e9f2ff; }
.notif-moved     { background: #e3f4f2; color: #0e7c7b; font-weight: 700; }
.notif-completed { background: #dcfff1; color: var(--success); font-weight: 700; }
.notif-due       { background: #fff7d6; }
.notif-overdue   { background: var(--danger-soft); color: var(--danger); }

.notif-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding-right: 14px; }
.notif-msg { font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.notif-meta { display: flex; align-items: center; gap: 5px; color: var(--text-3); font-size: 11px; }
.notif-board { width: 12px; height: 9px; border-radius: 2px; background: var(--board-bg); }
.notif-empty { padding: 28px 14px; color: var(--text-3); text-align: center; font-size: 13px; }

/* =========================================
   MIS TAREAS
========================================= */

.side-count {
  margin-left: auto;
  padding: 0 7px;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.section-sub { margin: -8px 0 18px; color: var(--text-2); font-size: 13px; }

.task-group + .task-group { margin-top: 22px; }

.task-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.task-group-title span {
  padding: 0 7px;
  border-radius: 10px;
  background: var(--surface-3);
  font-size: 11px;
}

.task-group-title.is-overdue { color: var(--danger); }
.task-group-title.is-overdue span { background: var(--danger-soft); }

.task-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 6px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--card-shadow);
  color: var(--text);
  text-decoration: none;
  transition: box-shadow var(--ease);
}

.task-row:hover { box-shadow: 0 0 0 2px #388bff; }
.task-row-board { width: 6px; align-self: stretch; border-radius: 3px; background: var(--board-bg); }
.task-row-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.task-row-title { font-weight: 500; overflow-wrap: anywhere; }
.task-row-meta { color: var(--text-3); font-size: 12px; }

.task-row-due {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
}

.task-row-due.is-overdue { background: var(--danger); color: #fff; }
.task-row-due.is-today { background: var(--label-yellow); color: #533f04; }

/* =========================================
   SELECTOR DE TABLEROS
========================================= */

.appbar-link .chevron { width: 14px; height: 14px; opacity: 0.8; transition: transform var(--ease); }
.appbar-link[aria-expanded="true"] { background: rgba(255, 255, 255, 0.24); }
.appbar-link[aria-expanded="true"] .chevron { transform: rotate(180deg); }

.popover.switcher { width: 320px; padding: 10px; }

.switcher-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 10px;
  border: 2px solid var(--border);
  border-radius: 6px;
  color: var(--text-3);
}

.switcher-search:focus-within { border-color: #388bff; }
.switcher-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; }

.switcher-list {
  max-height: min(60vh, 420px);
  margin: 8px -4px 0;
  padding: 0 4px;
  overflow-y: auto;
}

.switcher-group {
  margin: 10px 6px 4px;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.switcher-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px;
  border-radius: 6px;
  text-align: left;
}

.switcher-item:hover,
.switcher-item.active { background: var(--surface-2); }
.switcher-item.current { background: #e9f2ff; }
.switcher-item.current .switcher-name { color: #0c66e4; font-weight: 600; }

.switcher-thumb {
  width: 40px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 4px;
  background: var(--board-bg);
}

.switcher-name {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.switcher-name small { color: var(--text-3); font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
.switcher-star { color: #e2b203; }
.switcher-empty { padding: 14px 6px; color: var(--text-3); font-size: 13px; }

.switcher-all {
  display: block;
  margin-top: 8px;
  padding: 8px;
  border-top: 1px solid var(--border);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}

.switcher-all:hover { color: var(--text); background: var(--surface-2); border-radius: 0 0 6px 6px; }

.board-canvas.switching { opacity: 0.5; transition: opacity 0.15s ease; }

/* =========================================
   TABLEROS COMPARTIDOS
========================================= */

.board-title.readonly { cursor: default; }
.board-title.readonly:hover { background: transparent; }

.member-stack { display: flex; align-items: center; padding-left: 6px; }
.member-stack:empty { display: none; }
.member-stack .avatar { margin-left: -6px; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85); }

.avatar-sm { width: 28px; height: 28px; font-size: 12px; }
.avatar-owner { background: linear-gradient(135deg, #0b3b46, #0e7c7b); }
.avatar-more { background: rgba(9, 30, 66, 0.55); font-size: 11px; }

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  transition: background var(--ease);
}

.share-btn:hover { background: #fff; }

.share-add { display: flex; gap: 8px; }

.share-add select {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.share-add select:focus { outline: none; border-color: #388bff; }
.share-hint { margin-top: -6px; color: var(--text-2); font-size: 12px; line-height: 1.5; }
.share-subtitle { font-size: 13px; font-weight: 700; color: var(--text-2); }

.member-list { list-style: none; display: flex; flex-direction: column; margin-top: -8px; }

.member-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

.member-item + .member-item { border-top: 1px solid var(--border); }
.member-email { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 500; }

.board-tile-owner {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  opacity: 0.9;
}

.board-tile-owner svg { width: 13px; height: 13px; }

/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 760px) {
  .workspace { flex-direction: column; gap: 20px; padding: 20px 16px 40px; }
  .side-nav { flex-direction: row; width: auto; }
  .appbar .brand span:last-child { display: none; }
  .appbar-search { margin-left: 0; }

  .board-bar { flex-wrap: wrap; padding: 8px 12px; }
  .board-title { max-width: calc(100vw - 120px); font-size: 16px; }
  .bar-spacer { display: none; }
  .bar-filter { order: 5; flex: 1 0 100%; }
  .member-stack { display: none; }
  .share-btn span { display: none; }
  .bar-filter input { width: 100%; }
  .board-canvas { padding: 10px 12px 12px; scroll-snap-type: x proximity; }
  .list, .add-list { flex-basis: min(272px, calc(100vw - 48px)); width: min(272px, calc(100vw - 48px)); scroll-snap-align: start; }

  .modal-overlay { padding: 16px 8px; }
  .modal-card { padding: 16px 14px 20px; }
  .cm-grid { grid-template-columns: 1fr; }
  .cm-main { padding-left: 0; }
  .cm-section-head { margin-left: 0; }
  .cm-side { flex-direction: row; flex-wrap: wrap; }
  .cm-side h4 { flex: 1 0 100%; margin-top: 4px !important; }
  .check-delete { opacity: 1; }
  .tile-star, .tile-delete { opacity: 1; }

  .appbar-back { font-size: 0; gap: 0; }
  .users-page { padding: 24px 16px 40px; }
  .user-row { flex-wrap: wrap; }
  .user-actions { width: 100%; padding-left: 46px; }
}

@media (max-width: 480px) {
  .auth-container { padding: 28px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
