/* Global mobile-first layout primitives shared by dashboard and auth templates. */
:root{
  --container-max: 78rem;
  --layout-gap: clamp(0.75rem, 2.4vw, 1rem);
  --section-space: clamp(0.75rem, 2.6vw, 1.25rem);
}

.page{
  width: 100%;
  min-width: 0;
}

.container{
  width: min(100% - 1rem, var(--container-max));
  margin-inline: auto;
}

.section{
  margin-block: var(--section-space);
}

.grid{
  display: grid;
  gap: var(--layout-gap);
  min-width: 0;
}

.grid-2,
.grid-3{
  grid-template-columns: 1fr;
}

.toolbar{
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.625rem;
}

.toolbar-left,
.toolbar-right{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.toolbar-right{
  justify-content: flex-start;
}

.btn-block{
  width: 100%;
  min-height: 44px;
  justify-content: center;
}

.table-wrap{
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

.modal-dialog{
  width: min(100%, 56rem);
  max-height: min(86dvh, 56rem);
  overflow: auto;
}

.modal-body{
  overflow-wrap: anywhere;
}

.alert{
  width: 100%;
  overflow-wrap: anywhere;
}

@media (min-width: 576px){
  .container{
    width: min(100% - 1.5rem, var(--container-max));
  }

  .toolbar{
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .toolbar-right{
    justify-content: flex-end;
  }
}

@media (min-width: 768px){
  .grid-2{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 980px){
  .grid-3{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .btn-block{
    width: auto;
    min-height: 34px;
  }
}
