/* Product-specific layout; controls and surfaces are Senren ViewComponents. */
html { color-scheme: light; }
body { font-family: ui-sans-serif, system-ui, sans-serif; }
.page-preview { position: relative; max-width: 900px; }
.page-preview img { display: block; width: 100%; }
.source-highlight { position: absolute; border: 2px solid hsl(var(--senren-warning)); background: hsl(var(--senren-warning) / .25); pointer-events: none; }
.source-block:target { background: hsl(var(--senren-accent)); }
[hidden] { display: none !important; }

[aria-current="location"] { outline: 2px solid hsl(var(--senren-primary)); outline-offset: 2px; }

/* Motion is progressive feedback; no fabricated processing percentages. */
.turbo-progress-bar { height: 3px; background: hsl(var(--senren-primary)); }
[data-senren-component="button"], [data-senren-component="link"] {
  transition: background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, opacity 160ms ease;
}
@media (hover: hover) {
  [data-senren-component="button"]:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 3px 8px hsl(var(--senren-foreground) / .08); }
  [data-senren-component="link"]:hover { text-underline-offset: 4px; }
  [data-senren-component="card"] { transition: border-color 180ms ease, box-shadow 180ms ease; }
  [data-senren-component="card"]:hover { border-color: hsl(var(--senren-primary) / .3); box-shadow: 0 4px 16px hsl(var(--senren-foreground) / .04); }
}
[data-senren-component="button"]:not(:disabled):active { transform: translateY(0) scale(.98); }
[data-senren-component="input"], [data-senren-component="native-select"], [data-senren-component="textarea"] { transition: border-color 160ms ease, box-shadow 160ms ease; }
.loading-spinner, .is-loading::before {
  display: inline-block; width: 1rem; height: 1rem; flex: 0 0 auto;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: folio-spin 800ms linear infinite;
}
.is-loading::before { content: ""; }
.loading-status { color: hsl(var(--senren-primary)); }
.loading-dots { display: inline-flex; gap: 4px; }
.loading-dots i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; animation: folio-pulse 1.2s ease-in-out infinite; }
.loading-dots i:nth-child(2) { animation-delay: 150ms; }
.loading-dots i:nth-child(3) { animation-delay: 300ms; }
main { animation: folio-enter 180ms ease-out; }
@keyframes folio-spin { to { transform: rotate(360deg); } }
@keyframes folio-pulse { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
@keyframes folio-enter { from { opacity: .65; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Customer workspace shell: Senren surfaces and semantic theme variables. */
.workspace-shell { min-height: 100vh; }
.workspace-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: 248px; display: flex; flex-direction: column; gap: 26px; padding: 28px 20px 18px; overflow-y: auto; background: hsl(var(--senren-card)); border-right: 1px solid hsl(var(--senren-border)); }
.workspace-brand { font-size: 29px; font-weight: 750; letter-spacing: -1.5px; text-decoration: none !important; }
.workspace-sidebar-heading { display: grid; gap: 6px; padding: 0 8px; }
.workspace-label { display: block; font-size: 10px; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: hsl(var(--senren-muted-foreground)); }
.workspace-navigation { display: grid; gap: 6px; }
.workspace-navigation > p { padding: 0 12px 7px; }
.workspace-nav-link { width: 100%; justify-content: flex-start; gap: 12px; height: 43px; }
.workspace-nav-icon { font-size: 19px; width: 20px; text-align: center; }
.workspace-sidebar-bottom { display: grid; gap: 18px; margin-top: auto; padding-top: 30px; }
.workspace-credit-card { border-radius: 12px; box-shadow: none !important; }
.workspace-credit-card > div { padding: 16px; }
.workspace-credit-value { margin: 7px 0 4px; font-size: 20px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; letter-spacing: -.8px; white-space: nowrap; }
.workspace-account { display: flex; align-items: center; gap: 10px; padding: 15px 2px 0; border-top: 1px solid hsl(var(--senren-border)); }
.workspace-avatar { display: grid; place-items: center; width: 33px; height: 33px; flex-shrink: 0; border-radius: 50%; background: hsl(var(--senren-secondary)); color: hsl(var(--senren-secondary-foreground)); font-weight: 650; font-size: 13px; }
.workspace-content { margin-left: 248px; min-width: 0; }
.workspace-topbar { height: 70px; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 0 36px; border-bottom: 1px solid hsl(var(--senren-border)); background: hsl(var(--senren-card)); }
.workspace-topbar-note { font-size: 11px; color: hsl(var(--senren-muted-foreground)); }
.workspace-main { max-width: 1600px; margin: 0 auto; padding: 34px 36px 48px; min-height: calc(100vh - 130px); }
.workspace-main > * + * { margin-top: 28px; }
.workspace-main > turbo-frame { display: block; }
.workspace-page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.workspace-page-heading h1 { font-size: 29px; line-height: 1.25; letter-spacing: -1px; }
.workspace-eyebrow { color: hsl(var(--senren-muted-foreground)); font-size: 11px; font-weight: 550; margin-bottom: 8px; }
.workspace-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.workspace-stat { box-shadow: none !important; border-radius: 12px; }
.workspace-stat > div { padding: 20px; }
.workspace-stat-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: hsl(var(--senren-muted-foreground)); }
.workspace-stat-value { font-size: 32px; line-height: 1.2; font-weight: 650; letter-spacing: -1.25px; margin: 10px 0 8px; font-variant-numeric: tabular-nums; }
.workspace-stat-dot { height: 7px; width: 7px; border-radius: 50%; background: hsl(var(--senren-border)); }
.workspace-stat-dot.is-processing { background: hsl(var(--senren-primary)); box-shadow: 0 0 0 4px hsl(var(--senren-primary) / .08); }
.workspace-stat-dot.is-completed { background: hsl(var(--senren-success)); }
.workspace-stat-dot.is-attention { background: hsl(var(--senren-warning)); }
.workspace-batch-section { padding: 22px 0 0; border: 1px solid hsl(var(--senren-border)); border-radius: 14px; background: hsl(var(--senren-card)); overflow: hidden; }
.workspace-list-heading { display: flex; align-items: center; gap: 10px; padding: 0 22px 20px; }
.workspace-list-heading h2 { font-size: 16px; letter-spacing: -.3px; }
.workspace-filters { display: grid; grid-template-columns: minmax(180px, 2fr) minmax(120px, 1fr) minmax(110px, .9fr) minmax(120px, .9fr) auto; align-items: end; gap: 12px; padding: 0 22px 22px; }
.workspace-filters label { font-size: 11px; }
.workspace-filters input, .workspace-filters select { font-size: 12px; }
.workspace-filter-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 22px 16px; color: hsl(var(--senren-muted-foreground)); font-size: 12px; }
.workspace-table [data-senren-component="table"] { border-width: 1px 0 0; border-radius: 0; }
.workspace-table table { table-layout: fixed; }
.workspace-table th:first-child { width: 45%; }
.workspace-table th:nth-child(2) { width: 15%; }
.workspace-table th:nth-child(3) { width: 15%; }
.workspace-table th:nth-child(4) { width: 8%; }
.workspace-table th:last-child { width: 17%; }
.workspace-table td { padding-top: 18px; padding-bottom: 18px; }
.workspace-table th { font-size: 11px; }
.workspace-batch-name { display: flex; align-items: flex-start; gap: 12px; }
.workspace-file-icon { display: grid; place-items: center; flex-shrink: 0; width: 34px; height: 38px; border: 1px solid hsl(var(--senren-border)); border-radius: 8px; color: hsl(var(--senren-primary)); background: hsl(var(--senren-muted) / .5); font-size: 19px; }
.workspace-batch-link { display: block; font-size: 13px; line-height: 1.5; font-weight: 600; text-decoration: none !important; color: hsl(var(--senren-foreground)) !important; overflow-wrap: anywhere; }
.workspace-batch-link:hover { color: hsl(var(--senren-primary)) !important; }
.workspace-file-progress { display: grid; gap: 7px; max-width: 120px; }
.workspace-file-progress [role="progressbar"] { height: 4px; }
.workspace-row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.workspace-row-actions [data-senren-component="button"] { font-size: 11px; padding: 0 9px; white-space: nowrap; }
.workspace-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid hsl(var(--senren-border)); padding: 16px 22px; color: hsl(var(--senren-muted-foreground)); font-size: 12px; }
.workspace-footer { font-size: 11px; text-align: center; color: hsl(var(--senren-muted-foreground)); padding: 18px 24px; }
.workspace-mobile-bar { display: none; }
@media (max-width: 1199px) {
  .workspace-main { padding: 28px 24px; }
  .workspace-topbar { padding: 0 24px; }
  .workspace-filters { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); }
  .workspace-stats { gap: 12px; }
  .workspace-stat > div { padding: 16px; }
}
@media (max-width: 899px) {
  .workspace-sidebar { display: none; position: static; width: auto; border-right: 0; border-bottom: 1px solid hsl(var(--senren-border)); padding: 20px; gap: 18px; }
  .workspace-sidebar.is-open { display: flex; }
  .workspace-sidebar-heading { display: none; }
  .workspace-sidebar-bottom { padding-top: 0; margin-top: 0; }
  .workspace-credit-card { max-width: 380px; }
  .workspace-content { margin-left: 0; }
  .workspace-mobile-bar { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; background: hsl(var(--senren-card)); border-bottom: 1px solid hsl(var(--senren-border)); }
  .workspace-topbar { height: 48px; }
}
@media (max-width: 599px) {
  .workspace-main { padding: 24px 16px; }
  .workspace-topbar { padding: 0 16px; }
  .workspace-topbar-note { display: none; }
  .workspace-page-heading { align-items: flex-start; }
  .workspace-page-heading h1 { font-size: 25px; }
  .workspace-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .workspace-stat-value { font-size: 28px; }
  .workspace-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 16px 18px; }
  .workspace-filters > :first-child { grid-column: 1 / -1; }
  .workspace-list-heading { padding: 0 16px 16px; }
  .workspace-table th:first-child { width: 61%; }
  .workspace-table th:nth-child(2) { width: 39%; }
  .workspace-table th:nth-child(n+3), .workspace-table td:nth-child(n+3) { display: none; }
  .workspace-table th, .workspace-table td { padding-left: 12px; padding-right: 12px; }
  .workspace-table .workspace-file-icon { display: none; }
  .workspace-pagination { flex-wrap: wrap; padding: 14px 16px; }
  .workspace-filter-summary { padding: 0 16px 16px; }
}
@media (max-width: 599px) {
  .workspace-table table, .workspace-table tbody { display: block; }
  .workspace-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .workspace-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; padding: 12px 4px; }
  .workspace-table tbody td { padding-top: 6px; padding-bottom: 6px; }
  .workspace-table tbody td:nth-child(3), .workspace-table tbody td:last-child { display: block; }
  .workspace-table tbody td:last-child { justify-self: end; }
  .workspace-table tbody td:nth-child(4) { display: none; }
}
