/*
 * Nice Guys Delivery admin theme.
 * Source values and consumers are recorded in the feature provenance ledger.
 *
 * Scope rule: this stylesheet owns brand composition only. Shell, sidebar, and
 * header presentation is consumed from the semantic token contract by the
 * owning renderer. Rules here must stay inside `.admin-theme-root`, must not
 * remap the global Tailwind palette, and must not force importance to recover
 * from a renderer gap.
 */

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/Geist/Geist-VariableFont_wght.ttf?v=1.3.3") format("truetype");
}

@font-face {
  font-family: "Geist";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/Geist/Geist-Italic-VariableFont_wght.ttf?v=1.3.3") format("truetype");
}

/*
 * Header height is desktop-only authority.
 *
 * The shell owns the header markup. The theme owns the approved 80px desktop
 * geometry and keeps localized actions on one line so they truncate inside
 * their existing title-backed controls instead of growing the shell. Mobile
 * remains content-sized because no mobile reference frame is approved.
 */
@media (min-width: 768px) {
  .admin-theme-root .admin-page-header.admin-page-header {
    box-sizing: border-box;
    height: var(--admin-header-height, 80px);
    min-height: var(--admin-header-height, 80px);
    padding-block: 7px;
  }

  .admin-theme-root .admin-page-header__row {
    height: 100%;
  }

  .admin-theme-root .admin-page-header__actions {
    flex-wrap: nowrap;
    max-width: 46%;
  }
}

@media (max-width: 767px) {
  .admin-theme-root .admin-page-header.admin-page-header {
    height: auto;
    min-height: 0;
  }
}

/*
 * Sidebar text colors.
 *
 * The compiled admin utility palette ships a dark sidebar. go-admin now drives
 * the sidebar surface, border, search field, shortcut chip, menus, avatar, and
 * presence dot from the semantic contract, so only the utility *text* classes
 * below still need a themed value. Each rule maps one utility class to the
 * token that already carries its meaning.
 */
.admin-theme-root #sidebar .text-sidebar-text {
  color: var(--admin-sidebar-text, var(--color-text-primary));
}

.admin-theme-root #sidebar .text-sidebar-text-muted {
  color: var(--color-text-secondary);
}

.admin-theme-root #sidebar .border-sidebar-border {
  border-color: var(--admin-sidebar-border, var(--color-border-default));
}

/*
 * DataGrid pagination summary.
 *
 * The upstream renderer retains a legacy text utility on the summary node.
 * Keep the semantic pagination token authoritative until that utility is
 * removed from the renderer.
 */
.admin-theme-root .admin-datagrid__pagination-text {
  color: var(--datagrid-pagination-text, var(--color-text-secondary));
}

/*
 * Navigation item states.
 *
 * go-admin resolves `.nav-item.active` from `--color-action-primary`, which is
 * the near-black primary action color. The approved sidebar uses the subtle
 * accent surface for the active item instead, with the standard sidebar text
 * color rather than inverse text.
 */
.admin-theme-root #sidebar .nav-item:not(.active):not(:hover) {
  color: var(--admin-sidebar-text, var(--color-text-primary));
}

.admin-theme-root #sidebar .nav-item.active {
  background: var(--admin-sidebar-item-hover, var(--color-surface-subtle));
  color: var(--admin-sidebar-text-active, var(--admin-sidebar-text));
}

/*
 * Themed navigation icons.
 *
 * `renderThemeMenuIcon` emits an <img> for delivered theme asset roles. The
 * exported masters are flat #525252 fills, so they are tinted to the resolved
 * sidebar text color and follow the active item like the library glyphs do.
 */
.admin-theme-root #sidebar .theme-menu-icon {
  opacity: 0.8;
}

.admin-theme-root #sidebar .nav-item:hover .theme-menu-icon,
.admin-theme-root #sidebar .nav-item.active .theme-menu-icon {
  opacity: 1;
}

/*
 * Brand lockup.
 *
 * The approved export matches the exact Figma image frame at 197x56.
 */
.admin-theme-root #sidebar .sidebar-brand-expanded .sidebar-logo {
  width: 197px;
  max-width: 100%;
  height: 56px;
  max-height: 56px;
  object-fit: contain;
  object-position: left center;
}

.admin-theme-root #sidebar .sidebar-brand-collapsed .sidebar-logo-compact {
  width: var(--admin-sidebar-brand-collapsed-size, var(--sidebar-brand-collapsed-size, 32px));
  height: var(--admin-sidebar-brand-collapsed-size, var(--sidebar-brand-collapsed-size, 32px));
  max-width: var(--admin-sidebar-brand-collapsed-size, var(--sidebar-brand-collapsed-size, 32px));
  max-height: var(--admin-sidebar-brand-collapsed-size, var(--sidebar-brand-collapsed-size, 32px));
  object-fit: contain;
  object-position: center;
}

/*
 * Exact Figma rail composition. Geometry remains token-driven in go-admin;
 * these brand rules only align the exported lockup and the navigation inset.
 */
.admin-theme-root #sidebar .sidebar-header {
  flex: 0 0 88px;
}

.admin-theme-root #sidebar .sidebar-brand-expanded {
  justify-content: center;
}

.admin-theme-root #sidebar .sidebar-navigation {
  padding-top: 4px;
}

.admin-theme-root #sidebar .collapsible-menu-item {
  margin-bottom: 0;
}

.admin-theme-root #sidebar .sidebar-submenu {
  margin-top: 4px;
}

.admin-theme-root #sidebar .sidebar-avatar {
  color: var(--color-text-primary);
  font-size: 12px;
  font-weight: 500;
}

/*
 * The approved toolbar stacks its navigation context above the page title.
 * The semantic hook is additive in go-admin and keeps the default horizontal
 * composition for themes that do not opt in.
 */
.admin-theme-root .admin-page-heading-group {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.admin-theme-root .admin-page-heading-group nav[aria-label="Breadcrumb"] {
  margin-bottom: 0;
}
