/* This file is for your main application CSS */

/*
 * Dashboard: grelha estável (min-width media queries) + minmax(0) nos filhos.
 * O default.css Tailwind/daisy usa @media (width >= …) que alguns browsers tratam mal,
 * e muitas utilities (py-8, max-w-7xl, etc.) não estão no bundle pré-compilado.
 */
#vcall-dashboard {
  width: 100%;
  max-width: 72rem;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

#vcall-dashboard-kpis {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

/* Painéis: empilhados em ecrã estreito; duas colunas só a partir de lg para evitar colunas “esmagadas”. */
#vcall-dashboard-panels {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
}

#vcall-dashboard-panels > * {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}

#vcall-dashboard-kpis > *,
#vcall-dashboard-panels > section {
  min-width: 0;
}

@media (min-width: 640px) {
  #vcall-dashboard-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  #vcall-dashboard-panels {
    flex-direction: row;
    align-items: stretch;
  }

  #vcall-dashboard-panels > * {
    flex: 1 1 0%;
    width: auto;
  }
}

/*
 * Utilities used by LiveViews (e.g. DashboardLive) that are NOT shipped in
 * priv/static/assets/default.css — without these, `flex` stays row (no flex-col),
 * nested columns collapse sideways, and overflow scroll areas get zero width.
 */
.flex-col {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.min-h-0 {
  min-height: 0;
}

.min-w-0 {
  min-width: 0;
}

.overflow-hidden {
  overflow: hidden;
}

.overflow-y-auto {
  overflow-y: auto;
}

.overflow-x-auto {
  overflow-x: auto;
}

.overflow-x-hidden {
  overflow-x: hidden;
}

.leading-relaxed {
  line-height: 1.625;
}

.max-w-md {
  max-width: 28rem;
}

.justify-center {
  justify-content: center;
}

.border-dashed {
  border-style: dashed;
}

/* Top bar: nav + theme/locale segmented controls */
#vcall-topbar {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  padding: 0.5rem 1rem;
  position: relative;
  z-index: 20;
}

#vcall-topbar-nav.menu {
  flex-wrap: wrap;
  justify-content: flex-end;
}

#vcall-topbar-tools {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.vcall-segmented {
  display: inline-flex;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid color-mix(in oklab, var(--color-base-content) 18%, transparent);
  border-radius: 0.375rem;
  background: var(--color-base-100);
}

.vcall-segmented button {
  appearance: none;
  border: 0;
  margin: 0;
  background: transparent;
  color: var(--color-base-content);
  cursor: pointer;
  font-size: 0.75rem;
  line-height: 1rem;
  padding: 0.375rem 0.625rem;
  min-width: 2.5rem;
}

.vcall-segmented button:hover:not(.is-active) {
  background: color-mix(in oklab, var(--color-base-content) 8%, transparent);
}

.vcall-segmented button.is-active {
  background: var(--color-primary);
  color: var(--color-primary-content);
  font-weight: 600;
}

.vcall-segmented button + button,
.vcall-segmented form + form button,
.vcall-segmented form + button,
.vcall-segmented button + form button {
  border-left: 1px solid color-mix(in oklab, var(--color-base-content) 18%, transparent);
}

.vcall-segmented form {
  display: contents;
}

.vcall-segmented-label {
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.55;
  padding-right: 0.125rem;
  align-self: center;
}
