/* backoffice/_dashboard_fragment.html — divintech.es admin layout: a
   280px sidebar (icon + label per section, sign out at the bottom, blue-tint
   right border) and the selected section on the right. Below 62rem the
   sidebar sits above the content (items wrap); below 40rem it's a single
   row of compact tabs. */

.bo-layout {
  display: flex;
  flex-direction: column;
  min-height: 70vh;
}

.bo-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: var(--space-1) var(--space-2);
  border-bottom: 1px solid var(--color-main-tint);
  background: var(--color-bg);
}

/* Narrow screens: items wrap (only .table-wrap may scroll sideways). */
.bo-sidebar__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bo-sidebar__list > li {
  flex: 1 1 auto;
}

.bo-sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  min-height: var(--tap-size);
  padding: 0.6rem 0.9rem;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--color-text);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.bo-sidebar__link:hover {
  background: var(--color-accent-soft);
  color: var(--color-text);
}

.bo-sidebar__link:focus-visible {
  outline-offset: -3px;
}

/* Tinted background (as on divintech.es) + weight + bar: not colour alone. */
.bo-sidebar__link[aria-current="page"] {
  background: var(--color-accent-soft);
  font-weight: 700;
  box-shadow: inset 4px 0 0 var(--color-accent-text);
}

.bo-sidebar__icon {
  width: 1.75rem;
  height: 1.75rem;
  color: var(--color-main);
}

.bo-sidebar__footer {
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-main-tint);
}

.bo-main {
  flex: 1;
  min-width: 0;
  padding: var(--space-3);
}

.bo-title {
  margin: 0 0 var(--space-2);
  color: var(--color-main);
  font-size: 1.35rem;
  font-weight: 700;
}

.bo-empty p {
  max-width: 40rem;
}

/* Phones: the sections and "Cerrar sesión" share one compact row of
   equal tabs (icon above the label, active one underlined) instead of
   stacking up ~3 rows above the content. */
@media (max-width: 39.99rem) {
  .bo-sidebar {
    flex-direction: row;
    align-items: stretch;
    gap: 0.25rem;
    padding: 0.4rem var(--space-1);
  }

  /* Equal widths, but never narrower than a whole word: with more sections
     than fit, they wrap onto a second row instead of breaking words. */
  .bo-sidebar__list {
    flex: 1 1 auto;
    gap: 0.25rem;
  }

  .bo-sidebar__list > li {
    flex: 1 1 0;
    min-width: min-content;
  }

  .bo-sidebar__footer {
    display: flex;
    flex: 0 1 5.5rem;
    min-width: min-content;
    padding: 0 0 0 0.25rem;
    border-top: 0;
    border-left: 1px solid var(--color-main-tint);
  }

  .bo-sidebar__link {
    flex-direction: column;
    justify-content: center;
    gap: 0.2rem;
    height: 100%;
    min-height: 3.5rem;
    padding: 0.35rem 0.2rem;
    font-size: 0.8125rem;
    line-height: 1.2;
    text-align: center;
  }

  .bo-sidebar__link[aria-current="page"] {
    box-shadow: inset 0 -3px 0 var(--color-accent-text);
  }

  .bo-sidebar__icon {
    width: 1.5rem;
    height: 1.5rem;
  }

  .bo-main {
    padding: var(--space-2);
  }
}

@media (min-width: 62rem) {
  .bo-layout {
    flex-direction: row;
    align-items: stretch;
  }

  .bo-sidebar {
    position: sticky;
    top: var(--navbar-offset, 0px);
    align-self: flex-start;
    justify-content: space-between;
    flex: none;
    width: 17.5rem;
    min-height: 75vh;
    padding: var(--space-3) var(--space-2);
    border-right: 1px solid var(--color-main-tint);
    border-bottom: 0;
  }

  .bo-sidebar__list {
    flex-direction: column;
    flex-wrap: nowrap;
  }

  .bo-sidebar__link {
    padding: 0.75rem 1rem;
    font-size: 1.05rem;
  }

  .bo-sidebar__icon {
    width: 2.25rem;
    height: 2.25rem;
  }
}
