/* Counter shell and overview. Replaces the former sidebar presentation. */
html,
body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
}
body,
button,
input,
select,
textarea {
  font-family: var(--font);
}
body {
  font-size: 15px;
  line-height: 1.8;
}
*,
*::before,
*::after {
  box-shadow: none !important;
}
h1,
h2,
h3,
.counter-brand {
  font-family: var(--font-heading);
}
a {
  color: var(--brand-ink);
}
a:hover {
  color: var(--brand-deep);
}
.num {
  font-variant-numeric: tabular-nums;
}
.shell {
  display: block;
  min-height: 100vh;
  background: var(--canvas);
}
.counter-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.counter-header__inner {
  max-width: 1288px;
  padding: 0 24px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 32px;
  min-height: 64px;
}
.counter-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 17px;
  min-height: 44px;
}
.counter-logo {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand);
  color: white;
  display: grid;
  place-items: center;
  font-size: 15px;
}
.counter-menu {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 24px;
}
.primary-nav {
  display: flex;
  flex: 1;
  gap: 4px;
}
.primary-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 14px 16px;
  min-height: 64px;
  border-bottom: 3px solid transparent;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
}
.primary-nav a[aria-current='page'] {
  color: var(--text);
  font-weight: 600;
  border-color: var(--brand);
}
.counter-account {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-muted);
  white-space: nowrap;
}
.counter-account button,
.counter-menu-toggle {
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 0 14px;
  font: inherit;
  cursor: pointer;
}
.counter-menu-toggle {
  display: none;
}
.counter-subnav,
.counter-device-nav,
.counter-appearance {
  max-width: 1288px;
  margin: 0 auto;
  padding: 16px 24px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.counter-subnav a,
.counter-device-nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-bottom: 2px solid transparent;
  text-decoration: none;
  color: var(--text-muted);
}
.counter-subnav a[aria-current='page'],
.counter-device-nav a[aria-current='page'] {
  color: var(--brand-ink);
  border-color: var(--brand);
  font-weight: 600;
}
.counter-device-nav {
  padding-top: 4px;
  font-size: 13px;
}
.counter-device-nav a {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.counter-subnav[hidden],
.counter-device-nav[hidden],
.counter-appearance[hidden],
.counter-environment[hidden] {
  display: none;
}
.counter-appearance {
  justify-content: flex-end;
}
.counter-appearance .theme-button {
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.counter-environment {
  max-width: 1288px;
  margin: 0 auto;
  padding: 0 24px 24px;
  color: var(--text-muted);
  font-size: 13px;
}
.counter-mock {
  margin: 0;
  padding: 10px 24px;
  background: var(--danger-surface);
  color: var(--danger);
  text-align: center;
  font-weight: 600;
}
.main {
  width: 100%;
  max-width: 1288px;
  margin: 0 auto;
  padding: 28px 24px 48px;
  min-width: 0;
}
.page-head h1 {
  color: var(--heading);
  font-size: 28px;
}
.card,
.login__card,
.modal__card,
dialog {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.card,
.btn,
.login__card,
.modal__card,
.toast,
dialog,
input,
select,
textarea,
.switch span {
  box-shadow: none !important;
}
.btn {
  min-height: 44px;
  border-radius: 8px;
  font-size: 14px;
}
.btn--primary {
  background: var(--action);
  color: var(--action-ink);
}
.btn--ghost,
.btn--secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.kpi--total {
  background: var(--surface);
  color: var(--text);
}
:is(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--brand-ink);
  outline-offset: 3px;
  box-shadow: none;
}
.counter-overview {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.counter-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.counter-heading h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.8;
}
.counter-heading p {
  margin: 6px 0 0;
  color: var(--text-muted);
}
.counter-heading button {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}
.counter-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--alert-surface);
  border: 1px solid var(--alert-border);
  border-radius: 10px;
  padding: 12px 16px;
}
.counter-alert > div {
  flex: 1;
  min-width: 220px;
}
.counter-alert p {
  margin: 0;
}
.counter-alert a {
  font-weight: 600;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.counter-alert svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: none;
  stroke: var(--warning);
  stroke-width: 2;
}
.counter-strip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
}
.counter-cell {
  padding: 20px 24px;
  min-width: 0;
}
.counter-cell:not(:last-child) {
  border-inline-end: 1px solid var(--divider);
}
.counter-cell-label {
  color: var(--text-muted);
  font-size: 14px;
}
.counter-cell-value {
  font-size: 30px;
  font-weight: 600;
  margin-top: 6px;
  line-height: 1.8;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.counter-cell-value small {
  font-size: 15px;
  font-weight: 400;
  color: var(--text-muted);
}
.counter-cell-detail {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}
.counter-orders {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.counter-orders-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--divider);
  flex-wrap: wrap;
}
.counter-orders-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}
.counter-orders-head a {
  font-weight: 600;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.counter-table-wrap {
  overflow-x: auto;
}
.counter-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  min-width: 640px;
}
.counter-table th {
  color: var(--text-muted);
  font-size: 13px;
  text-align: right;
  padding: 12px 8px;
  font-weight: 500;
  background: transparent;
}
.counter-table th:first-child,
.counter-table td:first-child {
  padding-inline-start: 24px;
}
.counter-table th:last-child,
.counter-table td:last-child {
  padding-inline-end: 24px;
}
.counter-table td {
  padding: 14px 8px;
  border: 0;
  border-top: 1px solid var(--divider);
  vertical-align: middle;
}
.counter-table tbody tr:hover {
  background: var(--surface-muted);
}
.counter-table .counter-number {
  font-weight: 600;
}
.counter-time {
  color: var(--text-muted);
}
.counter-pill {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 13px;
  background: var(--neutral-surface);
  color: var(--neutral);
  white-space: nowrap;
}
.counter-pill--success {
  background: var(--success-surface);
  color: var(--success);
}
.counter-pill--warning {
  background: var(--warning-surface);
  color: var(--warning);
}
.counter-pill--danger {
  background: var(--danger-surface);
  color: var(--danger);
}
.counter-pill--info {
  background: var(--info-surface);
  color: var(--info);
}
.counter-footer-line {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}
.counter-empty {
  padding: 28px 24px;
  color: var(--text-muted);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.dashboard-loading,
.dashboard-error {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.dashboard-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: counter-spin 0.8s linear infinite;
}
@keyframes counter-spin {
  to {
    transform: rotate(360deg);
  }
}
.login {
  min-height: 100vh;
  padding: 24px;
  background: var(--canvas);
}
.login--entry {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
}
.login--entry[hidden] {
  display: none;
}
.login__top {
  width: min(420px, 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.login__wordmark {
  font-family: var(--font-heading);
  color: var(--brand-ink);
  font-weight: 700;
}
.login__top .theme-button {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  min-height: 44px;
  padding: 8px 12px;
  font: inherit;
}
.login__layout {
  width: min(420px, 100%);
}
.login__story {
  display: none;
}
.login__card {
  width: 100%;
  padding: 28px;
  max-width: 420px;
}
.login__logo {
  width: 64px;
  height: 64px;
}
.login__card h1 {
  font-size: 24px;
  margin-top: 14px;
}
.login__card .eyebrow,
.login__card .muted,
.login__note,
.login__footer {
  color: var(--text-muted);
  font-size: 13px;
}
.login__card label {
  font-size: 14px;
}
.login__card input {
  min-height: 44px;
  font: inherit;
  border-radius: 8px;
}
.login__note {
  margin-top: 12px;
}
.login__footer {
  text-align: center;
}
.modal__card,
dialog {
  box-shadow: none;
}
@media (max-width: 860px) {
  .counter-header__inner {
    padding: 12px 24px;
    flex-wrap: wrap;
    gap: 0;
  }
  .counter-brand {
    flex: 1;
  }
  .counter-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 64px;
  }
  .counter-menu {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-top: 12px;
  }
  .counter-menu.is-expanded {
    display: flex;
  }
  .primary-nav {
    display: flex;
    flex-direction: column;
    gap: 0;
  }
  .primary-nav a {
    min-height: 44px;
    padding: 10px 12px;
    justify-content: flex-start;
    border-bottom-width: 2px;
  }
  .counter-account {
    padding-top: 12px;
    margin-top: 8px;
    border-top: 1px solid var(--divider);
    justify-content: space-between;
  }
  .main {
    padding: 24px 24px 40px;
  }
  .counter-subnav,
  .counter-device-nav {
    padding-inline: 16px;
    gap: 4px;
  }
  .counter-subnav a {
    padding-inline: 10px;
    font-size: 13px;
  }
  .counter-heading h1 {
    font-size: 25px;
  }
  .counter-heading p {
    font-size: 13px;
  }
  .counter-heading button {
    padding-inline: 14px;
    font-size: 13px;
  }
  .counter-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .counter-cell {
    padding: 16px;
  }
  .counter-cell:nth-child(2) {
    border-inline-end: 0;
  }
  .counter-cell:nth-child(-n + 2) {
    border-bottom: 1px solid var(--divider);
  }
  .counter-cell-value {
    font-size: 26px;
    white-space: normal;
  }
  .counter-cell-value small {
    font-size: 12px;
  }
  .counter-cell-label,
  .counter-cell-detail {
    font-size: 12px;
  }
  .counter-orders-head {
    padding: 14px 16px;
  }
  .counter-orders-head h2 {
    font-size: 16px;
  }
  .counter-orders-head a {
    font-size: 13px;
  }
  .counter-table-wrap {
    overflow: visible;
  }
  .counter-table,
  .counter-table tbody {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .counter-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .counter-table tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas: 'number status' 'items items' 'method amount';
    gap: 8px 12px;
    padding: 16px;
    border-bottom: 1px solid var(--divider);
  }
  .counter-table tbody tr:last-child {
    border-bottom: 0;
  }
  .counter-table td,
  .counter-table td:first-child,
  .counter-table td:last-child {
    display: block;
    border: 0;
    padding: 0;
    min-width: 0;
    font-size: 13px;
  }
  .counter-table .counter-number {
    grid-area: number;
  }
  .counter-table .counter-time {
    grid-area: number;
    justify-self: end;
    font-size: 12px;
    align-self: end;
    padding-inline-end: 0;
  }
  .counter-table .counter-number {
    padding-bottom: 20px;
  }
  .counter-table .counter-items {
    grid-area: items;
    color: var(--text-muted);
  }
  .counter-table .counter-method {
    grid-area: method;
    color: var(--text-muted);
  }
  .counter-table .counter-amount {
    grid-area: amount;
    text-align: left;
  }
  .counter-table .counter-status {
    grid-area: status;
    justify-self: end;
    align-self: start;
  }
  .counter-pill {
    font-size: 12px;
    white-space: normal;
  }
  .counter-alert {
    gap: 8px;
    font-size: 13px;
  }
  .counter-alert > div {
    min-width: 0;
    flex-basis: calc(100% - 32px);
  }
  .counter-alert a {
    margin-inline-start: 28px;
  }
  .counter-footer-line {
    font-size: 12px;
  }
  .login {
    padding: 18px;
  }
  .login__card {
    padding: 24px;
  }
  .login__top .theme-button {
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .dashboard-spinner {
    animation: none;
  }
}
