@layer page {
  /* Year + month navigation */
  .history-nav {
    padding: 12px var(--content-padding) 0;
    position: sticky;
    top: 0;
    background: var(--color-bg-primary);
    z-index: var(--z-popup);
  }

  .history-year-row {
    margin-bottom: 12px;
  }

  .history-year-select {
    font-size: var(--text-normal);
    font-weight: 600;
    padding: 6px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-bg-white);
    color: var(--color-text);
    cursor: pointer;
  }

  .history-month-tabs {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-border);

    &::-webkit-scrollbar {
      display: none;
    }
  }

  .history-month-tab {
    flex-shrink: 0;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    font-size: var(--text-caption);
    font-weight: 500;
    text-decoration: none;
    color: var(--color-muted);
    text-transform: capitalize;

    &.active {
      background: var(--color-primary);
      color: #fff;
      font-weight: 600;
    }

    &:active {
      opacity: 0.7;
    }
  }

  /* Content list */
  .history-list {
    padding: 0;
  }

  .history-date-divider {
    padding: 12px var(--content-padding) 6px;
    font-size: var(--text-label);
    font-weight: 600;
    color: var(--color-muted);
    text-transform: capitalize;
    border-bottom: 1px solid var(--color-border);
  }

  .history-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px var(--content-padding);
    text-decoration: none;
    color: var(--color-text);
    border-bottom: 1px solid color-mix(in srgb, var(--color-border) 50%, transparent);

    > svg {
      width: 16px;
      height: 16px;
      color: var(--color-muted);
      flex-shrink: 0;
    }

    &:active {
      background: var(--color-bg-secondary);
    }
  }

  .history-col-time {
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
    width: 42px;
  }

  .history-col-neighborhood {
    font-size: var(--text-caption);
    color: var(--color-muted);
    flex-shrink: 0;
    width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .history-col-customer {
    flex: 1;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .history-col-status {
    flex-shrink: 0;
  }

  .history-empty {
    padding: 40px var(--content-padding);
    text-align: center;
    color: var(--color-muted);
  }
}
