.dashboard-page {
  background: #ffffff;
  height: calc(100vh - 62px);
  overflow: hidden;
}

body:has(.dashboard-page) {
  overflow: hidden;
}

body:has(.dashboard-page) footer {
  display: none;
}

.dashboard-shell {
  width: 90%;
  height: 100%;
  margin: 0 auto;
  padding: 30px;
  display: grid;
  grid-template-rows: auto minmax(128px, auto) minmax(0, 1fr);
  gap: 1rem;
  min-height: 0;
}

.dashboard-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.4rem;
  min-height: 48px;
}

.dashboard-heading h1 {
  margin: 0;
  text-align: left;
  color: #1d3557;
  font-size: 2.4rem;
  font-weight: 500;
  line-height: 1.1;
}

.dashboard-subtitle {
  color: var(--colorSecundario_4);
  font-size: 1.25rem;
  margin-top: 0.2rem;
}

.dashboard-actions,
.dashboard-config-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}

.dashboard-button {
  width: 146px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  padding: 0.8rem 1.2rem;
  border-radius: 8px;
  text-decoration: none;
  font-family: "Poppins", sans-serif;
  font-size: 1.25rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
}

.dashboard-button-primary {
  background: var(--colorPrincipal_6);
  color: #ffffff;
}

.dashboard-page .dashboard-heading .dashboard-actions .dashboard-button {
  width: 180px;
  min-width: 180px;
  flex: 0 0 180px;
  font-size: 1.2rem;
  white-space: nowrap;
}

.dashboard-button-primary:hover {
  background: var(--colorPrincipal_5);
}

.dashboard-button-secondary {
  background: #ffffff;
  color: var(--colorPrincipal_6);
  border-color: var(--colorPrincipal_1);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.dashboard-button-secondary:hover {
  background: var(--colorPrincipal_1);
}

.dashboard-section {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.2rem;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
  min-height: 0;
  overflow: hidden;
}

.dashboard-section-main {
  border-left: 1px solid #e5e7eb;
}

.dashboard-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
  min-height: 32px;
}

.dashboard-section-header h2 {
  color: var(--colorSecundario_5);
  font-size: 1.55rem;
  font-weight: 500;
  margin: 0;
  line-height: 1.2;
}

.dashboard-section-header p {
  color: var(--colorSecundario_3);
  font-size: 1.25rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
  min-height: 0;
}

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

.dashboard-grid--auxiliar .dashboard-section-main {
  min-height: 320px;
}

.task-list,
.access-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 0;
  overflow: hidden;
}

.task-row,
.access-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-height: 52px;
  padding: 0.8rem;
  border: 1px solid #edf0f2;
  border-radius: 8px;
  color: var(--colorSecundario_5);
  text-decoration: none;
  background: var(--colorBase_1);
}

.task-link {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  color: inherit;
  text-decoration: none;
}

.task-dismiss {
  width: 26px;
  height: 26px;
  min-height: 26px;
  flex: 0 0 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
}

.task-dismiss:hover {
  border-color: #fecaca;
  background: #fff1f2;
  color: #b42318;
}

.task-row:hover,
.access-row:hover,
.shortcut-card:hover,
.config-shortcut:hover {
  border-color: var(--colorPrincipal_2);
  background: #f4fffb;
}

.task-icon,
.shortcut-icon,
.access-row > span:first-child {
  width: 3rem;
  height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 3rem;
  border-radius: 8px;
  background: var(--colorPrincipal_1);
  color: var(--colorPrincipal_6);
  font-size: 1.5rem;
  font-weight: 600;
}

.icon-tone-admin {
  background: #e3d7ff !important;
  color: #6d4acb !important;
}

.icon-tone-gerencia {
  background: #ffd2e0 !important;
  color: #bf2f61 !important;
}

.icon-tone-vivienda {
  background: #cbe5ff !important;
  color: #2567a8 !important;
}

.icon-tone-social {
  background: #c6f2dc !important;
  color: #11805c !important;
}

.icon-tone-trabajadores {
  background: #d7dcff !important;
  color: #4b55b8 !important;
}

.icon-tone-juridico {
  background: #ffe3b0 !important;
  color: #a45d00 !important;
}

.icon-tone-financiera {
  background: #c3eef2 !important;
  color: #087987 !important;
}

.icon-tone-conocimiento {
  background: #e4d4ff !important;
  color: #8055bd !important;
}

.icon-tone-calendario {
  background: #d7e6ff !important;
  color: #3269bd !important;
}

.icon-tone-organizacion {
  background: #dcedc0 !important;
  color: #608919 !important;
}

.icon-tone-plan {
  background: #ffd0dd !important;
  color: #be345d !important;
}

.icon-tone-notes {
  background: #ffe0b7 !important;
  color: #9a640e !important;
}

.icon-tone-soporte {
  background: #ffd1c4 !important;
  color: #b44025 !important;
}

.task-content {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
}

.task-content strong,
.access-row strong,
.shortcut-card strong,
.shortcut-pill strong,
.config-shortcut strong {
  display: block;
  color: var(--colorSecundario_5);
  font-size: 1.22rem;
  font-weight: 500;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-content small,
.access-row small,
.shortcut-card small,
.shortcut-pill small,
.config-shortcut small {
  display: block;
  color: var(--colorSecundario_3);
  font-size: 1.05rem;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  color: var(--colorSecundario_3);
  font-size: 1.1rem;
  text-align: right;
}

.task-meta em {
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: #ffffff;
  color: var(--colorSecundario_4);
  font-style: normal;
  font-weight: 500;
}

.task-row.is-overdue {
  border-color: #f3b4b4;
  background: #fff7f7;
}

.task-row.is-overdue .task-meta span {
  color: #b42318;
  font-weight: 600;
}

.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.dashboard-section-shortcuts {
  display: flex;
  flex-direction: column;
  padding: 1rem 1.2rem 1.2rem;
}

.dashboard-section-shortcuts .dashboard-section-header {
  justify-content: flex-end;
  min-height: 0;
  margin-bottom: 0.6rem;
}

.shortcut-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-auto-rows: minmax(64px, auto);
  gap: 0.8rem;
  min-height: 0;
  overflow: visible;
}

.shortcut-pill {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 64px;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem;
  border: 1px solid #edf0f2;
  border-radius: 8px;
  background: var(--colorBase_1);
  color: var(--colorSecundario_5);
  text-decoration: none;
}

.shortcut-pill .shortcut-icon {
  flex: 0 0 3.2rem;
}

.shortcut-pill:hover {
  border-color: var(--colorPrincipal_2);
  background: #f4fffb;
}

.shortcut-pill > span:last-child {
  min-width: 0;
}

.shortcut-pill strong {
  display: -webkit-box;
  min-height: 0;
  max-height: 3.4rem;
  align-content: center;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.shortcut-card {
  min-height: 120px;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1.3rem;
  border: 1px solid #edf0f2;
  border-radius: 8px;
  background: var(--colorBase_1);
  text-decoration: none;
}

.panel-tool {
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  flex: 0 0 32px;
  border-radius: 8px;
  border: 1px solid var(--colorPrincipal_1);
  background: #ffffff;
  color: var(--colorPrincipal_6);
  font-size: 1.5rem;
  line-height: 1;
  box-shadow: none;
}

.panel-tool:hover {
  background: var(--colorPrincipal_1);
}

.dashboard-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.38);
  padding: 2rem;
}

.dashboard-modal-dialog {
  width: min(1180px, 100%);
  height: min(820px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
  overflow: hidden;
}

.dashboard-modal-header {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.dashboard-modal-header h2 {
  margin: 0;
  color: var(--colorSecundario_5);
  font-size: 1.8rem;
  font-weight: 500;
}

.dashboard-modal-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 1.5rem;
}

.dashboard-modal-body .dashboard-section {
  height: auto;
  overflow: visible;
  box-shadow: none;
}

.dashboard-modal-body .task-list,
.dashboard-modal-body .access-list,
.dashboard-modal-body .shortcut-strip {
  overflow: visible;
}

.dashboard-modal-open {
  overflow: hidden;
}

.dashboard-empty {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  border: 1px dashed var(--colorBase_4);
  border-radius: 8px;
  color: var(--colorSecundario_3);
  font-size: 1.3rem;
  text-align: center;
}

.dashboard-config-form {
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

.dashboard-config-page {
  height: auto;
  min-height: calc(100vh - 62px);
  overflow: auto;
}

.dashboard-config-page .dashboard-shell {
  width: 90%;
  height: auto;
  min-height: auto;
  display: flex;
  flex-direction: column;
  padding: 30px;
}

.dashboard-config-page .dashboard-section {
  flex: 0 0 auto;
  overflow: visible;
}

.dashboard-config-page .dashboard-heading {
  align-items: flex-end;
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 1rem 0;
  background: #ffffff;
}

.dashboard-config-page .dashboard-actions {
  align-items: center;
}

.dashboard-config-page .dashboard-actions .dashboard-button {
  width: 178px;
}

.dashboard-config-page .dashboard-actions .dashboard-config-top-button {
  color: var(--colorPrincipal_6);
}

.config-options,
.config-shortcuts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.dashboard-config-page .dashboard-section:first-of-type {
  padding: 1rem 1.2rem;
}

.dashboard-config-page .dashboard-section:first-of-type .dashboard-section-header {
  margin-bottom: 0.8rem;
  min-height: 0;
}

.dashboard-config-page .dashboard-section:first-of-type .dashboard-section-header p {
  display: none;
}

.dashboard-config-page .dashboard-section:first-of-type .config-options {
  gap: 0.8rem;
}

.dashboard-config-page .dashboard-section:first-of-type .config-check {
  min-height: 44px;
  padding: 0.7rem 1rem;
}

.dashboard-config-page .dashboard-config-actions {
  display: none;
}

.config-shortcut-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.config-shortcut-group + .config-shortcut-group {
  margin-top: 1.8rem;
}

.config-shortcut-group h3 {
  color: var(--colorPrincipal_6);
  font-size: 1.35rem;
  font-weight: 500;
  margin: 0;
}

.config-check,
.config-shortcut {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 66px;
  padding: 1rem;
  border: 1px solid #edf0f2;
  border-radius: 8px;
  background: var(--colorBase_1);
  cursor: pointer;
}

.config-check span {
  color: var(--colorSecundario_5);
  font-size: 1.3rem;
  font-weight: 500;
}

.config-shortcut {
  align-items: flex-start;
  position: relative;
}

.config-shortcut:has(input:checked) {
  border-color: var(--colorPrincipal_2);
  background: #f4fffb;
}

.config-check input,
.config-shortcut input {
  width: 18px;
  height: 18px;
  margin-top: 0.7rem;
  accent-color: var(--colorPrincipal_6);
  flex: 0 0 auto;
}

.dashboard-config-message {
  padding: 1.2rem 1.5rem;
  border-radius: 8px;
  font-size: 1.3rem;
  font-weight: 500;
}

.dashboard-config-message[data-type="ok"] {
  background: var(--colorPrincipal_1);
  color: var(--colorPrincipal_6);
}

.dashboard-config-message[data-type="error"] {
  background: #fff1f1;
  color: #b42318;
}

@media (max-width: 1024px) {
  .dashboard-grid,
  .config-options,
  .config-shortcuts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shortcut-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .dashboard-page {
    height: auto;
    min-height: calc(100vh - 62px);
    overflow: visible;
  }

  body:has(.dashboard-page) {
    overflow: auto;
  }

  .dashboard-shell {
    width: min(100% - 2rem, 1180px);
    padding-top: 2rem;
    height: auto;
    display: flex;
    flex-direction: column;
  }

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

  .dashboard-heading h1 {
    font-size: 2.6rem;
  }

  .dashboard-actions,
  .dashboard-config-actions {
    justify-content: stretch;
  }

  .dashboard-button {
    flex: 1;
  }

  .dashboard-grid,
  .shortcut-grid,
  .shortcut-strip,
  .config-options,
  .config-shortcuts {
    grid-template-columns: 1fr;
  }

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

  .task-meta {
    display: none;
  }

  .dashboard-auxiliar-sad .dashboard-shell {
    width: min(100% - 1.6rem, 1180px);
    padding-top: 1.4rem;
  }

  .dashboard-auxiliar-sad .dashboard-heading h1 {
    font-size: 2.4rem;
  }

  .dashboard-auxiliar-sad .dashboard-panel {
    border-radius: 14px;
  }

  .dashboard-auxiliar-sad .panel-title {
    font-size: 1.8rem;
  }

  .dashboard-auxiliar-sad .task-row {
    min-height: 64px;
    padding: 1.4rem;
    border-radius: 10px;
  }

  .dashboard-auxiliar-sad .task-title {
    font-size: 1.5rem;
    line-height: 1.4;
  }
}
