/* Customer account and orders panel: summary cards, quick navigation, filters
   and colour-coded order status pills. Tailwind handles the shared shell. */

.sf-account-layout {
  display: grid;
  gap: 1rem;
}

/* The compiled Tailwind utilities define display on `.grid`/`.inline-flex`,
   which outranks the preflight `[hidden]` rule. The hidden attribute must win
   inside the customer panel so loading and error states stay off-screen. */
main [hidden] {
  display: none !important;
}

.sf-account-main,
.sf-account-aside {
  min-width: 0;
}

.sf-account-aside ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 1024px) {
  .sf-account-layout {
    /* Grid column 1 is the inline-start (right side in RTL): keep quick nav there. */
    grid-template-columns: minmax(16rem, 18rem) minmax(0, 1fr);
    align-items: start;
  }

  .sf-account-main {
    grid-column: 2;
    grid-row: 1;
  }

  .sf-account-aside {
    grid-column: 1;
    grid-row: 1;
  }
}

.sf-icon-badge {
  display: inline-flex;
  width: 2.5rem;
  height: 2.5rem;
  flex: none;
  align-items: center;
  justify-content: center;
  border-radius: 0.9rem;
  background: hsl(var(--secondary));
  color: hsl(var(--foreground));
}

.sf-icon-badge svg {
  width: 1.25rem;
  height: 1.25rem;
}

.sf-icon-badge--current {
  background: #fef3c7;
  color: #b45309;
}

.sf-icon-badge--delivered {
  background: #dcfce7;
  color: #15803d;
}

.sf-icon-badge--returned {
  background: #dbeafe;
  color: #1d4ed8;
}

.sf-icon-badge--cancelled {
  background: #fee2e2;
  color: #b91c1c;
}

.sf-quick-link {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.75rem;
  border: 0;
  border-radius: 0.75rem;
  background: transparent;
  padding: 0.55rem 0.6rem;
  color: hsl(var(--foreground));
  font: inherit;
  text-align: right;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}

.sf-quick-link:hover {
  background: hsl(var(--secondary) / 0.55);
  color: hsl(var(--accent));
}

.sf-quick-icon {
  display: inline-flex;
  width: 2.25rem;
  height: 2.25rem;
  flex: none;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  background: hsl(var(--secondary) / 0.55);
  color: hsl(var(--accent));
}

.sf-quick-icon svg {
  width: 1.125rem;
  height: 1.125rem;
}

.sf-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sf-filter-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid hsl(var(--border) / 0.7);
  border-radius: 9999px;
  background: hsl(var(--card));
  padding: 0.5rem 0.9rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.5;
  text-decoration: none;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.sf-filter-tab:hover {
  background: hsl(var(--secondary) / 0.55);
  color: hsl(var(--foreground));
}

.sf-filter-tab[aria-current="page"] {
  border-color: hsl(var(--primary));
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.sf-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4rem;
  border-radius: 9999px;
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  padding: 0.05rem 0.4rem;
  font-size: 0.68rem;
  line-height: 1.5;
  text-align: center;
}

.sf-filter-tab[aria-current="page"] .sf-filter-count {
  background: hsl(var(--primary-foreground) / 0.18);
  color: inherit;
}

.sf-order-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  border-radius: 9999px;
  padding: 0.22rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.6;
  white-space: nowrap;
}

.sf-order-pill::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  flex: none;
  border-radius: 9999px;
  background: currentColor;
}

.sf-order-pill--current {
  border-color: #fcd34d;
  background: #fffbeb;
  color: #92400e;
}

.sf-order-pill--delivered {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.sf-order-pill--returned {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

.sf-order-pill--cancelled {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #b91c1c;
}

.sf-account-layout :is(a, button, [tabindex]):focus-visible,
.sf-filter-tab:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}
