/* ==========================================================================
   Focusly — hoja de estilos única
   Tokens de color y tipografía derivados del diseño "Pomodoro PM".
   ========================================================================== */

/* --- Tokens ------------------------------------------------------------- */
:root {
  --bg: #f5f6f8;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-2: #eef0f3;
  --surface-hover: #e7eaef;
  --border: #e0e3e9;
  --text: #16181d;
  --text-2: #5b6270;
  --text-3: #8b93a1;
  --accent: #5b5bd6;
  --accent-hover: #4949c2;
  --accent-soft: #ecebfd;
  --success: #1a9c6b;
  --success-soft: #e2f6ee;
  --warning: #c47f17;
  --warning-soft: #fdf1de;
  --danger: #d64545;
  --danger-soft: #fbe6e6;
  --info: #2f7fd6;
  --info-soft: #e5f0fc;

  --low-bg: #eef0f3;
  --low-fg: #5b6270;
  --med-bg: #e5f0fc;
  --med-fg: #2f7fd6;
  --high-bg: #fdf1de;
  --high-fg: #a3690f;
  --urgent-bg: #fbe6e6;
  --urgent-fg: #c22f2f;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, .10);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .16);

  --font-sans: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Lexend', var(--font-sans);

  --sidebar-w: 260px;

  --z-sidebar-scrim: 55;
  --z-sidebar: 60;
  --z-topbar: 40;
  --z-fab: 45;
  --z-modal: 70;
}

[data-theme="dark"] {
  --bg: #101115;
  --bg-elevated: #17181e;
  --surface: #1b1c23;
  --surface-2: #212229;
  --surface-hover: #2a2c34;
  --border: #2c2e37;
  --text: #eef0f4;
  --text-2: #a4abb9;
  --text-3: #6d7383;
  --accent: #8886f8;
  --accent-hover: #a09eff;
  --accent-soft: #2a2a54;
  --success: #3fdba0;
  --success-soft: #173229;
  --warning: #e7ab4c;
  --warning-soft: #3a2c14;
  --danger: #f0716e;
  --danger-soft: #3a1f20;
  --info: #6badf2;
  --info-soft: #1b2c40;

  --low-bg: #26272f;
  --low-fg: #a4abb9;
  --med-bg: #1b2c40;
  --med-fg: #6badf2;
  --high-bg: #3a2c14;
  --high-fg: #e7ab4c;
  --urgent-bg: #3a1f20;
  --urgent-fg: #f0716e;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, .5);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, .6);
}

/* --- Base --------------------------------------------------------------- */
* { box-sizing: border-box; }

html, body { height: 100%; }

/* Columna: la barra de demo arriba y la app ocupando el resto exacto. */
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

button { font-family: inherit; }
[hidden] { display: none !important; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

:where(button, a, input, select, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --- Shell -------------------------------------------------------------- */
/* El scroll vive dentro de .content, así el topbar y el sidebar quedan siempre
   visibles. `min-height:0` permite que el flex hijo se encoja de verdad. */
.app {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

/* --- Barra de demo ------------------------------------------------------ */
.demo-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 16px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  line-height: 1.35;
}
.demo-bar__text { flex: 1; min-width: 0; }
.demo-bar__cta {
  flex-shrink: 0;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  padding: 5px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .18);
  white-space: nowrap;
}
.demo-bar__cta:hover { background: rgba(255, 255, 255, .3); }
.demo-bar__close {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  color: #fff;
  opacity: .75;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 4px 6px;
}
.demo-bar__close:hover { opacity: 1; }
.demo-bar :focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* --- Conmutador de vista previa ------------------------------------------
   Solo tiene sentido en pantallas grandes: sirve para enseñar la app en otros
   tamaños sin redimensionar la ventana. En un móvil real sobra. */
.vp-switch {
  display: none;
  gap: 2px;
  padding: 2px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .18);
  flex-shrink: 0;
}
.vp-switch__btn {
  border: 0;
  background: transparent;
  color: #fff;
  opacity: .8;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
}
.vp-switch__btn:hover { opacity: 1; }
.vp-switch__btn.is-active {
  background: #fff;
  color: var(--accent);
  opacity: 1;
}

@media (min-width: 1000px) {
  .vp-switch { display: flex; }
}

/* --- Marco de vista previa ----------------------------------------------- */
.vp-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--surface-2);
}
.vp-stage__frame {
  height: 100%;
  max-height: 100%;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--bg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.vp-stage__frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
.vp-stage__label {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11.5px;
  color: var(--text-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
}

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 15, .5);
  border: 0;
  padding: 0;
}
.scrim--sidebar { z-index: var(--z-sidebar-scrim); }
.scrim--modal {
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* El padding inferior extra reserva sitio para el widget flotante del Pomodoro. */
.content { flex: 1; overflow-y: auto; padding: 24px 24px 96px; }

.view { animation: fadeIn .15s ease; }

/* --- Sidebar ------------------------------------------------------------ */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: width .18s ease, transform .2s ease;
}
.sidebar.is-collapsed { --sidebar-w: 76px; }

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar__logo {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  flex-shrink: 0;
}
.sidebar__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar__nav { padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; }
.sidebar__scroll { padding: 8px 10px; overflow-y: auto; flex: 1; }
.sidebar__footer { padding: 10px; border-top: 1px solid var(--border); }

/* Elementos que desaparecen al colapsar */
.sidebar.is-collapsed .sidebar__name,
.sidebar.is-collapsed .sidebar__scroll,
.sidebar.is-collapsed .nav-item__label { display: none; }
.sidebar.is-collapsed .sidebar__nav { align-items: stretch; }
.sidebar.is-collapsed .nav-item { justify-content: center; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
}
.nav-item:hover { background: var(--surface-hover); color: var(--text); }
.nav-item.is-active { background: var(--accent-soft); color: var(--accent); }
.nav-item__icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.nav-item__label { white-space: nowrap; overflow: hidden; }

.side-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 8px 6px;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.side-heading--spaced { padding-top: 14px; }
.side-heading__title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-3);
}
.side-heading__chevron { color: var(--text-3); }

.project-row {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  font-size: 13px;
  text-align: left;
}
.project-row:hover { background: var(--surface-hover); }
.project-row.is-active { background: var(--surface-hover); }
.project-row__dot {
  width: 8px; height: 8px;
  border-radius: 3px;
  background: var(--c, var(--accent));
  flex-shrink: 0;
}
.project-row__name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-row__count { font-size: 11px; color: var(--text-3); }

.member-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
}
.member-row__name {
  font-size: 13px;
  color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.btn-collapse {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  font-size: 13px;
}
.btn-collapse:hover { background: var(--surface-hover); color: var(--text); }

/* --- Avatares ----------------------------------------------------------- */
.avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--c, var(--accent));
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.avatar--xs { width: 22px; height: 22px; font-size: 9.5px; }
.avatar--sm { width: 24px; height: 24px; font-size: 10px; }
.avatar--md { width: 26px; height: 26px; font-size: 11px; }
.avatar--lg { width: 42px; height: 42px; font-size: 14px; }

/* --- Topbar ------------------------------------------------------------- */
.topbar {
  height: 64px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  position: relative;
  z-index: var(--z-topbar);
}
.topbar__spacer { flex: 1; }

.icon-btn {
  position: relative;
  border: none;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  padding: 8px;
  display: flex;
  border-radius: 8px;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.topbar__burger { color: var(--text); padding: 6px; }

.badge-dot {
  position: absolute;
  top: 5px; right: 5px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--bg-elevated);
}

.search { position: relative; flex: 1; max-width: 360px; }
.search__icon {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  display: flex;
  pointer-events: none;
}
.search__input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  outline: none;
  font-family: inherit;
}
.search__input:focus { border-color: var(--accent); }

.switch {
  width: 40px; height: 24px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}
.switch__knob {
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: left .15s ease;
}
.switch.is-on .switch__knob { left: 18px; }

.avatar-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
}

/* --- Botones ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  background: transparent;
  color: var(--text);
}
.btn__icon { display: flex; }
.btn--primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn--outline { border-color: var(--border); background: var(--surface); color: var(--text-2); }
.btn--outline:hover { background: var(--surface-hover); color: var(--text); }
.btn--link { border: 0; color: var(--accent); font-size: 12.5px; padding: 0; }
.btn--square {
  width: 32px; height: 32px;
  padding: 0;
  justify-content: center;
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}
.btn--block { width: 100%; justify-content: center; padding: 11px; font-size: 13.5px; }

/* --- Dropdowns ---------------------------------------------------------- */
.dd { position: relative; }

.menu {
  position: absolute;
  right: 0; top: 44px;
  width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  animation: fadeIn .12s ease;
}
.menu__item {
  width: 100%;
  text-align: left;
  padding: 9px 10px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
}
.menu__item:hover { background: var(--surface-2); }
.menu__item--muted { color: var(--text-3); }
.menu__item--danger { color: var(--danger); }
.menu__head { padding: 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.menu__name { font-weight: 700; font-size: 13px; }
.menu__mail { font-size: 12px; color: var(--text-3); }
.menu--user { width: 210px; }

.notif-panel {
  position: absolute;
  right: 0; top: 44px;
  width: 340px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  animation: fadeIn .12s ease;
}
.notif-panel__head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 13px;
}
.notif { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--border); }
.notif:last-child { border-bottom: 0; }
.notif__icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.notif__body { min-width: 0; }
.notif__text { font-size: 12.5px; color: var(--text); line-height: 1.4; }
.notif__time { font-size: 11px; color: var(--text-3); margin-top: 3px; }

/* Canales (color de icono por canal) */
.chan-email { background: var(--info-soft); color: var(--info); }
.chan-sms { background: var(--warning-soft); color: var(--warning); }
.chan-whatsapp { background: var(--success-soft); color: var(--success); }
.chan-system { background: var(--surface-2); color: var(--text-2); }

/* --- Cabeceras de página ------------------------------------------------ */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.page-title { font-family: var(--font-display); font-size: 20px; margin: 0; }
.page-title--hero { font-size: 23px; margin-bottom: 4px; }
.page-sub { color: var(--text-2); margin: 0 0 22px; font-size: 14px; }
.page-sub--tight { font-size: 13px; margin-bottom: 18px; }

/* --- Paneles y tarjetas ------------------------------------------------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
}
.panel--lg { border-radius: 16px; padding: 20px; }
.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.panel__title { margin: 0; font-size: 15px; font-family: var(--font-display); }
.panel__title--sm { font-size: 14px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-grid--sm { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 20px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.stat-card__label { font-size: 12px; color: var(--text-3); margin-bottom: 8px; }
.stat-card__value { font-family: var(--font-display); font-size: 24px; font-weight: 700; }
.stat-card__value--sm { font-size: 22px; }

.dash-grid { display: grid; gap: 18px; grid-template-columns: 1.3fr 1fr; }
.dash-grid--reports { grid-template-columns: 1.4fr 1fr; gap: 16px; }
.dash-grid--focus { grid-template-columns: 1fr 1fr; gap: 20px; }

/* --- Chips / etiquetas -------------------------------------------------- */
.chip {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 20px;
  font-weight: 600;
  flex-shrink: 0;
  white-space: nowrap;
}
.chip--sm { font-size: 10.5px; padding: 2px 7px; font-weight: 700; }
.chip--lg { font-size: 11px; padding: 3px 9px; font-weight: 700; }
.chip--status { background: var(--surface-2); color: var(--text-2); font-weight: 600; }

[data-priority="low"]    { background: var(--low-bg);    color: var(--low-fg); }
[data-priority="medium"] { background: var(--med-bg);    color: var(--med-fg); }
[data-priority="high"]   { background: var(--high-bg);   color: var(--high-fg); }
[data-priority="urgent"] { background: var(--urgent-bg); color: var(--urgent-fg); }

.tag {
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 20px;
  background: var(--surface-2);
  color: var(--text-2);
}

.count-pill {
  font-size: 11px;
  color: var(--text-3);
  background: var(--surface);
  padding: 2px 7px;
  border-radius: 20px;
}

.due { font-weight: 600; }
.due[data-due="overdue"]  { color: var(--danger); }
.due[data-due="today"]    { color: var(--warning); }
.due[data-due="tomorrow"] { color: var(--info); }
.due[data-due="future"]   { color: var(--text-3); }

.is-done { text-decoration: line-through; color: var(--text-3); }

.check {
  width: 16px; height: 16px;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}

/* --- Filas de tareas ---------------------------------------------------- */
.task-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 6px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.task-row:last-child { border-bottom: 0; }
.task-row:hover { background: var(--surface-2); }
.task-row__title { flex: 1; font-size: 13.5px; min-width: 0; }

.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-top: 1px solid var(--border);
  cursor: pointer;
}
.list-row:hover { background: var(--surface-2); }
.list-row__title {
  flex: 1;
  font-size: 13.5px;
  min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.list-row__due { font-size: 12px; width: 88px; flex-shrink: 0; }

.empty { font-size: 13px; color: var(--text-3); padding: 14px 6px; }

/* --- Progreso ----------------------------------------------------------- */
.progress-row { margin-bottom: 14px; }
.progress-row:last-child { margin-bottom: 0; }
.progress-row__head {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  margin-bottom: 6px;
}
.progress-row__name { color: var(--text); font-weight: 600; }
.progress-row__pct { color: var(--text-3); }
.progress {
  height: 6px;
  border-radius: 6px;
  background: var(--surface-2);
  overflow: hidden;
}
.progress__bar {
  height: 100%;
  border-radius: 6px;
  background: var(--c, var(--accent));
  width: var(--pct, 0%);
}

/* --- Kanban ------------------------------------------------------------- */
.board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.board__col {
  min-width: 270px;
  width: 270px;
  flex-shrink: 0;
  background: var(--surface-2);
  border-radius: 12px;
  padding: 12px;
}
.board__col.is-dropping { outline: 2px dashed var(--accent); outline-offset: -2px; }
.board__col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 0 4px;
}
.board__col-label { font-size: 12.5px; font-weight: 700; color: var(--text-2); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 9px;
  cursor: grab;
  box-shadow: var(--shadow-sm);
}
.card:last-child { margin-bottom: 0; }
.card.is-dragging { opacity: .45; }
.card__tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.card__title { font-size: 13.5px; font-weight: 600; margin-bottom: 10px; line-height: 1.35; }
.card__foot { display: flex; align-items: center; justify-content: space-between; }

/* --- Lista agrupada ----------------------------------------------------- */
.group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
}
.group__head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  border: 0;
  cursor: pointer;
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
}
.group__chevron { color: var(--text-3); }
.group__dot { width: 8px; height: 8px; border-radius: 3px; background: var(--c, var(--accent)); }
.group__name { font-weight: 700; font-size: 13.5px; flex: 1; }
.group__count { font-size: 11.5px; color: var(--text-3); }

/* --- Calendario --------------------------------------------------------- */
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal-week { margin-bottom: 8px; }
.cal-weekday {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
}
.cal-cell {
  padding: 8px;
  min-height: 64px;
  border-radius: 9px;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  text-align: left;
  display: block;
}
.cal-cell--today { background: var(--accent-soft); }
.cal-cell--outside { opacity: .4; }
.cal-cell.is-selected { border-color: var(--accent); }
.cal-cell__num { font-size: 12px; font-weight: 600; margin-bottom: 5px; }
.cal-dot {
  width: 100%; height: 4px;
  border-radius: 3px;
  background: var(--c, var(--accent));
  margin-bottom: 3px;
}

.day-panel {
  margin-top: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.day-panel__title { margin: 0 0 10px; font-size: 14px; font-family: var(--font-display); }
.day-task {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  cursor: pointer;
  width: 100%;
  border-left: 0; border-right: 0; border-bottom: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}
.day-task__dot { width: 8px; height: 8px; border-radius: 3px; background: var(--c); flex-shrink: 0; }
.day-task__title { font-size: 13px; flex: 1; }
.day-task__project { font-size: 11px; color: var(--text-3); }

/* --- Cronograma --------------------------------------------------------- */
.timeline { overflow-x: auto; }
.timeline__inner { min-width: 640px; }
.timeline__weeks { display: flex; padding-left: 160px; margin-bottom: 10px; }
.timeline__week { flex: 1; font-size: 11px; color: var(--text-3); font-weight: 600; }
.timeline__row { display: flex; align-items: center; margin-bottom: 14px; }
.timeline__row:last-child { margin-bottom: 0; }
.timeline__label {
  width: 160px;
  flex-shrink: 0;
  font-size: 12.5px;
  font-weight: 600;
  padding-right: 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.timeline__track {
  flex: 1;
  position: relative;
  height: 22px;
  background: var(--surface-2);
  border-radius: 6px;
}
.timeline__bar {
  position: absolute;
  top: 0;
  height: 100%;
  left: var(--left, 0%);
  width: var(--width, 10%);
  background: var(--c, var(--accent));
  border-radius: 6px;
  display: flex;
  align-items: center;
  padding: 0 8px;
}
.timeline__bar-text {
  font-size: 10.5px;
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
}

/* --- Pomodoro ----------------------------------------------------------- */
.focus-wrap { max-width: 920px; margin: 0 auto; }

.timer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.seg {
  display: flex;
  gap: 6px;
  background: var(--surface-2);
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 22px;
}
.seg__btn {
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  background: transparent;
  color: var(--text-3);
}
.seg__btn.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.dial { position: relative; width: 220px; height: 220px; }
.dial__svg { transform: rotate(-90deg); }
.dial__track { fill: none; stroke: var(--surface-2); stroke-width: 14; }
.dial__ring {
  fill: none;
  stroke: var(--accent);
  stroke-width: 14;
  stroke-linecap: round;
  transition: stroke-dashoffset .4s linear;
}
.dial__center {
  position: absolute;
  inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.dial__time {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 700;
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
}
.dial__mode {
  font-size: 12px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: 4px;
}

.timer-controls { display: flex; gap: 10px; margin-top: 24px; }
.timer-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.timer-btn:hover { background: var(--surface-hover); color: var(--text); }
.timer-btn--main {
  width: 64px; height: 64px;
  border: none;
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-md);
}
.timer-btn--main:hover { background: var(--accent-hover); color: #fff; }

.field { margin-top: 22px; width: 100%; }
.field__label {
  font-size: 11.5px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .05em;
  display: block;
}
.field__label--modal {
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 6px;
}

.input, .select {
  width: 100%;
  padding: 9px 10px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}
.select { margin-top: 6px; }
.input--modal { padding: 10px 12px; font-size: 13.5px; }
.select--modal { margin-top: 0; font-size: 13.5px; }

.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--text-2);
  width: 100%;
  cursor: pointer;
}
.check-line input { accent-color: var(--accent); }

.side-stack { display: flex; flex-direction: column; gap: 16px; }

.sessions__count {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
}
.session-dots { display: flex; gap: 5px; }
.session-dot { width: 14px; height: 14px; border-radius: 4px; background: var(--surface-2); }
.session-dot.is-on { background: var(--accent); }

.channel-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}
.channel-row__icon {
  width: 26px; height: 26px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.channel-row__label { flex: 1; font-size: 13px; }

.toggle {
  width: 36px; height: 20px;
  border-radius: 20px;
  border: none;
  background: var(--surface-2);
  position: relative;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.toggle.is-on { background: var(--accent); }
.toggle__knob {
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: left .12s ease;
}
.toggle.is-on .toggle__knob { left: 18px; }

/* --- Reportes ----------------------------------------------------------- */
.bars { display: flex; align-items: flex-end; gap: 12px; height: 160px; }
.bar-col {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; gap: 8px;
  height: 100%;
  justify-content: flex-end;
}
.bar {
  width: 100%;
  max-width: 34px;
  border-radius: 6px 6px 0 0;
  background: var(--accent);
  height: var(--h, 0%);
  min-height: 2px;
}
.bar__label { font-size: 11px; color: var(--text-3); }

.donut {
  width: 150px; height: 150px;
  border-radius: 50%;
  margin: 0 auto 16px;
  background: var(--donut, var(--surface-2));
}
.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  padding: 4px 0;
}
.legend-dot { width: 9px; height: 9px; border-radius: 3px; background: var(--c); flex-shrink: 0; }
.legend-row__name { flex: 1; }
.legend-row__pct { color: var(--text-3); }

/* --- Equipo ------------------------------------------------------------- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}
.member-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
}
.member-card__head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.member-card__name {
  font-weight: 700;
  font-size: 13.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.member-card__role { font-size: 12px; color: var(--text-3); }
.member-card__meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 6px;
}

/* --- Widget flotante ---------------------------------------------------- */
.fab-timer {
  position: fixed;
  bottom: 22px; right: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  border-radius: 50px;
  padding: 10px 18px 10px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  z-index: var(--z-fab);
  color: var(--text);
}
.fab-timer__icon {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.fab-timer__time {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.fab-timer__sub { font-size: 10.5px; color: var(--text-3); margin-top: 3px; text-align: left; }

/* --- Modales ------------------------------------------------------------ */
.modal {
  background: var(--surface);
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  padding: 24px;
  box-shadow: var(--shadow-lg);
}
.modal--task { max-width: 520px; max-height: 86vh; overflow-y: auto; }
.modal__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.modal__head--start { align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.modal__title { margin: 0; font-family: var(--font-display); font-size: 17px; }
.modal__close {
  border: none;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 2px 4px;
}
.modal__close:hover { color: var(--text); }
.modal__row { display: flex; gap: 12px; margin-bottom: 14px; }
.modal__col { flex: 1; }
.modal__actions { display: flex; gap: 10px; }
.modal__field { margin-bottom: 14px; }

.chan-picks { display: flex; gap: 8px; margin-bottom: 20px; }
.chan-pick {
  flex: 1;
  padding: 9px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
}
.chan-pick.is-on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

.form-error { font-size: 12px; color: var(--danger); margin: 0 0 12px; }

.detail__title { margin: 0 0 6px; font-family: var(--font-display); font-size: 19px; }
.detail__meta { font-size: 12.5px; color: var(--text-3); margin: 0 0 16px; }
.detail__desc { font-size: 13.5px; color: var(--text-2); line-height: 1.6; margin: 0 0 18px; }
.detail__chips { display: flex; gap: 6px; flex-wrap: wrap; }
.detail__assignee { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.detail__assignee-name { font-size: 13px; color: var(--text-2); }
.detail__spacer { flex: 1; }
.detail__pomos { font-size: 12px; color: var(--text-3); }
.detail__tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }

/* --- Responsive --------------------------------------------------------- */
/* --- Escritorio: 901px en adelante -------------------------------------- */
@media (min-width: 901px) {
  .topbar__burger { display: none; }
  .sidebar { transform: none !important; }
}

/* --- Tablet: 701–900px ---------------------------------------------------
   Hay ancho de sobra para dos columnas, pero no para el sidebar completo.
   Queda fijo en modo iconos: navegación siempre a la vista, sin robar espacio. */
@media (min-width: 701px) and (max-width: 900px) {
  .topbar__burger { display: none; }

  .sidebar {
    --sidebar-w: 76px;
    transform: none !important;
  }
  .sidebar .sidebar__name,
  .sidebar .sidebar__scroll,
  .sidebar .nav-item__label { display: none; }
  .sidebar .nav-item { justify-content: center; }
  .btn-collapse { display: none; }

  /* El Pomodoro se lee mejor a una columna: el dial necesita su espacio. */
  .dash-grid, .dash-grid--reports { grid-template-columns: 1fr 1fr; }
  .dash-grid--focus { grid-template-columns: 1fr; }
  .timer-card { padding: 24px; }

  /* 2×2 en lugar de 3+1, que dejaba la cuarta métrica sola con dos huecos. */
  .stat-grid, .stat-grid--sm { grid-template-columns: repeat(2, 1fr); }
  .team-grid { grid-template-columns: repeat(2, 1fr); }

  .content { padding: 20px 20px 96px; }
  .search { max-width: 280px; }
}

/* --- Móvil: hasta 700px -------------------------------------------------- */
@media (max-width: 700px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0;
    z-index: var(--z-sidebar);
    height: 100vh;
    transform: translateX(-100%);
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar.is-collapsed { --sidebar-w: 260px; }
  .sidebar.is-collapsed .sidebar__name,
  .sidebar.is-collapsed .sidebar__scroll,
  .sidebar.is-collapsed .nav-item__label { display: revert; }
  .sidebar.is-collapsed .nav-item { justify-content: flex-start; }
  .btn-collapse { display: none; }

  .dash-grid, .dash-grid--reports, .dash-grid--focus { grid-template-columns: 1fr; }
  .content { padding: 16px 16px 96px; }
  .search { max-width: none; }
  .notif-panel { width: min(340px, calc(100vw - 32px)); }
}

@media (max-width: 760px) {
  /* En pantallas estrechas el aviso se reduce a lo esencial. */
  .demo-bar { gap: 8px; padding: 8px 12px; font-size: 12px; }
  .demo-bar__detail { display: none; }
  .demo-bar__cta { padding: 5px 10px; }
}

@media (max-width: 560px) {
  .topbar { gap: 8px; padding: 0 12px; }
  .btn--primary .btn__label { display: none; }
  .list-row__due { display: none; }
  .cal-week, .cal-grid { gap: 4px; }
  .cal-cell { min-height: 52px; padding: 5px; }
}
