/* Wesend admin shell styles.
   Moved out of the layout <style> block per workspace standard section 3 (no inline CSS).
   Design tokens derive from the wb-* runtime (--wb-accent, --wb-surface, ...). */

        :root {
            --wesend-bg: var(--wb-bg);
            --wesend-panel: color-mix(in srgb, var(--wb-surface) 92%, transparent);
            --wesend-border: var(--wb-border);
            --wesend-text: var(--wb-text);
            --wesend-muted: var(--wb-muted);
            --wesend-accent: var(--wb-accent);
            --wesend-accent-strong: var(--wb-accent-hover);
            --wesend-accent-soft: var(--wb-accent-soft);
            --wesend-success-soft: var(--wb-success-soft);
            --wesend-warning-soft: var(--wb-warning-soft);
            --wesend-danger-soft: var(--wb-danger-soft);
        }

        body {
            margin: 0;
            color: var(--wesend-text);
            font-family: var(--wb-font);
            background:
                radial-gradient(circle at top left, color-mix(in srgb, var(--wb-accent-soft) 76%, transparent), transparent 24%),
                radial-gradient(circle at top right, color-mix(in srgb, var(--wb-accent-soft) 42%, transparent), transparent 18%),
                linear-gradient(180deg, color-mix(in srgb, var(--wesend-bg) 92%, var(--wb-surface) 8%) 0%, var(--wesend-bg) 52%, color-mix(in srgb, var(--wesend-bg) 94%, var(--wb-surface-2) 6%) 100%);
        }

        h1,
        h2,
        h3 {
            font-family: var(--wb-font-heading);
            letter-spacing: -0.01em;
        }

        .wb-dashboard-shell {
            background: transparent;
            min-height: 100vh;
        }

        .wb-sidebar {
            background: color-mix(in srgb, var(--wb-surface) 90%, var(--wb-accent-soft));
            border-right: 1px solid var(--wesend-border);
            color: var(--wesend-text);
        }

        .wb-sidebar-brand,
        .wb-sidebar-header {
            height: auto;
            min-height: var(--wb-navbar-h, 56px);
            padding-block: var(--wb-s4);
        }

        .wb-sidebar-brand {
            gap: var(--wb-s3);
        }

        .wb-sidebar-brand-logo {
            width: 2.5rem;
            height: 2.5rem;
            border-radius: 0.95rem;
            background: linear-gradient(135deg, var(--wesend-accent) 0%, var(--wesend-accent-strong) 100%);
            color: #fff;
            font-weight: 800;
            letter-spacing: -0.04em;
            box-shadow: 0 12px 28px rgba(53, 99, 255, 0.28);
        }

        .wb-sidebar-brand-copy strong,
        .wb-sidebar-brand-note,
        .wb-sidebar-label,
        .wb-sidebar-footer,
        .wb-sidebar-footer a,
        .wb-sidebar-footer p {
            color: inherit;
        }

        .wb-sidebar-brand-note,
        .wb-sidebar-label,
        .shell-sidebar-meta,
        .shell-user-role,
        .page-subtitle,
        .surface-copy,
        .surface-note,
        .field-hint,
        .inline-note,
        .subtle {
            color: var(--wesend-muted);
        }

        .wb-sidebar-label {
            color: var(--wesend-muted);
            font-size: 0.72rem;
            letter-spacing: 0.12em;
        }

        .wb-sidebar-link {
            gap: var(--wb-s2);
            border-radius: 1rem;
            color: var(--wesend-muted);
        }

        .wb-sidebar-link:hover {
            background: var(--wb-surface-2);
            color: var(--wesend-text);
        }

        .wb-sidebar-link.is-active {
            background: var(--wb-primary-soft);
            color: var(--wb-primary);
        }

        .wb-sidebar-link .wb-sidebar-icon {
            font-size: 1rem;
        }

        .shell-sidebar-link {
            display: grid;
            gap: 0.15rem;
        }

        .shell-sidebar-link strong {
            font-size: 0.92rem;
        }

        .shell-sidebar-link span {
            font-size: 0.76rem;
            color: inherit;
            opacity: 0.72;
        }

        .shell-sidebar-meta {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.35rem;
            text-align: center;
            width: 100%;
            font-size: 0.8rem;
            font-weight: 600;
            color: var(--wesend-muted);
        }

        .wb-sidebar-footer {
            display: flex;
            align-items: center;
            justify-content: center;
            border-top-color: var(--wesend-border);
        }

        .wb-dashboard-main {
            padding: var(--wb-s5);
        }

        .wb-navbar {
            border-bottom: 1px solid var(--wesend-border);
            background: color-mix(in srgb, var(--wb-surface) 88%, transparent);
            backdrop-filter: blur(14px);
        }

        .shell-main-container {
            max-width: none;
            padding: 0;
        }

        .app-main-shell {
            display: grid;
            gap: var(--wb-s5);
        }

        .page-surface,
        .content-card,
        .panel-card,
        .notice-card,
        .record-card,
        .metric-card,
        .flash-message {
            border: 1px solid var(--wesend-border);
            border-radius: 1.5rem;
            background: var(--wesend-panel);
            box-shadow: var(--wb-shadow-lg);
            backdrop-filter: blur(12px);
        }

        .page-surface,
        .content-card,
        .panel-card,
        .notice-card,
        .flash-message {
            padding: var(--wb-s5);
        }

        .page-surface,
        .surface-title,
        .metric-stack,
        .detail-list,
        .timeline,
        .note-list,
        .content-stack,
        .form-grid,
        .record-grid {
            display: grid;
            gap: var(--wb-s4);
        }

        .page-header {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: var(--wb-s4);
            flex-wrap: wrap;
        }

        .page-heading {
            display: grid;
            gap: var(--wb-s2);
            max-width: 68ch;
        }

        .page-title {
            margin: 0;
            font-size: clamp(2rem, 4vw, 2.9rem);
            line-height: 0.98;
        }

        .eyebrow {
            color: var(--wesend-accent-strong);
            font-size: 0.72rem;
            font-weight: 800;
            letter-spacing: 0.12em;
            text-transform: uppercase;
        }

        .wb-page-breadcrumb {
            margin: 0;
        }

        .page-actions,
        .table-actions,
        .status-group,
        .flash-stack,
        .header-meta,
        .surface-actions {
            display: flex;
            align-items: center;
            gap: var(--wb-s2);
            flex-wrap: wrap;
        }

        .page-actions.start {
            justify-content: flex-start;
        }

        .record-grid.columns-260 {
            grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        }

        .stack-top-10 > * + * {
            margin-top: 10px;
        }

        .stack-top-12 > * + * {
            margin-top: 12px;
        }

        .stats-grid,
        .summary-grid,
        .detail-grid,
        .record-grid {
            display: grid;
            gap: var(--wb-s4);
        }

        .stats-grid,
        .summary-grid {
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        }

        .detail-grid.two {
            grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
            align-items: start;
        }

        .metric-card,
        .record-card,
        .note-item {
            padding: var(--wb-s4);
        }

        .metric-card strong,
        .record-card strong,
        .note-item strong {
            display: block;
            margin-top: var(--wb-s2);
            font-size: 1.08rem;
        }

        .content-card {
            display: grid;
            gap: var(--wb-s4);
        }

        .content-card.compact {
            gap: var(--wb-s3);
        }

        .surface-title {
            max-width: 64ch;
        }

        .surface-title h2,
        .surface-title h3 {
            margin: 0;
        }

        .table-wrap,
        .wb-table-wrap {
            overflow-x: auto;
        }

        table,
        .wb-table {
            width: 100%;
        }

        .data-link,
        .message-link,
        .back-link {
            color: var(--wesend-accent-strong);
            text-decoration: none;
            font-weight: 700;
        }

        .back-link:hover,
        .data-link:hover,
        .message-link:hover {
            color: var(--wesend-accent);
        }

        .status-pill {
            display: inline-flex;
            align-items: center;
            gap: 0.45rem;
            min-height: 1.95rem;
            padding: 0 0.72rem;
            border-radius: 999px;
            font-size: 0.7rem;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            color: var(--wesend-text);
            background: color-mix(in srgb, var(--wb-surface-2) 86%, transparent);
        }

        .status-pill.accepted,
        .status-pill.pending {
            background: var(--wesend-accent-soft);
            color: var(--wesend-accent-strong);
        }

        .status-pill.queued,
        .status-pill.active,
        .status-pill.verified,
        .status-pill.healthy {
            background: var(--wesend-success-soft);
            color: #187056;
        }

        .status-pill.handed_off {
            background: rgba(14, 116, 216, 0.12);
            color: #0f6ccf;
        }

        .status-pill.failed,
        .status-pill.disabled,
        .status-pill.action_needed {
            background: var(--wesend-danger-soft);
            color: #b42318;
        }

        .status-pill.warning {
            background: var(--wesend-warning-soft);
            color: #b45309;
        }

        .detail-row {
            padding-bottom: var(--wb-s3);
            border-bottom: 1px solid var(--wesend-border);
        }

        .detail-row:last-child {
            padding-bottom: 0;
            border-bottom: 0;
        }

        .label {
            display: block;
            margin-bottom: 0.45rem;
            color: var(--wesend-muted);
            font-size: 0.73rem;
            font-weight: 800;
            letter-spacing: 0.08em;
            text-transform: uppercase;
        }

        .timeline-item {
            padding-left: var(--wb-s4);
            border-left: 2px solid var(--wesend-accent-soft);
        }

        pre {
            margin: var(--wb-s2) 0 0;
            padding: var(--wb-s3);
            overflow: auto;
            border-radius: 1rem;
            background: var(--wb-surface-2);
            border: 1px solid var(--wesend-border);
            font-size: 0.78rem;
        }

        .empty {
            padding: var(--wb-s6);
            border-radius: 1.25rem;
            text-align: center;
            color: var(--wesend-muted);
            border: 1px dashed color-mix(in srgb, var(--wesend-border) 88%, var(--wb-accent-soft));
            background: color-mix(in srgb, var(--wb-surface) 82%, transparent);
        }

        .flash-message.success {
            background: rgba(35, 155, 126, 0.12);
            border-color: rgba(35, 155, 126, 0.2);
        }

        .flash-message.error {
            background: rgba(220, 38, 38, 0.12);
            border-color: rgba(220, 38, 38, 0.18);
        }

        .field-group {
            display: grid;
            gap: var(--wb-s2);
        }

        .filter-grid {
            display: grid;
            gap: var(--wb-s3);
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            align-items: end;
        }

        .filter-grid .wb-field {
            gap: var(--wb-s2);
        }

        .filter-grid .wb-label {
            font-size: 0.73rem;
            font-weight: 800;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            color: var(--wesend-muted);
        }

        .filter-grid .wb-input,
        .filter-grid .wb-select,
        .form-grid .wb-input,
        .form-grid .wb-select {
            min-height: 46px;
        }

        .table-cell-stack {
            display: grid;
            gap: 0.35rem;
        }

        .empty .wb-btn,
        .surface-actions .wb-btn,
        .page-actions .wb-btn {
            text-decoration: none;
        }

        .field-error {
            color: #b42318;
            font-size: 0.82rem;
            font-weight: 700;
        }

        .inline-stack {
            display: grid;
            gap: 0.35rem;
        }

        @media (max-width: 1024px) {
            .detail-grid.two {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 768px) {
            .wb-dashboard-main {
                padding: var(--wb-s4);
            }

            .page-surface,
            .content-card,
            .panel-card,
            .notice-card,
            .flash-message {
                padding: var(--wb-s4);
            }
        }
