/* ══════════════════════════════════════════════════════════════════════════
   ShopCore Admin — Fluent 2 components
   ══════════════════════════════════════════════════════════════════════════

   One block per component in Components/, in the order they were redesigned.
   Linked after shopcore-admin.css and the shared shell, so these rules refine
   shape, weight and spacing; colours still come from the tokens.
   ────────────────────────────────────────────────────────────────────────── */

/* ═══ KpiCard · SummaryStrip ═══════════════════════════════════════════════
   A number and what it is. No coloured bar down the edge, no shouting label:
   the label is ordinary text above, the figure is the largest thing, and the
   tone lives in the icon tile and the trend. */
.sc-kpi { padding: 16px 16px 14px; }
.sc-kpi::after { display: none; }
.sc-kpi:hover { box-shadow: var(--shadow-4); }
.sc-kpi-header { margin-bottom: 8px; align-items: center; }
.sc-kpi-label { font-size: var(--fs-body-sm); font-weight: var(--fw-regular); color: var(--fg-3);
                text-transform: none; letter-spacing: 0; }
.sc-kpi-icon { width: 28px; height: 28px; border-radius: var(--r-md);
               background: color-mix(in srgb, var(--kpi-c, var(--brand-primary)) 14%, var(--neutral-layer)); }
.sc-kpi-icon svg { width: 16px; height: 16px; }
.sc-kpi-value { font-size: 28px; font-weight: var(--fw-semibold); letter-spacing: -.02em; line-height: 1.15; margin-bottom: 4px; }
.sc-kpi-trend { font-weight: var(--fw-semibold); }
.sc-kpi-trend.up   { color: var(--success-fg); }
.sc-kpi-trend.down { color: var(--error-fg); }
.sc-kpi-trend.flat { color: var(--fg-3); }

.sc-summary-strip { background: var(--neutral-layer); border: 1px solid var(--stroke-2); border-radius: var(--r-lg);
                    box-shadow: var(--shadow-2); padding: 4px 0; }
.sc-summary-item { padding: 10px 20px; gap: 2px; }
.sc-summary-label { font-size: var(--fs-body-sm); font-weight: var(--fw-regular); color: var(--fg-3);
                    text-transform: none; letter-spacing: 0; }
.sc-summary-value { font-size: 20px; font-weight: var(--fw-semibold); letter-spacing: -.01em;
                    font-variant-numeric: tabular-nums; }
.sc-summary-sep { background: var(--stroke-2); }

/* ═══ StatusBadge ══════════════════════════════════════════════════════════
   Fluent's tint badge: a soft fill, no outline, a small dot that carries the
   colour for people who cannot rely on the tint alone. */
.sc-badge { border-radius: var(--r-md); padding: 2px 8px; gap: 6px; border-color: transparent;
            font-size: var(--fs-caption); line-height: 1.5; }
.sc-badge-dot { width: 6px; height: 6px; }
.badge-success, .badge-warning, .badge-error, .badge-info,
.badge-neutral, .badge-primary, .badge-purple, .badge-accent { border-color: transparent; }
.badge-neutral { background: var(--neutral-subtle-hover); }

/* ═══ DataGrid · tables · Pagination ═══════════════════════════════════════
   Rows are 44px, the header stays put while the body scrolls, and a clickable
   row says so with a pointer and a tint rather than an arrow on every line. */
.sc-table-wrap { max-height: calc(100vh - 280px); overflow: auto; }
.sc-table { border-collapse: separate; border-spacing: 0; width: 100%; }
.sc-table thead th { position: sticky; top: 0; z-index: 1; height: 40px; padding: 0 16px; text-align: left;
                     background: var(--neutral-layer); color: var(--fg-3); font-weight: var(--fw-semibold);
                     font-size: var(--fs-body-sm); text-transform: none; letter-spacing: 0;
                     border-bottom: 1px solid var(--stroke-1); white-space: nowrap; }
.sc-table tbody td { height: 44px; padding: 6px 16px; border-bottom: 1px solid var(--stroke-3); color: var(--fg-2); vertical-align: middle; }
.sc-table tbody tr:last-child td { border-bottom: 0; }
.sc-table tbody tr:hover td { background: var(--neutral-subtle); }
.sc-table-clickable tbody tr { cursor: pointer; }
.sc-table-clickable tbody tr:active td { background: var(--neutral-subtle-hover); }
.sc-cell-primary { font-weight: var(--fw-semibold); color: var(--fg-1); }
.sc-cell-sub { font-size: var(--fs-caption); color: var(--fg-3); }
.sc-cell-mono { font-family: var(--font-mono); font-size: var(--fs-body-sm); }

.sc-pagination { padding: 10px 16px; border-top: 1px solid var(--stroke-2); background: var(--neutral-layer); }
.sc-pagination-info { font-size: var(--fs-body-sm); color: var(--fg-3); }
.sc-page-btn { min-width: 32px; height: 32px; border-radius: var(--r-md); border-color: transparent; background: transparent;
               font-weight: var(--fw-semibold); }
.sc-page-btn:hover:not(:disabled):not(.active) { background: var(--neutral-subtle-hover); }
.sc-page-btn.active { background: var(--brand-tint-60); color: var(--brand-fg); border-color: transparent; }

/* ═══ TabStrip ═════════════════════════════════════════════════════════════
   Fluent's TabList: flat, a 2px brand underline with rounded ends under the
   selected tab, and a quiet count beside the label. */
.sc-tabs { gap: 4px; padding: 0 8px; border-bottom: 1px solid var(--stroke-2); }
.sc-tab { height: 40px; padding: 0 12px; border-radius: var(--r-md); color: var(--fg-2); font-weight: var(--fw-regular); }
.sc-tab:hover { background: var(--neutral-subtle-hover); }
.sc-tab.active { color: var(--fg-1); font-weight: var(--fw-semibold); }
.sc-tab.active::after { left: 12px; right: 12px; height: 3px; border-radius: 3px 3px 0 0; background: var(--brand-primary); }
.sc-tab .tab-cnt { background: var(--neutral-subtle-hover); color: var(--fg-2); border-radius: var(--r-pill); }
.sc-tab.active .tab-cnt { background: var(--brand-tint-60); color: var(--brand-fg); }

/* ═══ FormField · FormSection · ToggleField ════════════════════════════════
   Label above, 14px field, hint beneath in the quiet grey, error beneath in
   red. The switch is Fluent's: an outline when off, a brand fill and a white
   thumb when on. */
.sc-label { font-size: var(--fs-body); font-weight: var(--fw-semibold); color: var(--fg-1); margin-bottom: 4px; }
.sc-form-group { gap: 4px; }
.sc-form-grid { gap: 16px 20px; }
:is(.sc-input, .sc-select, .sc-textarea) { font-size: var(--fs-body); }
.sc-textarea { min-height: 80px; padding-block: 6px; }
.sc-field-hint { font-size: var(--fs-caption); color: var(--fg-3); margin-top: 4px; }
.sc-field-error { font-size: var(--fs-caption); color: var(--error-fg); margin-top: 4px; font-weight: var(--fw-semibold); }
:is(.sc-input, .sc-select, .sc-textarea).invalid, :is(.sc-input, .sc-select, .sc-textarea)[aria-invalid="true"] {
  border-color: var(--error-br); border-bottom-color: var(--error-fg);
}
.sc-check-input, input[type="checkbox"].sc-check-input { accent-color: var(--brand-primary); width: 16px; height: 16px; }
.sc-check-label { font-size: var(--fs-body); color: var(--fg-1); }

.sc-switch { gap: 12px; }
.sc-switch-track { border-color: var(--fg-3); }
.sc-switch-thumb { left: 4px; width: 12px; height: 12px; background: var(--fg-3); }
.sc-switch:hover .sc-switch-track { border-color: var(--fg-1); }
.sc-switch input:checked ~ .sc-switch-track { background: var(--brand-primary); border-color: var(--brand-primary); }
.sc-switch input:checked ~ .sc-switch-track .sc-switch-thumb { left: 24px; background: var(--brand-on); }
.sc-switch input:focus-visible ~ .sc-switch-track { outline: 2px solid var(--brand-primary); outline-offset: 2px; }
.sc-switch input:disabled ~ * { opacity: .5; }
.sc-switch-label { font-size: var(--fs-body); font-weight: var(--fw-semibold); color: var(--fg-1); }
.sc-switch-hint { font-size: var(--fs-body-sm); color: var(--fg-3); }

/* ═══ ModalDialog · ConfirmDialog · AlertBanner ════════════════════════════
   An 8px surface at Fluent's highest elevation over a plain scrim (Fluent does
   not blur behind a dialog). The footer is a quiet bar the actions sit in,
   primary on the right. Alerts are MessageBars: tinted, flat, one line of
   weight. */
.sc-overlay { background: rgba(0,0,0,.40); backdrop-filter: none; }
.sc-modal { border-radius: var(--r-lg); border-color: var(--stroke-2); }
.sc-modal-hdr { padding: 20px 24px 12px; border-bottom: 0; }
.sc-modal-title { font-size: var(--fs-subtitle); font-weight: var(--fw-semibold); letter-spacing: -.005em; }
.sc-modal-sub { font-size: var(--fs-body-sm); color: var(--fg-3); }
.sc-modal-body { padding: 8px 24px 20px; }
.sc-modal-ftr { padding: 14px 24px; gap: 8px; justify-content: flex-end; background: var(--neutral-layer-alt); border-top: 1px solid var(--stroke-2); }
.sc-modal-close { width: 32px; height: 32px; border-radius: var(--r-md); color: var(--fg-2); }
.sc-modal-close:hover { background: var(--neutral-subtle-hover); color: var(--fg-1); }

.sc-alert { border-radius: var(--r-md); padding: 10px 12px; font-size: var(--fs-body); align-items: center; }
.sc-alert-title { margin-bottom: 0; margin-right: 4px; display: inline; }
.sc-alert svg { margin-top: 0; }
.sc-alert-close { border-radius: var(--r-sm); }
.sc-alert-close:hover { background: color-mix(in srgb, currentColor 12%, transparent); }

/* ═══ EmptyState · LoadingSpinner · skeletons ══════════════════════════════
   Emptiness is an invitation: a brand-tinted icon tile, a plain title, a line
   that says what to do next. Loading placeholders shimmer once across rather
   than pulsing. */
.sc-empty { padding: 64px 24px; gap: 0; }
.sc-empty-icon { width: 56px; height: 56px; border-radius: var(--r-lg); background: var(--brand-tint-60); color: var(--brand-fg); margin-bottom: 16px; }
.sc-empty-title { font-size: var(--fs-body-lg); font-weight: var(--fw-semibold); }
.sc-empty-text { color: var(--fg-3); margin-bottom: 16px; }
.sc-loading-text { color: var(--fg-3); font-size: var(--fs-body-sm); }

@keyframes sc-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.sc-skeleton { border-radius: var(--r-md);
  background: linear-gradient(90deg, var(--neutral-subtle-hover) 25%, var(--neutral-subtle) 50%, var(--neutral-subtle-hover) 75%);
  background-size: 200% 100%; animation: sc-shimmer 1.6s linear infinite; }
.sc-progress { height: 4px; border-radius: 2px; }
.sc-progress-bar { border-radius: 2px; }

/* ═══ PageHeader · toolbar · search · top bar ══════════════════════════════
   The title is the page's first sentence. Actions sit level with it, and the
   toolbar over a list is one quiet row: search, filters, then the count. */
.sc-content { padding: 20px 24px 32px; }
.sc-page-header { margin-bottom: 16px; align-items: flex-end; gap: 16px; }
.sc-page-title { font-size: var(--fs-title); line-height: 1.2; }
.sc-page-subtitle { margin-top: 4px; font-size: var(--fs-body); color: var(--fg-3); max-width: 72ch; }
.sc-page-actions { gap: 8px; }

.sc-toolbar { padding: 8px 12px; gap: 8px; }
.sc-toolbar-count { color: var(--fg-3); }
.sc-toolbar-sep { margin: 4px 2px; }
.sc-chip { height: 28px; border-radius: var(--r-pill); }

.sc-topbar { height: 48px; padding: 0 12px; gap: 8px; border-bottom-color: var(--stroke-2); }
.sc-search-wrap input { height: 32px; width: 280px; border-radius: var(--r-md); background: var(--neutral-subtle); border-color: transparent; border-bottom-color: var(--stroke-1); }
.sc-search-wrap input:hover:not(:focus) { background: var(--neutral-subtle-hover); }
.sc-search-wrap input:focus { width: 360px; background: var(--neutral-layer); }
.sc-icon-btn { border-radius: var(--r-md); }
.sc-breadcrumb { font-size: var(--fs-body-sm); }
.sc-bc-current { font-weight: var(--fw-semibold); }
@media (max-width: 720px) { .sc-content { padding: 14px 12px 24px; } .sc-page-header { flex-wrap: wrap; align-items: flex-start; } }

/* ═══ SectionCard · DetailSection · DetailField ════════════════════════════
   A card is a titled region. The header carries the title and its actions on
   one line with a hairline under it; detail fields read label-over-value. */
.sc-card-header { padding: 12px 16px; min-height: 52px; }
.sc-card-title { font-size: var(--fs-body-lg); }
.sc-card-subtitle { color: var(--fg-3); }
.sc-card-body { padding: 16px; }
.sc-card-footer { padding: 10px 16px; background: var(--neutral-layer-alt); }
.sc-detail-section-title { font-size: var(--fs-body-lg); font-weight: var(--fw-semibold); color: var(--fg-1); text-transform: none; letter-spacing: 0; }
.sc-detail-label { font-size: var(--fs-caption); color: var(--fg-3); text-transform: none; letter-spacing: 0; font-weight: var(--fw-regular); }
.sc-detail-value { font-size: var(--fs-body); color: var(--fg-1); }
.sc-info-box { border-radius: var(--r-md); background: var(--info-bg); border: 1px solid var(--info-br); color: var(--info-fg); }

/* ═══ Sign-in ══════════════════════════════════════════════════════════════
   Microsoft's sign-in page: one centred 440px card on a soft tinted canvas,
   the mark above a plain title, the brand colour only on the primary action.
   The brand panel that used to take half the card is gone — the page's job is
   one form. */
.sc-login-shell { background: var(--neutral-canvas); }
.sc-login-shell::before { background: radial-gradient(900px 520px at 20% 0%, var(--brand-tint-60), transparent 65%),
                                      radial-gradient(700px 420px at 90% 100%, var(--accent-tint), transparent 65%); }
.sc-login-card { grid-template-columns: 1fr; max-width: 440px; border-radius: var(--r-lg); box-shadow: var(--shadow-28); }
.sc-login-brand { background: var(--neutral-layer); color: var(--fg-1); padding: 36px 44px 0; align-items: flex-start; text-align: left; }
.sc-login-brand-title { color: var(--fg-1); font-size: var(--fs-title); letter-spacing: -.01em; }
.sc-login-brand-sub, .sc-login-brand-copy { color: var(--fg-3); }
.sc-login-brand-rule { display: none; }
.sc-login-form, .sc-login-head { padding-inline: 44px; }
.sc-login-submit { width: 100%; min-height: 40px; }
.sc-login-link { color: var(--brand-fg); }
.sc-login-link:hover { text-decoration: underline; }
.sc-login-foot { color: var(--fg-3); font-size: var(--fs-caption); }

/* ═══ Branch picker · dropdowns · theme menu ═══════════════════════════════
   Flyouts are 8px surfaces at the 16 elevation; items are 32px with 4px
   corners and a tint on hover, like a Windows 11 context menu. */
.sc-branch-menu, .sc-dropdown-menu, .sc-theme-menu {
  border-radius: var(--r-lg); border: 1px solid var(--stroke-2); box-shadow: var(--shadow-16); padding: 4px;
}
.sc-dropdown-item, .sc-branch-opt, .sc-theme-item { border-radius: var(--r-md); min-height: 32px; }
.sc-dropdown-item:hover, .sc-branch-opt:hover, .sc-theme-item:hover { background: var(--neutral-subtle-hover); }
.sc-dropdown-sep { margin: 4px 0; background: var(--stroke-2); }
.sc-branch-btn { border-radius: var(--r-md); }

/* ═══ Dashboard · lists inside cards · responsive grids ════════════════════
   Tiles breathe a little more, activity rows read as a Fluent list (hover
   tint, round icon tile), and the multi-column layouts fold to one column on
   a tablet or phone instead of squeezing — they had no narrow layout at all. */
.sc-kpi-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 16px; }
.sc-grid-3-1, .sc-grid-2-1, .sc-grid-2, .sc-grid-3, .sc-grid-4 { gap: 16px; }

.sc-activity-item { padding: 10px 8px; margin-inline: -8px; border-radius: var(--r-md); border-bottom-color: transparent;
                    transition: background-color var(--dur-fast) var(--ease); }
.sc-activity-item:hover { background: var(--neutral-subtle); }
.sc-activity-dot { width: 32px; height: 32px; border-radius: var(--r-md); background: var(--brand-tint-60); color: var(--brand-fg); }
.sc-activity-time { color: var(--fg-3); font-size: var(--fs-caption); }
.sc-bar-row, .sc-stat-row { padding-block: 10px; border-bottom-color: var(--stroke-3); }
.sc-bar-label, .sc-stat-label { color: var(--fg-2); }

@media (max-width: 1100px) {
  .sc-grid-3-1, .sc-grid-2-1 { grid-template-columns: 1fr; }
  .sc-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sc-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .sc-grid-2, .sc-grid-3, .sc-grid-4 { grid-template-columns: 1fr; }
  .sc-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sc-kpi-value { font-size: 22px; }
}
