/*
 * Produccion - capa visual del gestor de proyectos.
 * Este archivo se carga despues de Bulma y conserva sus componentes/ayudas.
 */

:root {
  --app-primary: #5b5bd6;
  --app-primary-rgb: 91, 91, 214;
  --app-primary-dark: #4646b8;
  --app-primary-soft: #eeeeff;
  --app-accent: #19a7a0;
  --app-success: #19956a;
  --app-success-soft: #e7f8f1;
  --app-warning: #d98a15;
  --app-warning-soft: #fff5df;
  --app-danger: #d94c64;
  --app-danger-soft: #fff0f3;
  --app-info: #2e79c7;
  --app-info-soft: #eaf4ff;
  --app-ink: #172033;
  --app-text: #465168;
  --app-muted: #7a8499;
  --app-border: #e4e8f0;
  --app-border-strong: #d7dce7;
  --app-surface: #ffffff;
  --app-canvas: #f5f7fb;
  --app-sidebar: #151a2d;
  --app-sidebar-2: #1d2440;
  --app-sidebar-text: #c8cee1;
  --app-radius-sm: 10px;
  --app-radius: 16px;
  --app-radius-lg: 24px;
  --app-shadow-sm: 0 1px 2px rgba(21, 28, 48, 0.04), 0 4px 14px rgba(21, 28, 48, 0.04);
  --app-shadow: 0 12px 34px rgba(28, 38, 66, 0.09);
  --app-shadow-lg: 0 24px 64px rgba(21, 28, 48, 0.18);
  --app-sidebar-width: 270px;
  --app-topbar-height: 72px;
  --app-transition: 180ms ease;
}

html {
  background: var(--app-canvas);
  color: var(--app-ink);
  min-width: 320px;
  overflow-y: auto;
}

body {
  background: var(--app-canvas);
  color: var(--app-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.9375rem;
  min-height: 100vh;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.is-modal-open,
body.is-sidebar-open {
  overflow: hidden;
}

a {
  color: var(--app-primary);
  transition: color var(--app-transition), opacity var(--app-transition);
}

a:hover {
  color: var(--app-primary-dark);
}

::selection {
  background: rgba(var(--app-primary-rgb), 0.18);
  color: var(--app-ink);
}

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

/* Estructura principal */
.app-shell,
.app-layout {
  display: grid;
  grid-template-columns: var(--app-sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.app-sidebar,
[data-sidebar] {
  background:
    radial-gradient(circle at 15% 0%, rgba(105, 105, 230, 0.22), transparent 32%),
    linear-gradient(180deg, var(--app-sidebar-2) 0%, var(--app-sidebar) 100%);
  color: var(--app-sidebar-text);
  display: flex;
  flex-direction: column;
  height: 100vh;
  inset: 0 auto 0 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 1.35rem 1rem;
  position: sticky;
  top: 0;
  width: var(--app-sidebar-width);
  z-index: 40;
}

.app-brand {
  align-items: center;
  color: #fff;
  display: flex;
  gap: 0.75rem;
  min-height: 44px;
  padding: 0 0.55rem;
}

.app-brand:hover {
  color: #fff;
}

.app-brand-mark {
  align-items: center;
  background: linear-gradient(135deg, #7d7df1, #4f4fca);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 13px;
  box-shadow: 0 8px 24px rgba(20, 22, 52, 0.34);
  color: #fff;
  display: inline-flex;
  flex: 0 0 42px;
  font-size: 1.05rem;
  font-weight: 800;
  height: 42px;
  justify-content: center;
  letter-spacing: -0.04em;
}

.app-brand-copy {
  line-height: 1.12;
  min-width: 0;
}

.app-brand-name {
  color: #fff;
  display: block;
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.app-brand-label {
  color: #969fbf;
  display: block;
  font-size: 0.69rem;
  letter-spacing: 0.08em;
  margin-top: 0.2rem;
  text-transform: uppercase;
}

.app-sidebar .menu {
  flex: 1;
  margin-top: 2rem;
}

.app-sidebar .menu-label,
[data-sidebar] .menu-label {
  color: #7d87a8;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin: 1.5rem 0.7rem 0.55rem;
  text-transform: uppercase;
}

.app-sidebar .menu-list a,
[data-sidebar] .menu-list a,
.app-nav-link {
  align-items: center;
  border-radius: 11px;
  color: var(--app-sidebar-text);
  display: flex;
  font-size: 0.88rem;
  font-weight: 600;
  gap: 0.75rem;
  margin: 0.18rem 0;
  min-height: 44px;
  padding: 0.68rem 0.75rem;
  position: relative;
  transition: background var(--app-transition), color var(--app-transition), transform var(--app-transition);
}

.app-sidebar .menu-list a:hover,
[data-sidebar] .menu-list a:hover,
.app-nav-link:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  transform: translateX(2px);
}

.app-sidebar .menu-list a.is-active,
[data-sidebar] .menu-list a.is-active,
.app-nav-link.is-active,
.app-nav-link[aria-current="page"] {
  background: linear-gradient(90deg, rgba(112, 112, 234, 0.3), rgba(112, 112, 234, 0.12));
  color: #fff;
}

.app-sidebar .menu-list a.is-active::before,
[data-sidebar] .menu-list a.is-active::before,
.app-nav-link.is-active::before,
.app-nav-link[aria-current="page"]::before {
  background: #8b8bf3;
  border-radius: 0 5px 5px 0;
  content: "";
  height: 22px;
  left: -1rem;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
}

.app-nav-icon {
  align-items: center;
  color: #8f99ba;
  display: inline-flex;
  flex: 0 0 20px;
  font-size: 1rem;
  justify-content: center;
  width: 20px;
}

.is-active > .app-nav-icon,
[aria-current="page"] > .app-nav-icon {
  color: #aaaaf8;
}

.app-nav-count {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  color: #dce0ee;
  font-size: 0.66rem;
  margin-left: auto;
  min-width: 24px;
  padding: 0.18rem 0.45rem;
  text-align: center;
}

.app-sidebar-user {
  align-items: center;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  display: flex;
  gap: 0.65rem;
  margin-top: 1.2rem;
  padding: 0.7rem;
}

.app-avatar {
  align-items: center;
  background: linear-gradient(135deg, #7777e6, #4f4fc2);
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 750;
  height: 36px;
  justify-content: center;
  letter-spacing: 0.02em;
  overflow: hidden;
  text-transform: uppercase;
  width: 36px;
}

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

.app-avatar.is-small {
  font-size: 0.61rem;
  height: 28px;
  width: 28px;
}

.app-avatar.is-large {
  font-size: 1rem;
  height: 52px;
  width: 52px;
}

.app-user-copy {
  line-height: 1.25;
  min-width: 0;
}

.app-user-name {
  color: #f4f5fb;
  display: block;
  font-size: 0.8rem;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-user-role {
  color: #929bb7;
  display: block;
  font-size: 0.67rem;
  margin-top: 0.12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-content,
.app-main {
  min-width: 0;
}

.app-topbar {
  align-items: center;
  backdrop-filter: blur(14px);
  background: rgba(245, 247, 251, 0.88);
  border-bottom: 1px solid rgba(225, 229, 238, 0.9);
  display: flex;
  gap: 1rem;
  height: var(--app-topbar-height);
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 30;
}

.app-main-inner,
.app-page {
  margin: 0 auto;
  max-width: 1500px;
  padding: 2rem;
  width: 100%;
}

.app-sidebar-toggle {
  align-items: center;
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  color: var(--app-ink);
  cursor: pointer;
  display: none;
  height: 40px;
  justify-content: center;
  width: 40px;
}

.app-sidebar-backdrop,
[data-sidebar-backdrop] {
  background: rgba(12, 16, 31, 0.58);
  inset: 0;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  transition: opacity var(--app-transition);
  z-index: 35;
}

/* Titulos y superficies */
.app-page-header {
  align-items: flex-end;
  display: flex;
  gap: 1.25rem;
  justify-content: space-between;
  margin-bottom: 1.6rem;
}

.app-page-header .title,
.app-page-title {
  color: var(--app-ink);
  font-size: clamp(1.55rem, 2vw, 2rem);
  letter-spacing: -0.035em;
  line-height: 1.15;
  margin-bottom: 0.35rem !important;
}

.app-page-subtitle {
  color: var(--app-muted);
  line-height: 1.55;
  margin: 0;
  max-width: 720px;
}

.app-eyebrow {
  color: var(--app-primary);
  display: block;
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  margin-bottom: 0.42rem;
  text-transform: uppercase;
}

.box,
.card,
.app-surface {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-sm);
}

.box,
.app-surface {
  background: var(--app-surface);
}

.card {
  background: var(--app-surface);
  overflow: hidden;
}

.card-header {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid var(--app-border);
  box-shadow: none;
  min-height: 62px;
}

.card-header-title {
  color: var(--app-ink);
  font-size: 0.95rem;
  font-weight: 700;
}

.card-content {
  padding: 1.35rem;
}

.app-divider {
  background: var(--app-border);
  border: 0;
  height: 1px;
  margin: 1.2rem 0;
}

/* Resumen de proyecto */
.project-hero,
.project-overview {
  background:
    radial-gradient(circle at 85% 10%, rgba(255, 255, 255, 0.16), transparent 28%),
    linear-gradient(128deg, #4b4bbd 0%, #6262d8 58%, #4e8fc8 100%);
  border: 0;
  border-radius: var(--app-radius-lg);
  box-shadow: 0 20px 46px rgba(69, 69, 172, 0.22);
  color: rgba(255, 255, 255, 0.82);
  overflow: hidden;
  padding: clamp(1.5rem, 3vw, 2.4rem);
  position: relative;
}

.project-hero::after,
.project-overview::after {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  content: "";
  height: 260px;
  position: absolute;
  right: -90px;
  top: -105px;
  width: 260px;
}

.project-hero .title,
.project-hero .subtitle,
.project-overview .title,
.project-overview .subtitle {
  color: #fff;
}

.project-hero .subtitle,
.project-overview .subtitle {
  opacity: 0.8;
}

.project-hero-header {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.project-progress-copy {
  align-items: baseline;
  display: flex;
  gap: 0.55rem;
  margin-top: 1.5rem;
  position: relative;
  z-index: 1;
}

.project-progress-value {
  color: #fff;
  font-size: 2rem;
  font-weight: 780;
  letter-spacing: -0.05em;
  line-height: 1;
}

.project-progress-label {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
  font-weight: 600;
}

.project-meta {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.25rem;
  margin-top: 1.15rem;
  position: relative;
  z-index: 1;
}

.project-meta-item {
  align-items: center;
  color: rgba(255, 255, 255, 0.77);
  display: inline-flex;
  font-size: 0.75rem;
  gap: 0.4rem;
}

/* Progreso Bulma personalizado */
.progress {
  appearance: none;
  background-color: #e9ecf3;
  border: 0;
  border-radius: 999px;
  height: 0.58rem;
  overflow: hidden;
}

.progress::-webkit-progress-bar {
  background-color: #e9ecf3;
  border-radius: 999px;
}

.progress::-webkit-progress-value {
  background: linear-gradient(90deg, var(--app-primary), #7474e7);
  border-radius: 999px;
  transition: width 320ms ease;
}

.progress::-moz-progress-bar {
  background: linear-gradient(90deg, var(--app-primary), #7474e7);
  border-radius: 999px;
  transition: width 320ms ease;
}

.progress.is-success::-webkit-progress-value { background: var(--app-success); }
.progress.is-success::-moz-progress-bar { background: var(--app-success); }
.progress.is-warning::-webkit-progress-value { background: var(--app-warning); }
.progress.is-warning::-moz-progress-bar { background: var(--app-warning); }
.progress.is-danger::-webkit-progress-value { background: var(--app-danger); }
.progress.is-danger::-moz-progress-bar { background: var(--app-danger); }
.progress.is-info::-webkit-progress-value { background: var(--app-info); }
.progress.is-info::-moz-progress-bar { background: var(--app-info); }

.project-hero .progress,
.project-overview .progress {
  background-color: rgba(255, 255, 255, 0.22);
  height: 0.72rem;
  margin: 0.75rem 0 0;
  position: relative;
  z-index: 1;
}

.project-hero .progress::-webkit-progress-bar,
.project-overview .progress::-webkit-progress-bar {
  background-color: rgba(255, 255, 255, 0.22);
}

.project-hero .progress::-webkit-progress-value,
.project-overview .progress::-webkit-progress-value {
  background: #fff;
}

.project-hero .progress::-moz-progress-bar,
.project-overview .progress::-moz-progress-bar {
  background: #fff;
}

/* Metricas */
.app-stats-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 1.25rem 0;
}

.app-stat-card {
  align-items: center;
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-sm);
  display: flex;
  gap: 0.9rem;
  min-height: 104px;
  padding: 1rem;
}

.app-stat-icon {
  align-items: center;
  background: var(--app-primary-soft);
  border-radius: 13px;
  color: var(--app-primary);
  display: inline-flex;
  flex: 0 0 44px;
  font-size: 1.05rem;
  height: 44px;
  justify-content: center;
}

.app-stat-icon.is-success { background: var(--app-success-soft); color: var(--app-success); }
.app-stat-icon.is-warning { background: var(--app-warning-soft); color: var(--app-warning); }
.app-stat-icon.is-danger { background: var(--app-danger-soft); color: var(--app-danger); }

.app-stat-value {
  color: var(--app-ink);
  display: block;
  font-size: 1.45rem;
  font-weight: 770;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.app-stat-label {
  color: var(--app-muted);
  display: block;
  font-size: 0.72rem;
  margin-top: 0.28rem;
}

/* Tarjetas de proyectos */
.project-grid {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.project-card {
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-sm);
  color: inherit;
  display: flex;
  flex-direction: column;
  min-height: 245px;
  overflow: hidden;
  position: relative;
  transition: border-color var(--app-transition), box-shadow var(--app-transition), transform var(--app-transition);
}

.project-card:hover {
  border-color: rgba(var(--app-primary-rgb), 0.32);
  box-shadow: var(--app-shadow);
  color: inherit;
  transform: translateY(-3px);
}

.project-card::before {
  background: var(--project-color, var(--app-primary));
  content: "";
  height: 4px;
  inset: 0 0 auto;
  position: absolute;
}

.project-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1.25rem;
}

.project-card-top {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.project-card-title {
  color: var(--app-ink);
  font-size: 1rem;
  font-weight: 730;
  letter-spacing: -0.02em;
  line-height: 1.35;
  margin: 0;
}

.project-card-description {
  color: var(--app-muted);
  display: -webkit-box;
  font-size: 0.78rem;
  line-height: 1.55;
  margin-top: 0.55rem;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.project-card-progress {
  margin-top: auto;
  padding-top: 1.15rem;
}

.project-progress-row {
  align-items: center;
  color: var(--app-muted);
  display: flex;
  font-size: 0.7rem;
  justify-content: space-between;
  margin-bottom: 0.45rem;
}

.project-progress-row strong {
  color: var(--app-ink);
  font-size: 0.75rem;
}

.project-card-footer {
  align-items: center;
  background: #fafbfc;
  border-top: 1px solid var(--app-border);
  display: flex;
  justify-content: space-between;
  min-height: 56px;
  padding: 0.7rem 1.25rem;
}

.app-avatar-stack {
  align-items: center;
  display: flex;
}

.app-avatar-stack .app-avatar {
  box-shadow: 0 0 0 2px #fff;
  margin-left: -7px;
}

.app-avatar-stack .app-avatar:first-child {
  margin-left: 0;
}

/* Estados */
.status-badge,
.tag[data-status],
.tag.is-status {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.66rem;
  font-weight: 720;
  gap: 0.35rem;
  height: auto;
  letter-spacing: 0.015em;
  line-height: 1;
  padding: 0.42rem 0.62rem;
  white-space: nowrap;
}

.status-badge::before,
.tag[data-status]::before,
.tag.is-status::before {
  background: currentColor;
  border-radius: 50%;
  content: "";
  height: 6px;
  width: 6px;
}

[data-status="completado"],
[data-status="completada"],
[data-status="activo"],
.status-completado,
.status-completada {
  background: var(--app-success-soft) !important;
  border-color: #ccecdf !important;
  color: var(--app-success) !important;
}

[data-status="en_progreso"],
[data-status="en-progreso"],
.status-en_progreso {
  background: var(--app-warning-soft) !important;
  border-color: #f3dfb4 !important;
  color: #a96606 !important;
}

[data-status="bloqueado"],
[data-status="impedimento"],
[data-status="inactivo"],
.status-bloqueado {
  background: var(--app-danger-soft) !important;
  border-color: #f6d2d9 !important;
  color: var(--app-danger) !important;
}

[data-status="no_iniciado"],
[data-status="no-iniciado"],
.status-no_iniciado {
  background: #f1f3f7 !important;
  border-color: #e1e5ed !important;
  color: #667085 !important;
}

[data-status="observador"],
[data-status="cliente"],
.status-info {
  background: var(--app-info-soft) !important;
  border-color: #d2e5f8 !important;
  color: var(--app-info) !important;
}

/* Modulos desplegables */
.module-list {
  display: grid;
  gap: 0.85rem;
}

.module-card,
[data-accordion] {
  --module-color: var(--app-primary);
  background: #fff;
  border: 1px solid var(--app-border);
  border-left: 4px solid var(--module-color);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--app-transition), border-color var(--app-transition);
}

.module-card[data-status="completado"],
[data-accordion][data-status="completado"] { --module-color: var(--app-success); }
.module-card[data-status="en_progreso"],
[data-accordion][data-status="en_progreso"] { --module-color: var(--app-warning); }
.module-card[data-status="bloqueado"],
[data-accordion][data-status="bloqueado"] { --module-color: var(--app-danger); }
.module-card[data-status="no_iniciado"],
[data-accordion][data-status="no_iniciado"] { --module-color: #9aa3b5; }

.module-card:hover,
[data-accordion]:hover,
[data-accordion][data-open="true"] {
  box-shadow: 0 10px 28px rgba(27, 36, 62, 0.08);
}

.module-header,
[data-accordion-trigger] {
  align-items: center;
  background: #fff;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 240px) auto;
  min-height: 82px;
  padding: 1rem 1.2rem;
  text-align: left;
  width: 100%;
}

.module-title-wrap {
  align-items: center;
  display: flex;
  gap: 0.85rem;
  min-width: 0;
}

.module-index {
  align-items: center;
  background: color-mix(in srgb, var(--module-color) 11%, white);
  border-radius: 11px;
  color: var(--module-color);
  display: inline-flex;
  flex: 0 0 38px;
  font-size: 0.75rem;
  font-weight: 780;
  height: 38px;
  justify-content: center;
}

.module-title {
  color: var(--app-ink);
  display: block;
  font-size: 0.91rem;
  font-weight: 710;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.module-summary {
  color: var(--app-muted);
  display: block;
  font-size: 0.69rem;
  margin-top: 0.22rem;
}

.module-progress-mini {
  min-width: 0;
}

.module-progress-mini .progress {
  margin: 0.4rem 0 0;
}

.module-progress-label {
  align-items: center;
  color: var(--app-muted);
  display: flex;
  font-size: 0.67rem;
  justify-content: space-between;
}

.module-progress-label strong {
  color: var(--app-ink);
}

.accordion-chevron {
  align-items: center;
  border: 1px solid var(--app-border);
  border-radius: 9px;
  color: var(--app-muted);
  display: inline-flex;
  flex: 0 0 34px;
  font-size: 0.8rem;
  height: 34px;
  justify-content: center;
  transition: transform var(--app-transition), background var(--app-transition);
  width: 34px;
}

[data-accordion][data-open="true"] .accordion-chevron,
[data-accordion].is-open .accordion-chevron {
  background: var(--app-primary-soft);
  color: var(--app-primary);
  transform: rotate(180deg);
}

.module-content,
[data-accordion-panel] {
  border-top: 1px solid var(--app-border);
}

[data-accordion-panel][hidden] {
  display: none !important;
}

.module-content-inner {
  padding: 1.2rem;
}

.module-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: space-between;
  margin-bottom: 1rem;
}

/* Tareas e impedimentos */
.task-list {
  border: 1px solid var(--app-border);
  border-radius: 13px;
  overflow: hidden;
}

.task-row {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid var(--app-border);
  display: grid;
  gap: 0.8rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 58px;
  padding: 0.7rem 0.9rem;
  transition: background var(--app-transition), opacity var(--app-transition);
}

.task-row:last-child {
  border-bottom: 0;
}

.task-row:hover {
  background: #fafbfe;
}

.task-row.is-complete,
.task-row[data-completed="true"] {
  background: #fafcfb;
}

.task-row.is-complete .task-title,
.task-row[data-completed="true"] .task-title {
  color: var(--app-muted);
  text-decoration: line-through;
}

.task-row.is-pending {
  opacity: 0.62;
  pointer-events: none;
}

.task-row.is-impediment,
.task-row[data-impediment="true"] {
  background: var(--app-danger-soft);
  border-left: 3px solid var(--app-danger);
}

.task-check {
  align-items: center;
  display: inline-flex;
  position: relative;
}

.task-check input,
input[data-task-toggle] {
  accent-color: var(--app-success);
  cursor: pointer;
  height: 18px;
  width: 18px;
}

.task-copy {
  min-width: 0;
}

.task-title {
  color: var(--app-ink);
  display: block;
  font-size: 0.8rem;
  font-weight: 590;
  line-height: 1.4;
}

.task-meta {
  align-items: center;
  color: var(--app-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.65rem;
  gap: 0.55rem;
  margin-top: 0.25rem;
}

.task-actions {
  align-items: center;
  display: flex;
  gap: 0.25rem;
}

.impediment-callout {
  align-items: flex-start;
  background: var(--app-danger-soft);
  border: 1px solid #f4ccd4;
  border-radius: 12px;
  color: #963144;
  display: flex;
  font-size: 0.76rem;
  gap: 0.7rem;
  line-height: 1.5;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
}

/* Distribucion de pesos */
.weight-panel {
  background: #fafbfe;
  border: 1px solid var(--app-border);
  border-radius: 14px;
  padding: 1rem;
}

.weight-row {
  align-items: center;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(150px, 1fr) minmax(180px, 2fr) 58px;
  padding: 0.65rem 0;
}

.weight-row + .weight-row {
  border-top: 1px solid var(--app-border);
}

.weight-name {
  color: var(--app-ink);
  font-size: 0.76rem;
  font-weight: 620;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weight-value,
[data-weight-value] {
  background: var(--app-primary-soft);
  border-radius: 8px;
  color: var(--app-primary-dark);
  display: inline-block;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  padding: 0.35rem 0.45rem;
  text-align: center;
}

input[type="range"][data-weight-slider],
.weight-slider {
  accent-color: var(--app-primary);
  appearance: none;
  background: transparent;
  cursor: pointer;
  height: 24px;
  width: 100%;
}

input[type="range"][data-weight-slider]::-webkit-slider-runnable-track,
.weight-slider::-webkit-slider-runnable-track {
  background: linear-gradient(90deg, var(--app-primary) 0 var(--range-progress, 50%), #dfe3ec var(--range-progress, 50%) 100%);
  border-radius: 999px;
  height: 6px;
}

input[type="range"][data-weight-slider]::-webkit-slider-thumb,
.weight-slider::-webkit-slider-thumb {
  appearance: none;
  background: #fff;
  border: 3px solid var(--app-primary);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(var(--app-primary-rgb), 0.32);
  height: 18px;
  margin-top: -6px;
  width: 18px;
}

input[type="range"][data-weight-slider]::-moz-range-track,
.weight-slider::-moz-range-track {
  background: #dfe3ec;
  border-radius: 999px;
  height: 6px;
}

input[type="range"][data-weight-slider]::-moz-range-progress,
.weight-slider::-moz-range-progress {
  background: var(--app-primary);
  border-radius: 999px;
  height: 6px;
}

input[type="range"][data-weight-slider]::-moz-range-thumb,
.weight-slider::-moz-range-thumb {
  background: #fff;
  border: 3px solid var(--app-primary);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(var(--app-primary-rgb), 0.32);
  height: 14px;
  width: 14px;
}

input[type="range"][data-weight-slider]:disabled {
  cursor: not-allowed;
  filter: grayscale(0.7);
  opacity: 0.62;
}

.weight-total {
  align-items: center;
  border-top: 1px solid var(--app-border);
  color: var(--app-muted);
  display: flex;
  font-size: 0.72rem;
  justify-content: flex-end;
  margin-top: 0.55rem;
  padding-top: 0.9rem;
}

.weight-total strong {
  color: var(--app-success);
  font-size: 0.9rem;
  margin-left: 0.35rem;
}

/* Formularios */
.label {
  color: var(--app-ink);
  font-size: 0.75rem;
  font-weight: 650;
  margin-bottom: 0.4rem;
}

.input,
.textarea,
.select select {
  background: #fff;
  border-color: var(--app-border-strong);
  border-radius: var(--app-radius-sm);
  box-shadow: none;
  color: var(--app-ink);
  font-size: 0.84rem;
  transition: border-color var(--app-transition), box-shadow var(--app-transition);
}

.input,
.select select {
  height: 2.75rem;
}

.textarea {
  line-height: 1.5;
  min-height: 110px;
  resize: vertical;
}

.input::placeholder,
.textarea::placeholder {
  color: #a8b0bf;
}

.input:hover,
.textarea:hover,
.select select:hover {
  border-color: #c7cdd9;
}

.input:focus,
.textarea:focus,
.select select:focus,
.input.is-focused,
.textarea.is-focused,
.select select.is-focused {
  border-color: var(--app-primary);
  box-shadow: 0 0 0 3px rgba(var(--app-primary-rgb), 0.12);
}

.input.is-danger,
.textarea.is-danger,
.select.is-danger select,
[aria-invalid="true"] {
  border-color: var(--app-danger) !important;
}

.help {
  color: var(--app-muted);
  font-size: 0.67rem;
}

.help.is-danger,
[data-error-for] {
  color: var(--app-danger);
}

.checkbox,
.radio {
  color: var(--app-text);
  font-size: 0.78rem;
}

.checkbox input,
.radio input {
  accent-color: var(--app-primary);
  margin-right: 0.35rem;
}

.button {
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 650;
  min-height: 2.6rem;
  transition: background var(--app-transition), border-color var(--app-transition), box-shadow var(--app-transition), transform var(--app-transition);
}

.button:hover:not([disabled]) {
  transform: translateY(-1px);
}

.button.is-primary,
.button.is-link {
  background: var(--app-primary);
  border-color: var(--app-primary);
  color: #fff;
}

.button.is-primary:hover,
.button.is-link:hover {
  background: var(--app-primary-dark);
  border-color: var(--app-primary-dark);
  box-shadow: 0 6px 18px rgba(var(--app-primary-rgb), 0.22);
}

.button.is-light {
  background: #f1f3f8;
  color: var(--app-text);
}

.button.is-danger.is-light {
  background: var(--app-danger-soft);
  color: var(--app-danger);
}

.button.is-ghost {
  color: var(--app-muted);
}

.button.is-icon-only {
  height: 34px;
  min-height: 34px;
  padding: 0;
  width: 34px;
}

.button.is-loading::after {
  border-color: transparent transparent #fff #fff !important;
}

.button:focus-visible,
.app-sidebar-toggle:focus-visible,
[data-accordion-trigger]:focus-visible,
[data-modal-close]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(var(--app-primary-rgb), 0.28);
  outline-offset: 2px;
}

/* Autenticacion y configuracion inicial */
.auth-page,
.setup-page {
  align-items: center;
  background:
    radial-gradient(circle at 8% 12%, rgba(91, 91, 214, 0.14), transparent 28%),
    radial-gradient(circle at 90% 82%, rgba(25, 167, 160, 0.1), transparent 30%),
    var(--app-canvas);
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

.auth-shell,
.setup-shell {
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 26px;
  box-shadow: var(--app-shadow-lg);
  display: grid;
  grid-template-columns: minmax(320px, 0.88fr) minmax(390px, 1.12fr);
  max-width: 980px;
  min-height: 600px;
  overflow: hidden;
  width: 100%;
}

.auth-brand-panel,
.setup-brand-panel {
  background:
    radial-gradient(circle at 85% 12%, rgba(255, 255, 255, 0.14), transparent 26%),
    linear-gradient(150deg, #25265d, #5050c1 62%, #427ca8);
  color: rgba(255, 255, 255, 0.78);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(2rem, 5vw, 3.2rem);
  position: relative;
}

.auth-brand-panel::after,
.setup-brand-panel::after {
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
  bottom: -110px;
  content: "";
  height: 290px;
  position: absolute;
  right: -95px;
  width: 290px;
}

.auth-brand-panel .title,
.setup-brand-panel .title {
  color: #fff;
  letter-spacing: -0.04em;
}

.auth-feature-list {
  display: grid;
  gap: 0.8rem;
  margin-top: 2rem;
  position: relative;
  z-index: 1;
}

.auth-feature {
  align-items: center;
  display: flex;
  font-size: 0.77rem;
  gap: 0.65rem;
}

.auth-feature-icon {
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  color: #fff;
  display: inline-flex;
  height: 31px;
  justify-content: center;
  width: 31px;
}

.auth-form-panel,
.setup-form-panel {
  align-items: center;
  display: flex;
  padding: clamp(2rem, 6vw, 4.25rem);
}

.auth-form,
.setup-form {
  margin: 0 auto;
  max-width: 400px;
  width: 100%;
}

.auth-form .title,
.setup-form .title {
  color: var(--app-ink);
  font-size: 1.65rem;
  letter-spacing: -0.04em;
}

.auth-footnote {
  color: var(--app-muted);
  font-size: 0.69rem;
  line-height: 1.5;
  margin-top: 1.25rem;
  text-align: center;
}

/* Tablas */
.table-container,
.app-table-wrap {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  overflow-x: auto;
}

.table {
  background: #fff;
  color: var(--app-text);
  font-size: 0.77rem;
  margin: 0;
  min-width: 680px;
  width: 100%;
}

.table thead th {
  background: #fafbfc;
  border-color: var(--app-border);
  color: #687287;
  font-size: 0.65rem;
  font-weight: 750;
  letter-spacing: 0.055em;
  padding: 0.8rem 0.9rem;
  text-transform: uppercase;
}

.table td {
  border-color: var(--app-border);
  padding: 0.85rem 0.9rem;
  vertical-align: middle;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table tbody tr:hover {
  background: #fafbfe;
}

.table .table-primary {
  color: var(--app-ink);
  font-weight: 650;
}

.table-actions {
  align-items: center;
  display: flex;
  gap: 0.25rem;
  justify-content: flex-end;
}

/* Modales Bulma */
.modal {
  align-items: center;
  padding: 1rem;
  z-index: 100;
}

.modal-background {
  backdrop-filter: blur(3px);
  background: rgba(17, 22, 40, 0.66);
}

.modal-card,
.modal-content {
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-lg);
  max-height: calc(100vh - 2rem);
  overflow: hidden;
}

.modal-card {
  margin: 0;
  max-width: 580px;
  width: 100%;
}

.modal-card-head,
.modal-card-foot {
  background: #fff;
  border-color: var(--app-border);
  padding: 1rem 1.25rem;
}

.modal-card-head {
  border-radius: var(--app-radius) var(--app-radius) 0 0;
}

.modal-card-title {
  color: var(--app-ink);
  font-size: 1rem;
  font-weight: 720;
}

.modal-card-body {
  background: #fff;
  padding: 1.25rem;
}

.modal-card-foot {
  border-radius: 0 0 var(--app-radius) var(--app-radius);
  justify-content: flex-end;
}

.modal .delete,
[data-modal-close] {
  cursor: pointer;
}

.app-confirm-modal .modal-card {
  max-width: 430px;
}

.app-confirm-icon {
  align-items: center;
  background: var(--app-danger-soft);
  border-radius: 14px;
  color: var(--app-danger);
  display: flex;
  font-size: 1.2rem;
  height: 48px;
  justify-content: center;
  margin-bottom: 1rem;
  width: 48px;
}

.app-confirm-message {
  color: var(--app-text);
  font-size: 0.82rem;
  line-height: 1.55;
}

/* Toasts */
.app-toast-container {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-width: min(390px, calc(100vw - 2rem));
  pointer-events: none;
  position: fixed;
  right: 1rem;
  top: 1rem;
  width: 100%;
  z-index: 200;
}

.app-toast {
  align-items: flex-start;
  animation: app-toast-in 220ms ease both;
  background: #fff;
  border: 1px solid var(--app-border);
  border-left: 4px solid var(--toast-color, var(--app-primary));
  border-radius: 12px;
  box-shadow: 0 14px 38px rgba(19, 26, 47, 0.17);
  color: var(--app-text);
  display: grid;
  gap: 0.65rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 0.85rem 0.9rem;
  pointer-events: auto;
}

.app-toast.is-success { --toast-color: var(--app-success); }
.app-toast.is-warning { --toast-color: var(--app-warning); }
.app-toast.is-danger { --toast-color: var(--app-danger); }
.app-toast.is-info { --toast-color: var(--app-info); }

.app-toast-icon {
  align-items: center;
  background: color-mix(in srgb, var(--toast-color) 11%, white);
  border-radius: 8px;
  color: var(--toast-color);
  display: inline-flex;
  font-size: 0.75rem;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.app-toast-title {
  color: var(--app-ink);
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.3;
}

.app-toast-message {
  color: var(--app-muted);
  display: block;
  font-size: 0.69rem;
  line-height: 1.4;
  margin-top: 0.12rem;
}

.app-toast-close {
  background: transparent;
  border: 0;
  color: #9aa3b5;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0.15rem;
}

.app-toast.is-leaving {
  animation: app-toast-out 180ms ease both;
}

@keyframes app-toast-in {
  from { opacity: 0; transform: translate3d(18px, -5px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes app-toast-out {
  from { opacity: 1; transform: translate3d(0, 0, 0); }
  to { opacity: 0; transform: translate3d(18px, 0, 0); }
}

/* Estados de carga y vacios */
.app-empty-state {
  align-items: center;
  background: #fff;
  border: 1px dashed var(--app-border-strong);
  border-radius: var(--app-radius);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 260px;
  padding: 2rem;
  text-align: center;
}

.app-empty-icon {
  align-items: center;
  background: var(--app-primary-soft);
  border-radius: 18px;
  color: var(--app-primary);
  display: flex;
  font-size: 1.3rem;
  height: 60px;
  justify-content: center;
  margin-bottom: 1rem;
  width: 60px;
}

.app-empty-title {
  color: var(--app-ink);
  font-size: 0.95rem;
  font-weight: 720;
  margin-bottom: 0.35rem;
}

.app-empty-copy {
  color: var(--app-muted);
  font-size: 0.75rem;
  line-height: 1.55;
  margin-bottom: 1rem;
  max-width: 390px;
}

.app-skeleton {
  animation: app-pulse 1.3s ease-in-out infinite;
  background: linear-gradient(90deg, #edf0f5 20%, #f7f8fa 40%, #edf0f5 60%);
  background-size: 220% 100%;
  border-radius: 7px;
  color: transparent !important;
  min-height: 0.8rem;
}

@keyframes app-pulse {
  to { background-position: -220% 0; }
}

.notification {
  border-radius: 12px;
  font-size: 0.77rem;
  line-height: 1.5;
}

.notification.is-danger.is-light { background: var(--app-danger-soft); color: #963144; }
.notification.is-success.is-light { background: var(--app-success-soft); color: #126e50; }
.notification.is-warning.is-light { background: var(--app-warning-soft); color: #94600e; }

/* Responsivo */
@media (max-width: 1200px) {
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1023px) {
  .app-shell,
  .app-layout {
    display: block;
  }

  .app-sidebar,
  [data-sidebar] {
    box-shadow: 18px 0 44px rgba(9, 13, 28, 0.25);
    position: fixed;
    transform: translateX(-105%);
    transition: transform 220ms ease;
  }

  body.is-sidebar-open .app-sidebar,
  body.is-sidebar-open [data-sidebar],
  .app-sidebar.is-open,
  [data-sidebar].is-open {
    transform: translateX(0);
  }

  body.is-sidebar-open .app-sidebar-backdrop,
  body.is-sidebar-open [data-sidebar-backdrop] {
    opacity: 1;
    pointer-events: auto;
  }

  .app-sidebar-toggle,
  [data-sidebar-toggle] {
    display: inline-flex;
  }

  .app-topbar {
    padding: 0 1.25rem;
  }

  .app-main-inner,
  .app-page {
    padding: 1.5rem;
  }

  .module-header,
  [data-accordion-trigger] {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .module-progress-mini {
    display: none;
  }
}

@media (max-width: 767px) {
  .app-topbar {
    height: 62px;
    padding: 0 1rem;
  }

  .app-main-inner,
  .app-page {
    padding: 1.1rem 1rem 2rem;
  }

  .app-page-header {
    align-items: stretch;
    flex-direction: column;
    margin-bottom: 1.2rem;
  }

  .app-page-actions,
  .app-page-actions .button {
    width: 100%;
  }

  .project-grid,
  .app-stats-grid {
    grid-template-columns: 1fr;
  }

  .app-stat-card {
    min-height: 88px;
  }

  .project-hero-header {
    flex-direction: column;
  }

  .module-header,
  [data-accordion-trigger] {
    gap: 0.65rem;
    min-height: 72px;
    padding: 0.85rem;
  }

  .module-index {
    display: none;
  }

  .module-title-wrap {
    gap: 0.55rem;
  }

  .module-content-inner {
    padding: 0.9rem;
  }

  .task-row {
    align-items: flex-start;
    gap: 0.65rem;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .task-actions {
    grid-column: 2;
    justify-content: flex-start;
  }

  .weight-row {
    gap: 0.5rem 0.75rem;
    grid-template-columns: minmax(0, 1fr) 58px;
  }

  .weight-row input[type="range"] {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .auth-page,
  .setup-page {
    align-items: stretch;
    padding: 0;
  }

  .auth-shell,
  .setup-shell {
    border: 0;
    border-radius: 0;
    display: block;
    min-height: 100vh;
  }

  .auth-brand-panel,
  .setup-brand-panel {
    min-height: 230px;
    padding: 2rem 1.5rem;
  }

  .auth-feature-list {
    display: none;
  }

  .auth-form-panel,
  .setup-form-panel {
    padding: 2.25rem 1.5rem;
  }

  .modal {
    padding: 0.65rem;
  }

  .modal-card {
    max-height: calc(100vh - 1.3rem);
  }

  .app-toast-container {
    left: 0.75rem;
    max-width: calc(100vw - 1.5rem);
    right: 0.75rem;
    top: 0.75rem;
  }
}

@media (max-width: 420px) {
  .app-sidebar,
  [data-sidebar] {
    width: min(var(--app-sidebar-width), calc(100vw - 46px));
  }

  .project-card-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.6rem;
  }
}

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

/*
 * Integracion con las vistas PHP de Nexo.
 * Estas reglas deliberadamente aparecen al final: adaptan los nombres de clase
 * de las plantillas sin alterar la semantica ni las utilidades de Bulma.
 */
body.app-body {
  display: flex;
  min-height: 100vh;
}

.app-workspace {
  flex: 1 1 auto;
  min-width: 0;
  width: calc(100% - var(--app-sidebar-width));
}

.app-main {
  margin: 0 auto;
  max-width: 1500px;
  min-height: 100vh;
  padding: 2rem;
  width: 100%;
}

.mobile-header {
  display: none;
}

.sidebar-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  min-height: 44px;
  padding: 0 0.5rem;
}

.brand-lockup {
  align-items: center;
  color: var(--app-ink);
  display: inline-flex;
  font-size: 1.02rem;
  font-weight: 780;
  gap: 0.65rem;
  letter-spacing: -0.025em;
}

.brand-lockup:hover {
  color: var(--app-primary);
}

.brand-lockup--light,
.brand-lockup--light:hover {
  color: #fff;
}

.brand-mark {
  align-items: center;
  background: linear-gradient(135deg, #7d7df1, #4f4fca);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  box-shadow: 0 7px 22px rgba(20, 22, 52, 0.24);
  color: #fff;
  display: inline-flex;
  font-size: 0.98rem;
  font-weight: 820;
  height: 39px;
  justify-content: center;
  width: 39px;
}

.sidebar-close {
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 0;
  border-radius: 9px;
  color: #fff;
  cursor: pointer;
  display: none;
  font-size: 1.25rem;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.sidebar-nav {
  display: grid;
  gap: 0.2rem;
  margin-top: 2rem;
}

.sidebar-label {
  color: #7d87a8;
  font-size: 0.65rem;
  font-weight: 720;
  letter-spacing: 0.115em;
  margin: 0 0.65rem 0.55rem;
}

.sidebar-link {
  align-items: center;
  border-radius: 11px;
  color: var(--app-sidebar-text);
  display: flex;
  font-size: 0.84rem;
  font-weight: 620;
  gap: 0.72rem;
  min-height: 44px;
  padding: 0.68rem 0.72rem;
  position: relative;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.sidebar-link.is-active {
  background: linear-gradient(90deg, rgba(112, 112, 234, 0.3), rgba(112, 112, 234, 0.12));
  color: #fff;
}

.sidebar-link.is-active::before {
  background: #8b8bf3;
  border-radius: 0 5px 5px 0;
  content: "";
  height: 22px;
  left: -1rem;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
}

.sidebar-icon {
  align-items: center;
  color: #8f99ba;
  display: inline-flex;
  font-size: 1.05rem;
  justify-content: center;
  width: 20px;
}

.sidebar-link.is-active .sidebar-icon {
  color: #aaaaf8;
}

.sidebar-privacy {
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  gap: 0.65rem;
  margin-top: auto;
  padding: 1rem 0.65rem;
}

.privacy-dot {
  background: #45c797;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(69, 199, 151, 0.12);
  height: 7px;
  width: 7px;
}

.sidebar-privacy strong,
.sidebar-privacy small {
  display: block;
}

.sidebar-privacy strong {
  color: #e9ebf5;
  font-size: 0.71rem;
  font-weight: 650;
}

.sidebar-privacy small {
  color: #858fac;
  font-size: 0.63rem;
  margin-top: 0.12rem;
}

.sidebar-user {
  align-items: center;
  display: grid;
  gap: 0.65rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 1rem 0.55rem 0;
}

.avatar {
  align-items: center;
  background: linear-gradient(135deg, #7777e6, #4f4fc2);
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  flex: 0 0 34px;
  font-size: 0.69rem;
  font-weight: 760;
  height: 34px;
  justify-content: center;
  text-transform: uppercase;
  width: 34px;
}

.avatar--sidebar {
  border-color: rgba(255, 255, 255, 0.48);
}

.sidebar-user-copy {
  line-height: 1.22;
  min-width: 0;
}

.sidebar-user-copy strong,
.sidebar-user-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-copy strong {
  color: #f4f5fb;
  font-size: 0.75rem;
  font-weight: 650;
}

.sidebar-user-copy small {
  color: #8e98b4;
  font-size: 0.62rem;
  margin-top: 0.15rem;
}

.logout-button,
.icon-button,
.lock-button {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--app-muted);
  cursor: pointer;
  display: inline-flex;
  font-size: 0.85rem;
  height: 34px;
  justify-content: center;
  transition: background var(--app-transition), border-color var(--app-transition), color var(--app-transition);
  width: 34px;
}

.logout-button {
  color: #8e98b4;
}

.logout-button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.icon-button:hover,
.lock-button:hover {
  background: var(--app-primary-soft);
  border-color: #dddffc;
  color: var(--app-primary);
}

.icon-button--danger:hover {
  background: var(--app-danger-soft);
  border-color: #f4d1d8;
  color: var(--app-danger);
}

.lock-button.is-active {
  background: var(--app-warning-soft);
  border-color: #f1dfbc;
  color: #aa6b0c;
}

.flash-stack {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.page-heading {
  align-items: flex-end;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.page-heading h1 {
  color: var(--app-ink);
  font-size: clamp(1.55rem, 2.3vw, 2rem);
  font-weight: 770;
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin: 0;
}

.page-heading p {
  color: var(--app-muted);
  line-height: 1.5;
  margin: 0.42rem 0 0;
}

.page-heading--compact {
  margin-bottom: 1.15rem;
}

.eyebrow {
  color: var(--app-primary);
  display: block;
  font-size: 0.66rem;
  font-weight: 770;
  letter-spacing: 0.11em;
  margin-bottom: 0.45rem;
}

.eyebrow--light {
  color: rgba(255, 255, 255, 0.68);
}

.back-link {
  align-items: center;
  color: var(--app-muted);
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 620;
  margin-bottom: 0.8rem;
}

.back-link:hover {
  color: var(--app-primary);
}

.action-button {
  padding-left: 1rem;
  padding-right: 1rem;
}

.metric-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 1.3rem;
}

.metric-card {
  align-items: center;
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-sm);
  display: flex;
  gap: 0.9rem;
  min-height: 100px;
  padding: 1rem 1.1rem;
}

.metric-icon {
  align-items: center;
  border-radius: 13px;
  display: inline-flex;
  flex: 0 0 44px;
  font-size: 1.08rem;
  height: 44px;
  justify-content: center;
}

.metric-icon--violet { background: var(--app-primary-soft); color: var(--app-primary); }
.metric-icon--blue { background: var(--app-info-soft); color: var(--app-info); }
.metric-icon--red { background: var(--app-danger-soft); color: var(--app-danger); }

.metric-card small,
.metric-card strong {
  display: block;
}

.metric-card small {
  color: var(--app-muted);
  font-size: 0.69rem;
  margin-bottom: 0.23rem;
}

.metric-card strong {
  color: var(--app-ink);
  font-size: 1.4rem;
  font-weight: 770;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.metric-card strong em {
  color: var(--app-muted);
  font-size: 0.74rem;
  font-style: normal;
  font-weight: 560;
}

.project-grid .project-card {
  display: flex;
  min-height: 260px;
  padding: 1.35rem;
}

.project-card h2 {
  color: var(--app-ink);
  font-size: 1.03rem;
  font-weight: 740;
  letter-spacing: -0.025em;
  margin: 1rem 0 0;
}

.project-card > p {
  color: var(--app-muted);
  display: -webkit-box;
  font-size: 0.75rem;
  line-height: 1.55;
  margin: 0.42rem 0 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.project-role-tag {
  background: var(--app-primary-soft);
  border: 1px solid #dfe0fb;
  border-radius: 999px;
  color: var(--app-primary-dark);
  font-size: 0.63rem;
  font-weight: 690;
  padding: 0.35rem 0.55rem;
}

.project-card-arrow {
  align-items: center;
  background: #f4f5f8;
  border-radius: 9px;
  color: var(--app-muted);
  display: inline-flex;
  font-size: 0.76rem;
  height: 31px;
  justify-content: center;
  transition: background var(--app-transition), color var(--app-transition), transform var(--app-transition);
  width: 31px;
}

.project-card:hover .project-card-arrow {
  background: var(--app-primary);
  color: #fff;
  transform: translate(2px, -2px);
}

.project-card-stats {
  align-items: center;
  color: var(--app-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.67rem;
  gap: 0.75rem;
  margin-top: 1rem;
}

.project-card-stats strong {
  color: var(--app-text);
  font-weight: 690;
}

.project-card-stats .has-blocker,
.has-blocker strong {
  color: var(--app-danger);
}

.project-card .progress-meta {
  margin-top: auto;
  padding-top: 1.2rem;
}

.progress-meta {
  align-items: center;
  color: var(--app-muted);
  display: flex;
  font-size: 0.67rem;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.progress-meta strong {
  color: var(--app-ink);
  font-size: 0.72rem;
}

.project-card .project-progress {
  margin: 0;
}

.empty-state {
  align-items: center;
  background: #fff;
  border: 1px dashed var(--app-border-strong);
  border-radius: var(--app-radius);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 290px;
  padding: 2.4rem 1.5rem;
  text-align: center;
}

.empty-state-icon {
  align-items: center;
  background: var(--app-primary-soft);
  border-radius: 18px;
  color: var(--app-primary);
  display: inline-flex;
  font-size: 1.3rem;
  height: 60px;
  justify-content: center;
  margin-bottom: 1rem;
  width: 60px;
}

.empty-state h2,
.empty-state h3 {
  color: var(--app-ink);
  font-size: 1rem;
  font-weight: 730;
  margin: 0;
}

.empty-state p {
  color: var(--app-muted);
  font-size: 0.75rem;
  line-height: 1.55;
  margin: 0.45rem auto 1rem;
  max-width: 440px;
}

.form-card,
.settings-card {
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-sm);
  padding: 1.4rem;
}

.form-card--narrow {
  max-width: 720px;
}

.privacy-notice,
.auto-weight-note,
.weight-help {
  align-items: flex-start;
  background: var(--app-info-soft);
  border: 1px solid #d6e7f8;
  border-radius: 11px;
  color: #315f8d;
  display: flex;
  font-size: 0.71rem;
  gap: 0.65rem;
  line-height: 1.5;
  padding: 0.75rem 0.85rem;
}

.privacy-notice strong,
.privacy-notice p,
.auto-weight-note strong,
.auto-weight-note p,
.weight-help p {
  margin: 0;
}

.privacy-notice strong,
.auto-weight-note strong {
  color: #234e79;
  display: block;
}

.form-actions,
.modal-actions,
.settings-submit {
  align-items: center;
  display: flex;
  gap: 0.65rem;
  justify-content: flex-end;
  margin-top: 1.25rem;
}

/* Vista detallada de proyecto */
.project-hero .back-link {
  color: rgba(255, 255, 255, 0.72);
}

.project-hero .back-link:hover {
  color: #fff;
}

.project-hero-top {
  align-items: flex-start;
  display: flex;
  gap: 1.2rem;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.project-title-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.project-title-row h1 {
  color: #fff;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 780;
  letter-spacing: -0.045em;
  line-height: 1.1;
  margin: 0;
}

.project-hero-top > div > p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.78rem;
  line-height: 1.55;
  margin: 0.55rem 0 0;
  max-width: 720px;
}

.privacy-pill,
.project-role-context {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.63rem;
  font-weight: 650;
  padding: 0.36rem 0.58rem;
}

.project-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 0.55rem;
}

.project-hero .button.is-light {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.project-hero .button.is-light:hover {
  background: rgba(255, 255, 255, 0.2);
}

.project-hero .button.is-primary {
  background: #fff;
  border-color: #fff;
  color: var(--app-primary-dark);
}

.project-progress-block {
  margin-top: 1.8rem;
  position: relative;
  z-index: 1;
}

.project-progress-block .project-progress-copy {
  align-items: flex-end;
  display: flex;
  justify-content: space-between;
  margin: 0;
}

.project-progress-copy > div > span,
.project-progress-copy > div > strong {
  display: block;
}

.project-progress-copy > div > span,
.project-progress-copy > small {
  color: rgba(255, 255, 255, 0.67);
  font-size: 0.67rem;
}

.project-progress-copy > div > strong {
  color: #fff;
  font-size: 1.7rem;
  font-weight: 780;
  letter-spacing: -0.045em;
  line-height: 1;
  margin-top: 0.35rem;
}

.project-meta-row {
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
  display: flex;
  justify-content: space-between;
  margin-top: 1.35rem;
  padding-top: 1rem;
  position: relative;
  z-index: 1;
}

.member-stack {
  align-items: center;
  display: flex;
}

.avatar--stack {
  border-color: rgba(255, 255, 255, 0.82);
  height: 30px;
  margin-left: -7px;
  width: 30px;
}

.avatar--stack:first-child {
  margin-left: 0;
}

.avatar--more {
  background: rgba(255, 255, 255, 0.18);
  font-size: 0.59rem;
}

.member-stack-label {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.65rem;
  margin-left: 0.65rem;
}

.module-section {
  margin-top: 2rem;
}

.section-heading-row {
  align-items: flex-end;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 0.9rem;
}

.section-heading-row h2 {
  color: var(--app-ink);
  font-size: 1.25rem;
  font-weight: 750;
  letter-spacing: -0.035em;
  margin: 0;
}

.section-heading-row .weight-total,
.settings-card-heading .weight-total {
  background: #f1f3f7;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  color: var(--app-muted);
  font-size: 0.67rem;
  margin: 0;
  padding: 0.4rem 0.65rem;
}

.weight-total.is-complete,
.weight-total:has([data-valid="true"]) {
  background: var(--app-success-soft);
  border-color: #d1ecdf;
  color: var(--app-success);
}

.module-card {
  border-left-width: 1px;
}

.module-card--blocked {
  border-left: 4px solid var(--app-danger);
}

.module-header {
  align-items: stretch;
  display: grid;
  gap: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 74px;
  padding: 0;
}

.module-accordion-button[data-accordion-trigger] {
  align-items: center;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: grid;
  gap: 0.7rem;
  grid-template-columns: auto auto minmax(0, 1fr);
  min-height: 74px;
  padding: 0.85rem 1rem;
  text-align: left;
  width: 100%;
}

.module-number {
  align-items: center;
  background: var(--app-primary-soft);
  border-radius: 10px;
  color: var(--app-primary);
  display: inline-flex;
  font-size: 0.67rem;
  font-weight: 770;
  height: 35px;
  justify-content: center;
  width: 35px;
}

.module-title-copy {
  min-width: 0;
}

.module-title-copy strong,
.module-title-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.module-title-copy strong {
  color: var(--app-ink);
  font-size: 0.84rem;
  font-weight: 700;
}

.module-title-copy small {
  color: var(--app-muted);
  font-size: 0.66rem;
  margin-top: 0.22rem;
}

.module-header-meta {
  align-items: center;
  display: flex;
  gap: 0.55rem;
  padding: 0.85rem 1rem 0.85rem 0;
}

.module-weight {
  color: var(--app-muted);
  font-size: 0.65rem;
  white-space: nowrap;
}

.status-badge i {
  font-size: 0.68rem;
  font-style: normal;
  line-height: 1;
}

.module-header-meta .status-badge::before {
  display: none;
}

.status-badge.status-neutral {
  background: #f1f3f7;
  border-color: #e1e5ed;
  color: #667085;
}

.status-badge.status-progress {
  background: var(--app-warning-soft);
  border-color: #f3dfb4;
  color: #a96606;
}

.status-badge.status-blocked {
  background: var(--app-danger-soft);
  border-color: #f6d2d9;
  color: var(--app-danger);
}

.status-badge.status-done {
  background: var(--app-success-soft);
  border-color: #ccecdf;
  color: var(--app-success);
}

.module-progress-strip {
  align-items: center;
  background: #fafbfc;
  border-top: 1px solid var(--app-border);
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(0, 1fr) 42px;
  padding: 0.55rem 1rem;
}

.module-progress-strip .progress {
  height: 0.42rem;
  margin: 0;
}

.module-progress-strip > span {
  color: var(--app-muted);
  font-size: 0.65rem;
  font-weight: 680;
  text-align: right;
}

.module-panel[data-accordion-panel] {
  background: #fff;
  padding: 1rem;
}

.blocker-banner {
  align-items: flex-start;
  background: var(--app-danger-soft);
  border: 1px solid #f5d0d7;
  border-radius: 11px;
  color: #963144;
  display: flex;
  font-size: 0.7rem;
  gap: 0.65rem;
  margin-bottom: 0.9rem;
  padding: 0.75rem 0.85rem;
}

.blocker-banner > span {
  align-items: center;
  background: #fff;
  border-radius: 7px;
  display: inline-flex;
  flex: 0 0 25px;
  font-weight: 800;
  height: 25px;
  justify-content: center;
}

.blocker-banner strong,
.blocker-banner p {
  display: block;
  margin: 0;
}

.blocker-banner p {
  color: #b25a6a;
  margin-top: 0.12rem;
}

.task-heading-row {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.task-heading-row h3 {
  color: var(--app-ink);
  font-size: 0.8rem;
  font-weight: 700;
  margin: 0;
}

.task-heading-row > div > span {
  color: var(--app-muted);
  display: block;
  font-size: 0.63rem;
  margin-top: 0.13rem;
}

.task-checkbox {
  align-items: center;
  align-self: center;
  background: #fff;
  border: 1.5px solid #cbd1dc;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 20px;
  font-size: 0.7rem;
  font-weight: 800;
  height: 20px;
  justify-content: center;
  padding: 0;
  transition: background var(--app-transition), border-color var(--app-transition), transform var(--app-transition);
  width: 20px;
}

.task-checkbox:hover:not(:disabled) {
  border-color: var(--app-success);
  transform: scale(1.05);
}

.task-checkbox[aria-pressed="true"] {
  background: var(--app-success);
  border-color: var(--app-success);
}

.task-checkbox:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.task-row.is-completed {
  background: #fafcfb;
}

.task-row.is-completed .task-description {
  color: var(--app-muted);
  text-decoration: line-through;
}

.task-title-line {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.task-description {
  color: var(--app-ink);
  font-size: 0.77rem;
  font-weight: 570;
  line-height: 1.45;
}

.task-copy > small {
  color: var(--app-muted);
  display: block;
  font-size: 0.62rem;
  margin-top: 0.18rem;
}

.impediment-label {
  background: var(--app-danger);
  border-radius: 5px;
  color: #fff;
  font-size: 0.52rem;
  font-weight: 780;
  letter-spacing: 0.055em;
  padding: 0.24rem 0.35rem;
}

.task-delete-form {
  margin: 0;
}

.task-empty,
.settings-empty,
.modal-empty {
  color: var(--app-muted);
  font-size: 0.72rem;
  margin: 0;
  padding: 1rem;
  text-align: center;
}

.impediment-check {
  align-items: center;
  background: var(--app-danger-soft);
  border: 1px solid #f4d2d9;
  border-radius: 10px;
  color: #963144;
  display: flex;
  padding: 0.7rem 0.8rem;
}

.auto-weight-note {
  margin-top: 0.85rem;
}

.danger-zone-inline {
  border-top: 1px solid var(--app-border);
  margin-top: 1.1rem;
  padding-top: 1rem;
  text-align: right;
}

/* Configuracion */
.settings-grid {
  align-items: start;
  display: grid;
  gap: 1.1rem;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.85fr);
}

.settings-main {
  display: grid;
  gap: 1.1rem;
}

.settings-card-heading {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1.15rem;
}

.settings-card-heading h2 {
  color: var(--app-ink);
  font-size: 0.92rem;
  font-weight: 730;
  margin: 0;
}

.settings-card-heading p {
  color: var(--app-muted);
  font-size: 0.69rem;
  line-height: 1.5;
  margin: 0.2rem 0 0;
}

.settings-submit {
  border-top: 1px solid var(--app-border);
  padding-top: 1rem;
}

.weight-list {
  border: 1px solid var(--app-border);
  border-radius: 12px;
  overflow: hidden;
}

.weight-list .weight-row {
  background: #fff;
  display: block;
  padding: 0.85rem 1rem;
}

.weight-list .weight-row + .weight-row {
  border-top: 1px solid var(--app-border);
}

.weight-list .weight-row.is-locked {
  background: #fafbfc;
}

.weight-row-heading {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 0.45rem;
}

.weight-row-heading strong,
.weight-row-heading small {
  display: block;
}

.weight-row-heading strong {
  color: var(--app-ink);
  font-size: 0.75rem;
  font-weight: 660;
}

.weight-row-heading small {
  color: var(--app-muted);
  font-size: 0.59rem;
  margin-top: 0.1rem;
}

.weight-controls {
  align-items: center;
  display: flex;
  gap: 0.35rem;
}

.weight-controls form {
  margin: 0;
}

.weight-list .weight-slider {
  display: block;
}

.weight-help {
  background: var(--app-warning-soft);
  border-color: #f1dfb8;
  color: #8e5d12;
  margin-top: 0.85rem;
}

.weight-help > span {
  background: rgba(217, 138, 21, 0.14);
  border-radius: 6px;
  color: #9b620c;
  font-size: 0.57rem;
  font-weight: 750;
  padding: 0.25rem 0.35rem;
  text-transform: uppercase;
}

.danger-zone {
  border-color: #f1cbd3;
}

.team-card {
  padding-bottom: 0.6rem;
}

.team-list {
  display: grid;
}

.team-member {
  align-items: center;
  border-top: 1px solid var(--app-border);
  display: grid;
  gap: 0.65rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 0.75rem 0;
}

.team-member-actions {
  align-items: center;
  display: flex;
  gap: 0.25rem;
}

.team-member-actions form {
  margin: 0;
}

.team-member:first-child {
  border-top: 0;
}

.team-member > div {
  min-width: 0;
}

.team-member strong,
.team-member small,
.team-member > div > span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-member strong {
  color: var(--app-ink);
  font-size: 0.7rem;
  font-weight: 650;
}

.team-member small {
  color: var(--app-muted);
  font-size: 0.6rem;
  margin-top: 0.12rem;
}

.team-member > div > span {
  color: var(--app-primary);
  font-size: 0.59rem;
  margin-top: 0.15rem;
}

/* Usuarios */
.user-table-card {
  padding: 0;
}

.user-table-card .table-container {
  border: 0;
  border-radius: inherit;
}

.user-cell {
  align-items: center;
  display: flex;
  gap: 0.65rem;
}

.user-cell > div {
  min-width: 0;
}

.user-cell strong,
.user-cell small {
  display: block;
}

.user-cell strong {
  color: var(--app-ink);
  font-size: 0.73rem;
  font-weight: 650;
}

.user-cell small {
  color: var(--app-muted);
  font-size: 0.62rem;
  margin-top: 0.12rem;
}

.role-chip {
  background: #f1f3f7;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  color: var(--app-text);
  display: inline-flex;
  font-size: 0.62rem;
  font-weight: 680;
  padding: 0.36rem 0.5rem;
}

.role-chip--admin { background: var(--app-primary-soft); border-color: #dcdefa; color: var(--app-primary-dark); }
.role-chip--project_manager { background: var(--app-info-soft); border-color: #d2e5f8; color: var(--app-info); }
.role-chip--programmer { background: var(--app-success-soft); border-color: #d0ebdf; color: var(--app-success); }
.role-chip--observer { background: #f1f3f7; border-color: var(--app-border); color: #667085; }

.status-dot-label {
  align-items: center;
  color: var(--app-muted);
  display: inline-flex;
  font-size: 0.65rem;
  gap: 0.4rem;
}

.status-dot-label i {
  background: currentColor;
  border-radius: 50%;
  height: 7px;
  width: 7px;
}

.status-dot-label.is-active { color: var(--app-success); }
.status-dot-label.is-inactive { color: var(--app-danger); }
.status-dot-label.is-pending { color: #9a6815; }
.status-dot-label.is-pending i { background: var(--app-warning); }

/* Acceso / configuracion inicial */
body.auth-body {
  align-items: center;
  background:
    radial-gradient(circle at 8% 12%, rgba(91, 91, 214, 0.14), transparent 28%),
    radial-gradient(circle at 90% 82%, rgba(25, 167, 160, 0.1), transparent 30%),
    var(--app-canvas);
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

body.auth-body > .auth-shell {
  min-height: min(650px, calc(100vh - 4rem));
}

.auth-brand-copy {
  margin: auto 0;
  position: relative;
  z-index: 1;
}

.auth-brand-copy h1 {
  color: #fff;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  font-weight: 770;
  letter-spacing: -0.045em;
  line-height: 1.15;
  margin: 0;
  max-width: 390px;
}

.auth-brand-copy > p {
  color: rgba(255, 255, 255, 0.69);
  font-size: 0.77rem;
  line-height: 1.6;
  margin: 0.8rem 0 0;
  max-width: 360px;
}

.auth-metric-card {
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 13px;
  display: flex;
  gap: 0.65rem;
  padding: 0.75rem;
  position: relative;
  z-index: 1;
}

.auth-metric-icon {
  align-items: center;
  background: rgba(255, 255, 255, 0.13);
  border-radius: 9px;
  color: #fff;
  display: inline-flex;
  height: 33px;
  justify-content: center;
  width: 33px;
}

.auth-metric-card strong,
.auth-metric-card small {
  display: block;
}

.auth-metric-card strong {
  color: #fff;
  font-size: 0.72rem;
  font-weight: 670;
}

.auth-metric-card small {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.61rem;
  margin-top: 0.1rem;
}

.auth-form-panel {
  align-items: stretch;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.auth-form-wrap {
  margin: auto;
  max-width: 400px;
  width: 100%;
}

.auth-form-heading {
  margin-bottom: 1.4rem;
}

.auth-form-heading h2 {
  color: var(--app-ink);
  font-size: 1.7rem;
  font-weight: 770;
  letter-spacing: -0.045em;
  line-height: 1.15;
  margin: 0;
}

.auth-form-heading > p {
  color: var(--app-muted);
  font-size: 0.74rem;
  margin: 0.45rem 0 0;
}

.auth-form .field + .field {
  margin-top: 1rem;
}

.auth-submit {
  justify-content: space-between;
  margin-top: 1.35rem;
  padding-left: 1rem;
  padding-right: 1rem;
}

.auth-help {
  align-items: flex-start;
  background: #f7f8fb;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  color: var(--app-muted);
  display: flex;
  font-size: 0.65rem;
  gap: 0.5rem;
  line-height: 1.5;
  margin-top: 1rem;
  padding: 0.65rem 0.75rem;
}

.auth-help p {
  margin: 0;
}

.auth-footer {
  bottom: 1.25rem;
  color: #a0a8b7;
  font-size: 0.59rem;
  left: 0;
  margin: 0;
  position: absolute;
  text-align: center;
  width: 100%;
}

/* Errores */
.error-state {
  align-items: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100vh - 4rem);
  text-align: center;
}

.error-code {
  color: var(--app-primary);
  font-size: 4rem;
  font-weight: 820;
  letter-spacing: -0.07em;
  line-height: 1;
}

.error-state h2 {
  color: var(--app-ink);
  font-size: 1.3rem;
  margin: 0.7rem 0 0;
}

.error-state p {
  color: var(--app-muted);
  font-size: 0.76rem;
  margin: 0.45rem 0 1rem;
}

.modal-actions {
  border-top: 1px solid var(--app-border);
  padding-top: 1rem;
}

@media (max-width: 1180px) {
  .settings-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(290px, 0.85fr);
  }
}

@media (max-width: 1023px) {
  body.app-body {
    display: block;
  }

  .app-workspace {
    width: 100%;
  }

  .app-main {
    padding: 1.5rem;
  }

  .mobile-header {
    align-items: center;
    backdrop-filter: blur(14px);
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid var(--app-border);
    display: flex;
    height: 64px;
    justify-content: space-between;
    padding: 0 1.25rem;
    position: sticky;
    top: 0;
    z-index: 30;
  }

  .mobile-menu-button {
    align-items: center;
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: 9px;
    color: var(--app-ink);
    cursor: pointer;
    display: inline-flex;
    font-size: 1rem;
    height: 38px;
    justify-content: center;
    width: 38px;
  }

  .mobile-header .brand-mark {
    height: 34px;
    width: 34px;
  }

  .sidebar-close {
    display: inline-flex;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .settings-side {
    order: -1;
  }
}

@media (max-width: 767px) {
  .app-main {
    padding: 1.1rem 1rem 2rem;
  }

  .page-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .page-heading .action-button {
    width: 100%;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 88px;
  }

  .project-hero-top,
  .project-progress-block .project-progress-copy,
  .project-meta-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .project-actions,
  .project-actions .button {
    width: 100%;
  }

  .project-progress-copy > small {
    margin-top: 0.65rem;
  }

  .project-role-context {
    margin-top: 0.65rem;
  }

  .section-heading-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .module-header {
    grid-template-columns: minmax(0, 1fr);
  }

  .module-header-meta {
    border-top: 1px solid var(--app-border);
    justify-content: flex-start;
    padding: 0.65rem 0.85rem;
  }

  .module-accordion-button[data-accordion-trigger] {
    padding: 0.75rem 0.85rem;
  }

  .task-heading-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .task-heading-row .button {
    width: 100%;
  }

  .form-actions,
  .modal-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .form-actions .button,
  .modal-actions .button {
    width: 100%;
  }

  body.auth-body {
    align-items: stretch;
    padding: 0;
  }

  body.auth-body > .auth-shell {
    min-height: 100vh;
  }

  .auth-brand-panel {
    justify-content: flex-start;
    min-height: 255px;
  }

  .auth-brand-copy {
    margin-top: 2.3rem;
  }

  .auth-metric-card {
    display: none;
  }

  .auth-form-panel {
    min-height: calc(100vh - 255px);
    padding-bottom: 4rem;
  }

  .settings-card-heading {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .project-grid {
    grid-template-columns: 1fr;
  }

  .module-number {
    display: none;
  }

  .module-accordion-button[data-accordion-trigger] {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .status-badge {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .weight-row-heading {
    align-items: flex-start;
  }
}
