/* Admin surface theme — TokenWave visual standard v1.0.
 * Loaded after the legacy stylesheet so the existing view templates keep
 * their data and interaction semantics while using the new visual language.
 */
:root {
  --ink: var(--tw-ink);
  --muted: var(--tw-muted);
  --line: var(--tw-line);
  --teal: var(--tw-accent);
  --teal-soft: var(--tw-accent-soft);
  --sidebar: 232px;
}

html { background: var(--tw-bg); }
body {
  background: var(--tw-bg);
  color: var(--tw-text);
  font: 16px/var(--tw-leading-body) var(--tw-font-body);
}

/* The PNG contains the complete, transparent company wordmark. */
.brand { gap: 12px; align-items: center; }
.brand-logo { display: block; width: 176px; height: auto; max-width: 100%; object-fit: contain; }
.brand-mark { display: none !important; }
.brand-name { display: none; }
.brand-sub {
  margin: 0;
  color: var(--tw-muted);
  font: 12px/1.5 var(--tw-font-mono);
  letter-spacing: .08em;
  white-space: nowrap;
}

.initial-loading {
  min-height: 160px;
  padding: 32px;
  align-items: flex-start;
  justify-content: flex-start;
  background: var(--tw-bg);
  color: var(--tw-muted);
}
.loading-logo { display: block; width: 176px; height: auto; }
.sidebar {
  width: var(--sidebar);
  padding: 24px 20px;
  background: var(--tw-bg);
  border-right: 1px solid var(--tw-line);
}
.sidebar .brand { padding: 0 4px; display: block; }
.sidebar .brand-logo { width: 168px; }
.sidebar .brand-sub { display: block; margin: 10px 0 0 4px; }
.workspace-pill {
  margin: 40px 4px 32px;
  padding: 16px 0;
  border: 0;
  border-top: 1px solid var(--tw-line);
  border-bottom: 1px solid var(--tw-line);
  border-radius: 0;
  background: transparent;
  color: var(--tw-ink);
}
.workspace-pill .workspace-icon { background: var(--tw-surface-muted); border-radius: var(--tw-radius); color: var(--tw-ink); }
.workspace-pill span { color: var(--tw-muted); font: 12px/1.5 var(--tw-font-body); letter-spacing: normal; }
.nav-label { padding-inline: 4px; color: var(--tw-muted); font: 12px/1.5 var(--tw-font-body); letter-spacing: normal; }
.nav { gap: 2px; }
.nav-link {
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 0 4px 4px 0;
  border-left: 2px solid transparent;
  color: var(--tw-text);
  font-size: 14px;
}
.nav-link:hover { background: var(--tw-surface-muted); color: var(--tw-ink); }
.nav-link.active { background: var(--tw-accent-soft); color: var(--tw-ink); border-left-color: var(--tw-accent); }
.nav-link.active:after { display: none; }
.nav-divider { margin: 24px 4px; background: var(--tw-line); }
.sidebar-help {
  margin: 24px 4px;
  padding: 16px 0;
  border-top: 1px solid var(--tw-line);
  border-radius: 0;
  background: transparent;
  color: var(--tw-muted);
  font-size: 14px;
}
.sidebar-help strong { color: var(--tw-ink); font-size: 14px; font-weight: 550; }
.account { padding-top: 16px; border-color: var(--tw-line); }
.avatar { background: var(--tw-surface-muted); color: var(--tw-ink); border-radius: 4px; }
.account-name { font-size: 14px; }
.account-role { color: var(--tw-muted); font-size: 12px; }

.topbar {
  height: 72px;
  padding-inline: 32px;
  background: var(--tw-bg);
  border-color: var(--tw-line);
}
.breadcrumbs { color: var(--tw-muted); font-size: 14px; }
.breadcrumbs strong { color: var(--tw-ink); font-weight: 500; }
.topbar-right { color: var(--tw-muted); font-size: 12px; }
.status-dot { width: 7px; height: 7px; background: var(--tw-ink); }
.content { max-width: var(--tw-content); padding: 48px 32px 64px; }
.page-heading { margin-bottom: 32px; }
.eyebrow { color: var(--tw-muted); font: 12px/1.5 var(--tw-font-mono); letter-spacing: .08em; }
.page-heading h1 { color: var(--tw-ink); font: 500 clamp(28px, 2.5vw, 32px)/1.35 var(--tw-font-body); letter-spacing: normal; }
.page-heading p { color: var(--tw-text); font-size: 16px; line-height: 1.75; }
.actions { gap: 12px; }
.btn {
  min-height: var(--tw-control-height);
  padding: 10px 16px;
  border: 1px solid var(--tw-line-strong);
  border-radius: var(--tw-radius);
  background: var(--tw-surface);
  color: var(--tw-ink);
  font-size: 14px;
  line-height: 1.5;
  box-shadow: none;
  transition: background-color var(--tw-duration-fast) var(--tw-ease), border-color var(--tw-duration-fast) var(--tw-ease);
}
.btn:hover { background: var(--tw-surface-muted); box-shadow: none; }
.btn.primary { background: var(--tw-ink); border-color: var(--tw-ink); color: var(--tw-inverse); box-shadow: none; }
.btn.primary:hover { background: var(--tw-text); border-color: var(--tw-text); }
.btn.danger { color: var(--tw-danger); border-color: var(--tw-danger); background: var(--tw-danger-bg); }
.btn.compact { min-height: 40px; padding: 8px 12px; font-size: 13px; }
.icon-btn { min-width: 44px; min-height: 44px; padding: 8px; color: var(--tw-muted); border-radius: var(--tw-radius); }
.icon-btn:hover { background: var(--tw-surface-muted); color: var(--tw-ink); }

.overview-banner {
  padding: 24px 0;
  border-top: 2px solid var(--tw-ink);
  border-bottom: 1px solid var(--tw-line);
  border-radius: 0;
  background: transparent;
  color: var(--tw-ink);
}
.overview-banner:after { display: none; }
.overview-banner .eyebrow { color: var(--tw-muted); }
.overview-banner h2 { font: 500 24px/1.4 var(--tw-font-body); letter-spacing: normal; }
.overview-banner p { max-width: 680px; color: var(--tw-text); font-size: 16px; line-height: 1.75; }
.banner-tag { border: 1px solid var(--tw-line-strong); border-radius: var(--tw-radius); background: var(--tw-surface); color: var(--tw-text); font-size: 14px; }
.banner-tag .status-dot { background: var(--tw-accent); }
.stats-grid { gap: 0; margin-bottom: 32px; border-top: 1px solid var(--tw-line); border-bottom: 1px solid var(--tw-line); }
.stat-card { min-height: 142px; padding: 20px 24px; border: 0; border-right: 1px solid var(--tw-line); border-radius: 0; background: transparent; }
.stat-card:last-child { border-right: 0; }
.stat-top { color: var(--tw-muted); font-size: 14px; }
.stat-icon { width: 32px; height: 32px; border-radius: 4px; background: var(--tw-surface-muted); color: var(--tw-ink); }
.stat-value { margin: 12px 0 8px; color: var(--tw-ink); font: 500 30px/1.25 var(--tw-font-mono); letter-spacing: 0; }
.stat-foot { color: var(--tw-muted); font-size: 12px; line-height: 1.6; }
.stat-foot .accent { color: var(--tw-accent); }
.grid-main { gap: 24px; }
.panel { border: 1px solid var(--tw-line); border-radius: var(--tw-radius); background: var(--tw-surface); box-shadow: none; }
.panel-head { padding: 20px 24px; border-bottom: 1px solid var(--tw-line); }
.panel-head h2 { color: var(--tw-ink); font-size: 18px; font-weight: 600; }
.panel-head p { color: var(--tw-muted); font-size: 14px; line-height: 1.6; }
.panel-body { padding: 0 24px 24px; }
.segmented { border-radius: var(--tw-radius); background: var(--tw-surface-muted); border-color: var(--tw-line); }
.segmented button { min-height: 36px; color: var(--tw-muted); font-size: 13px; }
.segmented button.active { color: var(--tw-ink); box-shadow: none; }
.chart-legend { color: var(--tw-muted); font-size: 12px; }
.legend-dot { background: var(--tw-accent); }
.legend-dot.light { background: var(--tw-line-strong); }
.distribution-summary strong { color: var(--tw-ink); }
.rank-line { font-size: 14px; }
.rank-line span, .distribution-summary span { color: var(--tw-muted); }
.progress-track { height: 4px; border-radius: 0; background: var(--tw-surface-muted); }
.progress-fill { border-radius: 0; background: var(--tw-accent); }
.table-wrap { border-top: 1px solid var(--tw-line); }
table { font-size: 14px; }
th { background: var(--tw-surface-muted); color: var(--tw-muted); font-size: 12px; border-color: var(--tw-line); }
td { color: var(--tw-text); font-size: 14px; border-color: var(--tw-line); }
tbody tr:hover { background: var(--tw-bg); }
.table-title { color: var(--tw-ink); font-size: 14px; }
.table-subtitle { color: var(--tw-muted); font-size: 12px; }
.product-symbol { border-color: var(--tw-line); border-radius: var(--tw-radius); background: var(--tw-surface-muted); color: var(--tw-ink); }
.product-symbol.blue, .product-symbol.sand, .product-symbol.purple { border-color: var(--tw-line); background: var(--tw-surface-muted); color: var(--tw-muted); }
.badge { border: 1px solid var(--tw-line); border-radius: var(--tw-radius); background: var(--tw-surface-muted); color: var(--tw-ink); font-size: 12px; }
.badge.gray { background: var(--tw-surface-muted); color: var(--tw-muted); }
.badge.amber { background: var(--tw-warning-bg); color: var(--tw-warning); border-color: var(--tw-warning); }
.badge.red { background: var(--tw-danger-bg); color: var(--tw-danger); border-color: var(--tw-danger); }
.event-list { padding-inline: 24px; }
.event-item { border-color: var(--tw-line); }
.event-icon { border-color: var(--tw-line); background: var(--tw-surface-muted); color: var(--tw-ink); }
.event-description { color: var(--tw-text); font-size: 14px; line-height: 1.7; }
.event-description strong { color: var(--tw-ink); }
.event-time { color: var(--tw-muted); font-size: 12px; }
.panel-foot { border-color: var(--tw-line); color: var(--tw-muted); font-size: 12px; }
.text-link { color: var(--tw-ink); font-size: 14px; }
.text-link:hover { color: var(--tw-accent); }
.metric-note { color: var(--tw-muted); font-size: 14px; }
.page-footer { color: var(--tw-muted); font-size: 12px; }
.filters .field label, .field-table th, .field-table td, .detail-label { font-size: 12px; }
.chart-empty { background: var(--tw-surface-muted); border: 1px dashed var(--tw-line); }

.search-input input, .toolbar input, .filters input, .filters select {
  min-height: var(--tw-control-height);
  border: 1px solid var(--tw-line-strong);
  border-radius: var(--tw-radius);
  background: var(--tw-surface);
  color: var(--tw-ink);
  font-size: 16px;
}
.toolbar, .filters { border-color: var(--tw-line); }
.toolbar-summary { color: var(--tw-muted); font-size: 14px; }
.empty-state { color: var(--tw-muted); }
.empty-state .empty-icon { border-radius: var(--tw-radius); background: var(--tw-surface-muted); color: var(--tw-ink); }
.empty-state h3 { color: var(--tw-ink); font-size: 18px; }
.empty-state p { color: var(--tw-muted); font-size: 14px; line-height: 1.8; }
.skeleton { background: var(--tw-surface-muted); border-radius: var(--tw-radius); animation: none; }
.skeleton-card { border-color: var(--tw-line); border-radius: var(--tw-radius); }
.error-panel { color: var(--tw-danger); font-size: 16px; }

.modal-backdrop { background: rgb(29 29 23 / 35%); backdrop-filter: none; }
.modal { border: 1px solid var(--tw-line-strong); border-radius: var(--tw-radius-dialog); box-shadow: var(--tw-shadow-overlay); }
.modal-head, .modal-foot { border-color: var(--tw-line); }
.modal-head h2 { color: var(--tw-ink); font-size: 22px; letter-spacing: normal; }
.modal-head p { color: var(--tw-muted); font-size: 14px; }
.modal-body { color: var(--tw-text); font-size: 14px; }
.field label { color: var(--tw-ink); font-size: 14px; }
.field label .optional { color: var(--tw-muted); font-size: 12px; }
.field input:not([type=checkbox]), .field select, .field textarea { min-height: var(--tw-control-height); border-color: var(--tw-line-strong); border-radius: var(--tw-radius); color: var(--tw-ink); font-size: 16px; }
.field .hint { color: var(--tw-muted); font-size: 14px; }
.form-error { border-color: var(--tw-danger); border-radius: var(--tw-radius); background: var(--tw-danger-bg); color: var(--tw-danger); font-size: 14px; }
.section-label { color: var(--tw-ink); font-size: 14px; }
.check-list, .field-table { border-color: var(--tw-line); border-radius: var(--tw-radius); }
.check-item { border-color: var(--tw-line); font-size: 14px; }
.check-item strong { color: var(--tw-ink); font-size: 14px; }
.check-item p { color: var(--tw-muted); font-size: 12px; }
.check-item input, .checkbox-line input, .field-table input { accent-color: var(--tw-accent); }
.checkbox-line { color: var(--tw-text); font-size: 14px; }
.info-box { border-color: var(--tw-line); border-radius: var(--tw-radius); background: var(--tw-surface-muted); color: var(--tw-text); font-size: 14px; }
.info-box.amber { border-color: var(--tw-warning); background: var(--tw-warning-bg); color: var(--tw-warning); }
.token-secret { border-color: var(--tw-line); border-radius: var(--tw-radius); background: var(--tw-surface-muted); }
.token-secret input { color: var(--tw-ink); font-size: 14px; }
.token-secret .secret-label { color: var(--tw-muted); font-size: 12px; }
.confirm-copy { color: var(--tw-muted); font-size: 14px; }
.toasts { right: 24px; bottom: 24px; border-color: var(--tw-ink); border-radius: var(--tw-radius); background: var(--tw-ink); box-shadow: var(--tw-shadow-overlay); font-size: 14px; animation: none; }
.toasts.error { border-color: var(--tw-danger); background: var(--tw-danger); }

/* Auth and customer portal use the same light editorial surface. */
.auth-page { background: var(--tw-bg); }
.auth-visual { padding: 48px 64px; background: var(--tw-bg); color: var(--tw-ink); border-right: 1px solid var(--tw-line); }
.auth-visual .brand { display: block; }
.auth-visual .brand-logo { width: 205px; }
.auth-visual .brand-sub { display: block; margin: 12px 0 0 4px; color: var(--tw-muted); }
.auth-intro { max-width: 520px; padding: 48px 0; }
.auth-intro .eyebrow { color: var(--tw-muted); font-size: 12px; letter-spacing: .08em; }
.auth-intro h1 { color: var(--tw-ink); font: 400 clamp(42px, 4vw, 64px)/1.25 var(--tw-font-display); letter-spacing: normal; }
.auth-intro > p { max-width: 420px; color: var(--tw-text); font-size: 18px; line-height: 1.8; }
.auth-orbit { display: none; }
.auth-visual-footer { color: var(--tw-muted); font: 12px/1.5 var(--tw-font-mono); letter-spacing: .06em; }
.auth-content { padding: 64px; background: var(--tw-surface); }
.auth-top-link { top: 32px; right: 40px; color: var(--tw-text); font-size: 14px; text-decoration: underline; text-underline-offset: 4px; }
.auth-card { width: 420px; }
.auth-card .eyebrow { color: var(--tw-muted); }
.auth-card h2 { color: var(--tw-ink); font: 400 32px/1.35 var(--tw-font-display); letter-spacing: normal; }
.auth-card > p { color: var(--tw-text); font-size: 16px; line-height: 1.75; }
.auth-footnote { color: var(--tw-muted); font-size: 14px; }
.auth-copyright { color: var(--tw-muted); font-size: 12px; }
.client-page { background: var(--tw-bg); }
.client-header { height: 80px; max-width: var(--tw-content); padding-inline: 32px; border-bottom: 1px solid var(--tw-line); }
.client-header .brand-logo { width: 166px; }
.client-header .brand-sub { color: var(--tw-muted); }
.client-header-right { color: var(--tw-muted); font-size: 14px; }
.client-hero { padding: 32px 0; min-height: 0; border-top: 2px solid var(--tw-ink); border-bottom: 1px solid var(--tw-line); border-radius: 0; background: transparent; color: var(--tw-ink); }
.client-hero:after { display: none; }
.client-hero .eyebrow { color: var(--tw-muted); }
.client-hero h1 { color: var(--tw-ink); font: 400 clamp(36px, 4vw, 56px)/1.25 var(--tw-font-display); }
.client-hero p { max-width: 640px; color: var(--tw-text); font-size: 18px; line-height: 1.75; }
.client-hero-foot { color: var(--tw-muted); font-size: 14px; }
.client-section-heading h2 { color: var(--tw-ink); font: 400 32px/1.35 var(--tw-font-display); }
.client-section-heading p { color: var(--tw-text); font-size: 16px; }
.client-grid { gap: 16px; }
.client-product { min-height: 310px; padding: 24px; border-radius: var(--tw-radius); border-color: var(--tw-line); background: var(--tw-surface); }
.client-category { color: var(--tw-muted); background: var(--tw-surface-muted); font-size: 12px; }
.client-product h3 { color: var(--tw-ink); font-size: 20px; }
.client-product .description { color: var(--tw-text); font-size: 16px; line-height: 1.75; }
.client-product .product-open { background: var(--tw-ink); border-color: var(--tw-ink); color: var(--tw-inverse); }
.client-product .product-open:hover { background: var(--tw-text); }
.sample-list a { color: var(--tw-ink); font-size: 14px; }
.client-footer { color: var(--tw-muted); border-color: var(--tw-line); font-size: 12px; }
.client-empty { border-radius: var(--tw-radius); border-color: var(--tw-line); background: var(--tw-surface); }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: var(--tw-focus-width) solid var(--tw-accent); outline-offset: var(--tw-focus-offset); }

@media (max-width: 950px) {
  .auth-visual { padding: 36px 40px; }
  .auth-intro h1 { font-size: 44px; }
  .auth-content { padding: 56px 40px; }
}
@media (max-width: 700px) {
  .sidebar { width: min(280px, calc(100vw - 24px)); padding: 24px 20px; background: var(--tw-bg); }
  .sidebar.open { box-shadow: 0 0 0 100vmax rgb(29 29 23 / 22%); }
  .topbar { height: 64px; padding-inline: 16px; }
  .content { padding: 32px 20px 48px; }
  .page-heading h1 { font-size: 34px; }
  .page-heading p { font-size: 16px; }
  .stat-top, .panel-head p, .segmented button, .chart-legend { font-size: 12px; }
  .stat-foot, .page-footer, .client-footer { font-size: 12px; }
  .auth-card > p, .client-hero p, .auth-intro > p { font-size: 16px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-card { border-bottom: 1px solid var(--tw-line); }
  .stat-card:nth-child(2n) { border-right: 0; }
  .overview-banner p { font-size: 16px; }
  .detail-grid { grid-template-columns: 1fr; }
  .auth-page { display: block; }
  .auth-visual { min-height: 390px; padding: 32px 24px; border-right: 0; border-bottom: 1px solid var(--tw-line); }
  .auth-intro { padding: 44px 0 32px; }
  .auth-intro h1 { font-size: 42px; }
  .auth-intro > p { font-size: 16px; }
  .auth-content { min-height: 520px; padding: 64px 24px 48px; }
  .auth-top-link { top: 20px; right: 24px; }
  .client-header { height: auto; padding: 20px; }
  .client-main { padding: 24px 20px 48px; }
  .client-header .brand-sub { display: none; }
  .client-section-heading { display: block; }
  .client-section-heading .search-input { width: 100%; margin-top: 16px; }
  .client-grid { grid-template-columns: 1fr; }
  .client-hero p { font-size: 16px; }
  .client-footer { display: block; }
  .client-footer > span { display: block; margin-top: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
