@charset "UTF-8";
/* list-pages.css — List pages: the title's view menu, compact toolbar, rows and footer.
   Loaded in order by templates/partials/styles.html. */

/* ============================ Title view menu ==============================
   <details class="title-menu"> in the page title: the title itself opens a
   card of views (All / Active / Inactive, with counts). htmx-app.js applies
   the choice; tables.js closes the card on an outside click or Escape. */

/* the title row sits above the panels after it, so the open card is not
   hidden under the table */
.page-head {
  position: relative;
  z-index: 5;
}

.title-menu {
  position: relative;
}
.title-menu > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: -8px;
  padding: 2px 8px;
  border-radius: var(--r-sm);
  list-style: none;
  cursor: pointer;
  transition: background-color var(--t-fast);
}
.title-menu > summary::-webkit-details-marker {
  display: none;
}
.title-menu > summary:hover,
.title-menu[open] > summary {
  background: var(--surface-3);
}
.title-menu > summary ion-icon {
  font-size: 0.9rem;
  color: var(--text-3);
  transition: transform var(--t-fast);
}
.title-menu[open] > summary ion-icon {
  transform: rotate(180deg);
}

/* the card */
.title-menu__panel {
  position: absolute;
  top: calc(100% + 6px);
  left: -8px;
  z-index: 70;
  width: 260px;
  padding: var(--s-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  animation: menu-in 0.16s var(--ease);
}
.title-menu__head {
  display: block;
  padding: var(--s-1) var(--s-3) var(--s-2);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.title-menu__item {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  padding: 9px var(--s-3);
  border: none;
  border-radius: var(--r-md);
  background: none;
  font: inherit;
  font-size: var(--fs-md);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.title-menu__item ion-icon {
  font-size: 1.1rem;
  color: var(--text-3);
}
.title-menu__item:hover {
  background: var(--surface-3);
}
.title-menu__item.is-active {
  background: var(--primary-50);
  color: var(--primary-600);
  font-weight: 600;
}
.title-menu__item.is-active ion-icon {
  color: var(--primary-600);
}
/* the count on the right of each choice */
.title-menu__count {
  margin-left: auto;
  min-width: 30px;
  padding: 1px 8px;
  border-radius: var(--r-full);
  background: var(--surface-3);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-align: center;
  color: var(--text-2);
}
.title-menu__item.is-active .title-menu__count {
  background: var(--primary-100);
  color: var(--primary-600);
}


/* ======================= Compact lists: toolbar, rows, footer ==============
   Smaller controls around list tables (Item Group, GST Rate, the Company
   page's logins), so more rows fit on screen. */

/* 1. toolbar above the table: a small search box and Export button */
.toolbar {
  gap: var(--s-2);
  padding: var(--s-3) var(--s-4);
}
.toolbar .search ion-icon {
  left: 11px;
  font-size: 0.95rem;
}
.toolbar .search input {
  height: 32px;
  padding-left: 34px;
  font-size: var(--fs-sm);
}
.toolbar .btn--sm {
  height: 30px;
  gap: 6px;
  padding: 0 var(--s-3);
}
.toolbar .btn--sm ion-icon {
  font-size: 0.95rem;
}

/* 2. rows: a little shorter */
.table--mini thead th {
  padding: 6px var(--s-3);
}
.table--mini tbody td {
  padding: 4px var(--s-3);
}
/* edit / delete: easy to hit, with room off the table's right edge */
.table--mini .actions .icon-btn {
  width: 28px;
  height: 28px;
  font-size: 1.05rem;
}
.table--mini td.actions,
.table--mini th.actions {
  padding-right: var(--s-5);
}
.table--mini .row-actions {
  gap: 6px;
}

/* 3. the footer under the table: small text, page buttons and "per page" */
.panel__foot {
  padding: var(--s-2) var(--s-4);
}
.pagination__info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
  font-size: var(--fs-sm);
}
.panel__foot .pagination button {
  min-width: 28px;
  height: 28px;
  font-size: var(--fs-sm);
}
.pagination__size {
  width: auto;
  min-height: 0;
  height: 28px;
  padding: 0 26px 0 var(--s-2);
  font-size: var(--fs-xs);
  border-radius: var(--r-sm);
  /* the stock .select arrow, moved in for the narrower box */
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%;
  background-size: 5px 5px;
}


/* ---- the title dropdown: a soft brand-tinted card ------------------------
   "All Item Groups ▾" sits on a gentle blue-to-green tint made from the
   brand's primary and accent colours mixed into the page surface — so it is
   a light pastel in light mode and a quiet tinted dark in dark mode, with
   the theme's own text colour on top: easy to read in both. The dropdown
   carries the same tint in its header and on the chosen view. */
.title-menu {
  --title-tint-a: color-mix(in srgb, var(--primary-500) 13%, var(--surface));
  --title-tint-b: color-mix(in srgb, var(--accent-500) 13%, var(--surface));
  --title-tint-strong: color-mix(in srgb, var(--primary-500) 22%, var(--surface));
  --title-line: color-mix(in srgb, var(--primary-500) 32%, transparent);
}
.title-menu > summary {
  margin-left: 0;
  padding: 3px 10px;
  border: 1px solid var(--title-line);
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, var(--title-tint-a), var(--title-tint-b));
}
.title-menu > summary:hover,
.title-menu[open] > summary {
  background: linear-gradient(135deg, var(--title-tint-strong), var(--title-tint-b));
}
.title-menu > summary .page-title {
  color: var(--text);
}
.title-menu > summary ion-icon {
  color: var(--primary-600);
}

.title-menu__panel {
  left: 0;
  padding-top: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
}
.title-menu__head {
  margin: 0 calc(var(--s-2) * -1) var(--s-2);
  padding: var(--s-2) var(--s-4);
  background: linear-gradient(135deg, var(--title-tint-a), var(--title-tint-b));
  border-bottom: 1px solid var(--title-line);
  color: var(--primary-600);
}
.title-menu__item {
  color: var(--text-2);
}
.title-menu__item ion-icon {
  color: var(--text-3);
}
.title-menu__item:hover {
  background: var(--surface-3);
  color: var(--text);
}
.title-menu__item.is-active {
  background: var(--title-tint-a);
  color: var(--primary-600);
}
.title-menu__item.is-active ion-icon {
  color: var(--primary-600);
}
.title-menu__count {
  background: var(--surface-3);
  color: var(--text-2);
}
.title-menu__item.is-active .title-menu__count {
  background: var(--primary-600);
  color: #fff;
}

/* ---- Page settings → Columns: a tick list inside the ⋮ menu ---------- */
.col-toggles {
  display: grid;
  gap: 2px;
  padding: 0 var(--s-1) var(--s-1);
}
.col-toggle {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 7px var(--s-2);
  border-radius: var(--r-sm);
  font-size: var(--fs-md);
  color: var(--text-2);
  cursor: pointer;
}
.col-toggle:hover {
  background: var(--surface-3);
}
.col-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary-600);
  cursor: pointer;
}
.col-toggle input:disabled,
.col-toggle:has(input:disabled) {
  cursor: default;
  opacity: 0.6;
}
/* a long list (a report's ⋮ → Columns): about nine rows, then it scrolls on
   its own — the heading above and "Standard columns" below stay in view */
.col-toggles--scroll {
  max-height: min(320px, calc(100vh - 240px));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding-top: var(--s-1);
}

/* ---- list pages: the table takes the whole page height ---------------- */
/* A slim, even margin round the table card — 16px at the sides, 12px below —
   so it still fills the page but does not touch the edges. The title row
   lines up with the card's edges. */
@supports selector(:has(*)) {
  @media (min-width: 641px) {
    .content:has(.table-wrap--fill) {
      padding: var(--s-3) var(--s-4);
    }
    .content > .panel:has(.table-wrap--fill) {
      border-radius: var(--r-md);
      box-shadow: var(--shadow-xs);
    }
  }
}

/* ---- ⋮ "more options" beside a page's main button ----------------------
   <details class="more-menu"> — a menu of options and settings; tables.js
   closes it on an outside click, a pick, or Escape. */
.more-menu {
  position: relative;
}
.more-menu > summary {
  list-style: none;
}
.more-menu > summary::-webkit-details-marker {
  display: none;
}
.page-head__actions .btn--icon {
  width: 30px;
  padding: 0;
}
.more-menu[open] > summary {
  background: var(--surface-3);
}
.more-menu__panel {
  top: calc(100% + 6px);
  min-width: 220px;
}
/* a small heading inside the menu ("Export as") */
.more-menu__label {
  display: block;
  padding: var(--s-1) var(--s-3);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
/* the menu items are links and buttons alike */
.more-menu__panel button.menu__item {
  width: 100%;
  border: none;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
