/* Sidebar + top bar shell (ported from the Laravel app). */
.ez_app-shell {
  display: grid;
  grid-template-columns: var(--ez-sidebar-width) minmax(0, 1fr);
  min-block-size: 100vh;
  background: var(--ez-color-bg);
  transition: grid-template-columns 220ms ease;
}

.ez_app-shell--collapsed {
  grid-template-columns: var(--ez-sidebar-width-collapsed) minmax(0, 1fr);
}

.ez_app-body {
  display: flex;
  flex-direction: column;
  min-inline-size: 0;
}

.ez_app-main {
  flex: 1;
  position: relative;
  min-inline-size: 0;
  padding: var(--ez-space-5);
  /* hidden row menus sit inside scrolling tables and must not widen the page (clip, unlike hidden, keeps sticky working) */
  overflow-x: clip;
}

/* ---- sidebar ---- */
.ez_sidebar {
  position: sticky;
  inset-block-start: 0;
  display: flex;
  flex-direction: column;
  block-size: 100vh;
  padding: var(--ez-space-4) var(--ez-space-3);
  overflow-x: hidden;
  background: var(--ez-color-surface-sunken);
  border-inline-end: 1px solid var(--ez-color-surface-variant);
  box-shadow: var(--ez-shadow-edge);
}

.ez_sidebar__brand {
  display: flex;
  align-items: center;
  gap: var(--ez-space-3);
  padding: var(--ez-space-2) var(--ez-space-2) var(--ez-space-5);
  color: var(--ez-color-text-primary);
  text-decoration: none;
  white-space: nowrap;
}

.ez_sidebar__mark {
  display: block;
  box-sizing: content-box;
  inline-size: 1.75rem;
  block-size: auto;
  padding: var(--ez-space-1);
  flex: none;
  background: var(--ez-color-logo-plate);
  border-radius: var(--ez-radius-field);
}

.ez_sidebar__name {
  overflow: hidden;
  font-family: var(--ez-font-family-brand);
  font-size: 1.0625rem;
  letter-spacing: 0.025em;
  text-overflow: ellipsis;
}

.ez_sidebar__nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--ez-space-1);
  overflow-y: auto;
}

.ez_sidebar__item {
  display: flex;
  align-items: center;
  gap: var(--ez-space-3);
  inline-size: 100%;
  padding: var(--ez-space-3);
  background: transparent;
  color: var(--ez-color-text-muted);
  border: 0;
  border-radius: var(--ez-radius-pill);
  font-size: var(--ez-font-size-sm);
  font-weight: var(--ez-font-weight-medium);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--ez-duration-fast), color var(--ez-duration-fast);
}

.ez_sidebar__item:hover {
  background: var(--ez-color-surface-container-high);
  color: var(--ez-color-text-primary);
}

.ez_sidebar__item[aria-current="page"] {
  background: var(--ez-color-action-primary);
  color: var(--ez-color-on-action-primary);
  box-shadow: inset 3px 0 0 var(--ez-color-accent);
}

.ez_sidebar__heading {
  margin-block-start: var(--ez-space-3);
  padding: var(--ez-space-2) var(--ez-space-3) 0;
  color: var(--ez-color-text-muted);
  font-size: var(--ez-font-size-xs);
  font-weight: var(--ez-font-weight-medium);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ez_sidebar__label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.ez_sidebar__footer {
  display: flex;
  flex-direction: column;
  padding-block-start: var(--ez-space-3);
  border-block-start: 1px solid var(--ez-color-surface-variant);
}

.ez_sidebar__collapse-open {
  display: none;
}

.ez_app-shell--collapsed .ez_sidebar__collapse-open {
  display: inline-block;
}

.ez_app-shell--collapsed .ez_sidebar__collapse-close {
  display: none;
}

/* Collapsed: icon rail only */
.ez_app-shell--collapsed .ez_sidebar__name,
.ez_app-shell--collapsed .ez_sidebar__label {
  display: none;
}

.ez_app-shell--collapsed .ez_sidebar__heading {
  padding: 0;
  border-block-start: 1px solid var(--ez-color-border);
  font-size: 0;
}

.ez_app-shell--collapsed .ez_sidebar__brand,
.ez_app-shell--collapsed .ez_sidebar__item {
  justify-content: center;
  padding-inline: 0;
}

/* ---- top bar ---- */
.ez_topbar {
  position: sticky;
  inset-block-start: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--ez-space-3);
  block-size: var(--ez-topbar-height);
  padding-inline: var(--ez-space-5);
  background: var(--ez-color-surface);
  border-block-start: 4px solid var(--ez-color-accent);
  border-block-end: 1px solid var(--ez-color-surface-variant);
  box-shadow: var(--ez-shadow-sm);
}

.ez_topbar__branch {
  display: flex;
  align-items: center;
  gap: var(--ez-space-2);
}

/* The branch and product pickers are matching pills: same height, equal padding either side, a drawn chevron. */
.ez_topbar__branch .ez_input,
.ez_topbar__branch .ez_input.ez_input--compact.ez_input--select {
  inline-size: auto;
  min-inline-size: 9rem;
  min-block-size: 2.5rem;
  appearance: none;
  padding-block: 0;
  padding-inline: var(--ez-space-4) 2.5rem;
  border-radius: var(--ez-radius-pill);
  border-block-end: 0;
  line-height: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a9bb0' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--ez-space-4) center;
  cursor: pointer;
}

.ez_topbar__branch-name {
  color: var(--ez-color-text-muted);
  font-size: var(--ez-font-size-sm);
}

.ez_app-footer {
  padding: var(--ez-space-4) var(--ez-space-5);
  color: var(--ez-color-text-muted);
  font-size: var(--ez-font-size-sm);
}

/* ---- guest (sign-in) shell ---- */
.ez_guest-shell {
  position: relative;
  display: grid;
  place-items: center;
  min-block-size: 100vh;
  padding: var(--ez-space-4);
  background: var(--ez-color-bg);
}

.ez_guest-shell__tools {
  position: absolute;
  inset-block-start: var(--ez-space-4);
  inset-inline-end: var(--ez-space-4);
}

.ez_auth-card {
  inline-size: min(100%, 26.25rem);
  padding: var(--ez-space-7) var(--ez-space-5);
  background: var(--ez-color-surface);
  border: 1px solid var(--ez-color-surface-variant);
  border-radius: var(--ez-radius-lg);
  box-shadow: var(--ez-shadow-md);
}

/* A public page that needs room to read, such as a shared sermon. */
.ez_auth-card--wide {
  inline-size: min(100%, 52rem);
}

.ez_auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--ez-space-3);
  margin-block-end: var(--ez-space-5);
  font-family: var(--ez-font-family-brand);
  font-size: 1.75rem;
  letter-spacing: 0.025em;
}

.ez_auth-brand .ez_sidebar__mark {
  inline-size: 3.5rem;
}

/* Forms inside the sign-in card use the card itself as their surface. */
.ez_auth-card .ez_card {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

/* Sign-in, sign-up and reset pages: heading, text and links centred; the fields themselves stay left-aligned. */
.ez_auth-card:not(.ez_auth-card--wide) .ez_card__title {
  font-size: var(--ez-font-size-lg);
}

.ez_auth-card:not(.ez_auth-card--wide) .ez_card__title,
.ez_auth-card:not(.ez_auth-card--wide) .ez_card > p {
  text-align: center;
}

@media (max-width: 900px) {
  .ez_app-shell,
  .ez_app-shell--collapsed {
    grid-template-columns: var(--ez-sidebar-width-collapsed) minmax(0, 1fr);
  }

  .ez_sidebar__name,
  .ez_sidebar__label,
  .ez_sidebar__footer {
    display: none;
  }

  .ez_sidebar__heading {
    padding: 0;
    border-block-start: 1px solid var(--ez-color-border);
    font-size: 0;
  }

  .ez_sidebar__brand,
  .ez_sidebar__item {
    justify-content: center;
    padding-inline: 0;
  }

  .ez_app-main {
    padding: var(--ez-space-4);
  }
}

@media print {
  .ez_sidebar,
  .ez_topbar,
  .ez_app-footer,
  .ez_no-print {
    display: none;
  }

  .ez_app-shell {
    display: block;
  }
}

/* The public tracking page is a single centred column: title, hint, code box, button and result all centre. */
.ez_track,
.ez_track .ez_card {
  text-align: center;
}

.ez_track .ez_field__box {
  text-align: start;
}

.ez_track .ez_input {
  text-align: center;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.ez_track__stage {
  font-size: 1.25rem;
}

/* Compact inputs for rows of a table (quantities, new prices): no floating label, a fixed width. */
.ez_input.ez_input--cell {
  inline-size: 8rem;
  min-block-size: 2.5rem;
  padding: var(--ez-space-2) var(--ez-space-3);
  text-align: end;
}

.ez_row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--ez-space-3);
}

.ez_row-actions form {
  display: flex;
  align-items: center;
  gap: var(--ez-space-2);
}

/* A result under the code box is set off by a rule, since the sign-in card strips the card chrome. */
.ez_auth-card .ez_track .ez_card + .ez_card {
  padding-block-start: var(--ez-space-4);
  border-block-start: 1px solid var(--ez-color-border);
  border-radius: 0;
}

.ez_input.ez_input--cell::placeholder {
  color: var(--ez-color-text-muted);
  opacity: 1;
}
