/*
 * Workspace app shell: page body, top bar, format toggle, export menu,
 * card navigation, review queue, and status dots.
 *
 * Split from ui-workspace.css on 2026-07-17. The five ui-workspace-*.css
 * files load in order (shell, editor, collab, reference, responsive) and
 * that order reproduces the original single-file cascade exactly - do not
 * move rules between files without checking equal-specificity overrides.
 * Colors and spacing come from ui-tokens.css; the --workspace-card-* warm
 * aliases defined below are the documented exception in
 * docs/product/v6/design-system.md.
 */

.sg-v6-workspace-body {
    min-height: 100vh;
    overflow: hidden;
    background: var(--bg-50);
    color: var(--ink-800);
    font-family: var(--font-sans);
    letter-spacing: 0;
}

.sg-workspace-shell {
    --workspace-card-action: var(--sg-red);
    --workspace-card-action-soft: var(--sg-red-light);
    --workspace-card-clean: var(--sg-green-600);
    --workspace-card-clean-soft: var(--sg-green-100);
    --workspace-card-clean-text: var(--sg-green-700);
    --workspace-card-manual: var(--sg-amber-600);
    --workspace-card-manual-soft: var(--sg-amber-100);
    --workspace-card-manual-text: var(--sg-amber-700);
    --workspace-card-blocked: var(--ink-400);
    --workspace-card-blocked-soft: var(--surface-3);
    --workspace-card-blocked-text: var(--ink-600);
    height: calc(100vh - 44px);
    overflow: hidden;
    background: var(--bg-50);
}

.sg-workspace-topbar {
    height: 48px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.sg-workspace-back,
.sg-workspace-topbar a {
    text-decoration: none;
}

.sg-workspace-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ink-600);
    font-size: 12.5px;
    font-weight: 600;
}

.sg-workspace-back:hover {
    color: var(--ink-900);
}

.sg-workspace-crumb {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
    color: var(--ink-500);
    font-size: 12.5px;
}

.sg-workspace-crumb strong {
    max-width: 34vw;
    overflow: hidden;
    color: var(--ink-900);
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sg-workspace-separator {
    color: var(--ink-400);
}

.sg-workspace-format {
    display: flex;
    height: 32px;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    border-left: 1px solid var(--line-soft);
    border-right: 1px solid var(--line-soft);
}

.sg-workspace-format-label,
.sg-workspace-eyebrow,
.sg-workspace-control-label,
.sg-workspace-comments-title,
.sg-workspace-dossier-title {
    color: var(--ink-500);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sg-workspace-format-toggle {
    display: flex;
    border: 1px solid var(--line);
    background: var(--bg-100);
    padding: 2px;
}

.sg-workspace-format-toggle a,
.sg-workspace-format-toggle span {
    display: inline-flex;
    min-height: 26px;
    align-items: center;
    padding: 0 12px;
    color: var(--ink-600);
    font-size: 12px;
    font-weight: 600;
}

.sg-workspace-format-toggle .is-active {
    background: var(--ink-900);
    color: var(--surface);
}

.sg-workspace-card-nav {
    display: inline-flex;
    height: 32px;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    border-right: 1px solid var(--line-soft);
}

.sg-workspace-card-nav-button {
    display: inline-flex;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink-700);
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
}

.sg-workspace-card-nav-button:hover {
    border-color: var(--cobalt);
    color: var(--cobalt-deep);
}

.sg-workspace-card-nav-button.is-disabled {
    background: var(--bg-100);
    color: var(--ink-300);
}

.sg-workspace-card-nav-count {
    min-width: 48px;
    color: var(--ink-500);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}

.sg-workspace-spacer {
    flex: 1 1 auto;
}

.sg-workspace-export {
    position: relative;
}

.sg-workspace-export summary,
.sg-workspace-primary-action {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink-700);
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 600;
    gap: 7px;
    padding: 0 14px;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.sg-workspace-export summary {
    list-style: none;
}

.sg-workspace-export summary::-webkit-details-marker {
    display: none;
}

.sg-workspace-export-label {
    line-height: 1;
}

.sg-workspace-export-chevron {
    width: 7px;
    height: 7px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
}

.sg-workspace-export summary:hover {
    border-color: var(--ink-400);
    background: var(--bg-100);
    color: var(--ink-900);
}

.sg-workspace-primary-action {
    border-color: var(--ink-900);
    background: var(--ink-900);
    color: var(--surface);
}

.sg-workspace-primary-action:hover {
    border-color: var(--cobalt);
    background: var(--cobalt);
    color: var(--surface);
}

.sg-workspace-primary-action:disabled {
    border-color: var(--line);
    background: var(--bg-150);
    color: var(--ink-500);
    cursor: progress;
}

.sg-workspace-link-status {
    max-width: 180px;
    overflow: hidden;
    color: var(--ink-500);
    font-size: 11.5px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sg-workspace-link-status a {
    color: var(--cobalt-deep);
    text-decoration: underline;
}

.sg-workspace-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 20;
    display: none;
    min-width: 240px;
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow-md);
    padding: 5px;
}

.sg-workspace-export[open] .sg-workspace-menu {
    display: block;
}

.sg-workspace-menu a {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 9px 11px;
    color: var(--ink-900);
}

.sg-workspace-menu a:hover {
    background: var(--bg-100);
}

.sg-workspace-menu span {
    color: var(--ink-500);
    font-size: 11px;
}

.sg-workspace-grid {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr) 300px;
    height: calc(100% - 48px);
    min-height: 0;
}

.sg-workspace-queue,
.sg-workspace-dossier {
    min-height: 0;
    overflow-y: auto;
    background: var(--bg-100);
}

.sg-workspace-queue {
    border-right: 1px solid var(--line);
}

.sg-workspace-dossier {
    border-left: 1px solid var(--line);
}

.sg-workspace-queue-summary {
    padding: 18px 18px 12px;
    border-bottom: 1px solid var(--line-soft);
}

.sg-workspace-queue-total {
    margin-top: 8px;
    color: var(--ink-900);
    font-size: 24px;
    font-weight: 800;
    line-height: 1.1;
}

.sg-workspace-queue-total span,
.sg-workspace-queue-sub {
    color: var(--ink-500);
    font-size: 12px;
    font-weight: 500;
}

.sg-workspace-queue-sub {
    margin-top: 5px;
}

.sg-workspace-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line-soft);
}

.sg-workspace-filters span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink-600);
    font-size: 10.5px;
    font-weight: 700;
    padding: 3px 8px;
}

.sg-workspace-filters .is-active {
    border-color: var(--ink-900);
    background: var(--ink-900);
    color: var(--surface);
}

.sg-workspace-queue-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 14px 6px;
}

.sg-workspace-queue-group-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--ink-500);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sg-workspace-queue-count {
    color: var(--ink-400);
    font: 11px var(--font-mono);
}

.sg-workspace-dot,
.sg-workspace-status-dot {
    flex: 0 0 auto;
    border-radius: 999px;
    background: var(--ink-400);
}

.sg-workspace-dot {
    width: 5px;
    height: 5px;
}

.sg-workspace-status-dot {
    width: 6px;
    height: 6px;
}

.sg-workspace-dot.is-verify,
.sg-workspace-status-dot.is-verify {
    background: var(--workspace-card-manual);
}

.sg-workspace-dot.is-manual,
.sg-workspace-status-dot.is-manual {
    background: var(--workspace-card-manual);
}

.sg-workspace-dot.is-blocked,
.sg-workspace-status-dot.is-blocked {
    background: var(--workspace-card-blocked);
}

.sg-workspace-dot.is-action,
.sg-workspace-status-dot.is-action {
    background: var(--workspace-card-action);
}

.sg-workspace-dot.is-client_completed,
.sg-workspace-status-dot.is-client_completed {
    background: var(--workspace-card-action);
}

.sg-workspace-dot.is-clean,
.sg-workspace-status-dot.is-clean,
.sg-workspace-status-dot.is-verified {
    background: var(--workspace-card-clean);
}

.sg-workspace-queue-item {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    border-left: 3px solid transparent;
    color: var(--ink-800);
    padding: 9px 14px 9px 11px;
}

.sg-workspace-queue-item:hover,
.sg-workspace-queue-item.is-active {
    background: var(--surface);
    color: var(--ink-900);
    text-decoration: none;
}

.sg-workspace-queue-item.is-active {
    border-left-color: var(--cobalt);
}

.sg-workspace-queue-item.is-status-action {
    border-left-color: var(--workspace-card-action);
}

.sg-workspace-queue-item.is-status-verify {
    border-left-color: var(--workspace-card-manual);
}

.sg-workspace-queue-item.is-status-manual {
    border-left-color: var(--workspace-card-manual);
}

.sg-workspace-queue-item.is-status-blocked {
    border-left-color: var(--workspace-card-blocked);
}

.sg-workspace-queue-item.is-status-client_completed {
    border-left-color: var(--workspace-card-action);
}

.sg-workspace-queue-item.is-status-verified {
    border-left-color: var(--workspace-card-clean);
}

.sg-workspace-queue-item.is-status-reference {
    border-left-color: var(--cobalt);
}

.sg-workspace-queue-item.is-workflow-action {
    border-left-color: var(--workspace-card-action);
}

.sg-workspace-queue-item.is-workflow-verify {
    border-left-color: var(--workspace-card-manual);
}

.sg-workspace-queue-item.is-workflow-manual {
    border-left-color: var(--workspace-card-manual);
}

.sg-workspace-queue-item.is-workflow-blocked {
    border-left-color: var(--workspace-card-blocked);
}

.sg-workspace-queue-item.is-workflow-clean {
    border-left-color: var(--workspace-card-clean);
}

.sg-workspace-queue-item.is-status-action .sg-workspace-queue-title {
    font-weight: 750;
}

.sg-workspace-queue-num {
    color: var(--ink-400);
    font: 11px var(--font-mono);
}

.sg-workspace-queue-title {
    min-width: 0;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.35;
}

.sg-workspace-queue-flags {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.sg-workspace-reply-flag {
    display: inline-flex;
    width: 14px;
    height: 14px;
    align-items: center;
    justify-content: center;
    background: var(--cobalt);
    color: var(--surface);
    font-size: 9px;
    font-weight: 800;
}

.sg-workspace-verified {
    margin-top: 8px;
    border-top: 1px solid var(--line-soft);
}

.sg-workspace-verified summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    color: var(--ink-500);
    cursor: pointer;
    font-size: 11.5px;
    font-weight: 600;
    list-style: none;
}

.sg-workspace-verified summary::-webkit-details-marker {
    display: none;
}

.sg-workspace-verified summary span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.sg-workspace-verified-toggle {
    color: var(--ink-500);
}

.sg-workspace-verified-collapse {
    display: none;
}

.sg-workspace-verified[open] .sg-workspace-verified-expand {
    display: none;
}

.sg-workspace-verified[open] .sg-workspace-verified-collapse {
    display: inline;
}

.sg-workspace-verified-empty {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    color: var(--ink-500);
    font-size: 11.5px;
    font-weight: 600;
}

.sg-workspace-verified-empty span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.sg-workspace-check {
    justify-content: center;
    width: 14px;
    height: 14px;
    border: 1px solid var(--workspace-card-clean);
    color: var(--workspace-card-clean);
    font-size: 9px;
}
