@import '../shared/document.css';

/* ============================================================
   WELDED JOINTS SUITE — STUDIO & DOCK LAYOUT (SFS-EN 1993-1-8)
   Standardized Studio Command Dock & Continuous A4 Printable Sheet Styles
   ============================================================ */

/* --- Workspace Wrapper (Centered Studio for Desktop) --- */
.workspace-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
    max-width: 1480px;
    margin: 0 auto;
    padding: 0 16px;
    min-height: 100vh;
    box-sizing: border-box;
}

@media (max-width: 1100px) {
    .workspace-wrapper {
        flex-direction: column;
        align-items: center;
    }
}

/* --- Left Sidebar Dock (Ergonomic Left Scrollbar) --- */
.app-sidebar-dock {
    width: 440px;
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: var(--sp-md);
    display: flex;
    flex-direction: column;
    gap: var(--sp-sm);
    flex-shrink: 0;
    position: sticky;
    top: 16px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    z-index: 10;
    box-sizing: border-box;
    margin-bottom: 16px;

    /* Move scrollbar to the left for clean visual boundary */
    direction: rtl;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.18) transparent;
}

.app-sidebar-dock > * {
    direction: ltr; /* Reset children to standard LTR text */
}

.app-sidebar-dock::-webkit-scrollbar {
    width: 5px;
}
.app-sidebar-dock::-webkit-scrollbar-track {
    background: transparent;
}
.app-sidebar-dock::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
}
.app-sidebar-dock:hover::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.30);
}

/* --- Dock Sections & Elements --- */
.dock-section {
    background: #fafaf8;
    border: 1px solid var(--color-border-light);
    border-radius: 6px;
    padding: var(--sp-sm) var(--sp-md);
}

.dock-tab-section {
    display: none;
    flex-direction: column;
    gap: var(--sp-sm);
}

.dock-tab-section.active {
    display: flex;
}

.dock-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--color-heading);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--sp-xs);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--color-border-light);
    padding-bottom: 4px;
}

.dock-section-title.collapsible {
    cursor: pointer;
    user-select: none;
}

.dock-section-title.collapsible:hover {
    color: var(--color-accent);
}

.collapse-icon {
    font-size: 0.85rem;
    transition: transform 0.2s ease;
}

.dock-section.collapsed .dock-section-body {
    display: none;
}

.dock-section.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

/* --- Bottom-Baseline Alignment for Input Grid Fields --- */
.dock-meta-field {
    margin-bottom: 6px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 3px;
    height: 100%;
}

.dock-meta-field:last-child {
    margin-bottom: 0;
}

.dock-meta-field label {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--color-heading);
    margin-bottom: 2px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    line-height: 1.25;
}

.dock-meta-field label .unit,
.dock-meta-field label small {
    font-family: var(--font-mono);
    color: var(--color-text-muted);
    font-size: 0.70rem;
    flex-shrink: 0;
    margin-left: 4px;
    font-weight: 500;
}

.dock-meta-field input,
.dock-meta-field select {
    width: 100%;
    margin-top: auto;
    padding: 5px 8px;
    font-size: 0.82rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background: #ffffff;
    color: var(--color-text);
    box-sizing: border-box;
    font-family: var(--font-sans);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.dock-meta-field input:focus,
.dock-meta-field select:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px var(--color-accent-light);
}

.dock-meta-field small.field-desc {
    display: block;
    font-size: 0.68rem;
    color: var(--color-text-muted);
    margin-top: 3px;
    line-height: 1.2;
}

.dock-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-items: stretch;
}

.dock-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
    align-items: stretch;
}

.dock-preset-select {
    width: 100%;
    padding: 6px 10px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-heading);
    background: #ffffff;
    border: 1.5px solid var(--color-accent);
    border-radius: 5px;
    cursor: pointer;
    box-sizing: border-box;
}

.preset-chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 4px;
}

.btn-chip {
    padding: 4px 8px;
    font-size: 0.72rem;
    font-weight: 600;
    border: 1px solid var(--color-border);
    background: #ffffff;
    border-radius: 4px;
    cursor: pointer;
    color: var(--color-text-secondary);
    transition: all 0.15s ease;
}

.btn-chip:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.btn-chip.active {
    background: var(--color-accent);
    color: #ffffff;
    border-color: var(--color-accent);
    box-shadow: 0 1px 3px rgba(0, 85, 163, 0.3);
}

.btn-dock-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    border: 1px solid var(--color-border);
    background: #ffffff;
    cursor: pointer;
    transition: all 0.15s;
    color: var(--color-heading);
}

.btn-dock-action:hover {
    border-color: var(--color-accent);
    background: #f0f7ff;
}

.btn-dock-action.primary {
    background: var(--color-accent);
    color: #ffffff;
    border-color: var(--color-accent);
}

.btn-dock-action.primary:hover {
    background: #004485;
}

/* --- Live HUD Scorecard in Left Dock --- */
.dock-hud-card {
    background: linear-gradient(145deg, #ffffff, #f4f6f9);
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 2px 4px rgba(0, 0, 0, 0.04);
}

.dock-hud-card .hud-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 5px;
}

.dock-hud-card .hud-title {
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #1e293b;
}

.hud-status-badge {
    font-size: 0.70rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.hud-status-badge.pass {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.hud-status-badge.fail {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.hud-meter-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hud-meter-labels {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.72rem;
}

.hud-meter-name {
    color: #475569;
    font-weight: 600;
}

.hud-meter-val {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.78rem;
    color: #0f172a;
}

.hud-meter-bar {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.hud-meter-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease, background-color 0.3s ease;
    background: #10b981;
}

.hud-meter-fill.warn {
    background: #f59e0b;
}

.hud-meter-fill.danger {
    background: #ef4444;
}

/* --- Right Side Main Workspace (Continuous Container) --- */
.app-main-workspace {
    flex: 1;
    min-width: 0;
    max-width: 1020px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

/* Attached Hub Nav Bar */
.app-main-workspace .top-hub-nav {
    width: 100%;
    background: #e9e6df;
    border: 1px solid var(--color-border);
    border-top: none;
    border-bottom: 1px solid var(--color-border);
    padding: 8px 16px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    border-radius: 8px 8px 0 0;
    font-size: 0.82rem;
    white-space: nowrap;
}

.top-hub-nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 600;
}

.top-hub-nav a:hover {
    text-decoration: underline;
}

.suite-badge {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.74rem;
    background: #e0f2fe;
    color: #0369a1;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid #bae6fd;
    text-transform: uppercase;
    margin-left: 10px;
}

.top-hub-nav-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.pdf-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #475569;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background: #ffffff;
    text-decoration: none;
}

.pdf-btn:hover {
    color: var(--color-accent);
    border-color: var(--color-accent);
}

.lang-toggle-btn {
    padding: 4px 9px;
    font-size: 0.74rem;
    font-weight: 700;
    border-radius: 4px;
    border: 1px solid var(--color-accent);
    background: #ffffff;
    color: var(--color-accent);
    cursor: pointer;
    transition: all 0.15s;
}

.lang-toggle-btn:hover {
    background: var(--color-accent);
    color: #ffffff;
}

/* Attached Export Bar */
.app-main-workspace .doc-actions-bar {
    width: 100%;
    background: #fcfbfa;
    border-left: 1px solid var(--color-border);
    border-right: 1px solid var(--color-border);
    border-top: none;
    border-bottom: 1px solid var(--color-border-light);
    padding: 8px 16px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--sp-md);
    flex-wrap: wrap;
    margin-bottom: 0;
}

.doc-actions-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-heading);
}

.doc-actions-buttons {
    display: flex;
    gap: 8px;
}

.btn-export {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 4px;
    border: 1px solid var(--color-border);
    background: #ffffff;
    color: var(--color-heading);
    cursor: pointer;
    transition: all 0.15s;
}

.btn-export:hover {
    border-color: var(--color-accent);
    background: #f0f7ff;
}

.btn-export--primary {
    background: var(--color-accent);
    color: #ffffff;
    border-color: var(--color-accent);
}

.btn-export--primary:hover {
    background: #004485;
}

/* Attached Tab Navigation */
.app-main-workspace .tab-nav {
    width: 100%;
    background: #ece8df;
    border-left: 1px solid var(--color-border);
    border-right: 1px solid var(--color-border);
    border-top: none;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    margin-bottom: 0;
    padding: 0;
    box-sizing: border-box;
    overflow-x: auto;
}

.app-main-workspace .tab-btn {
    flex: 1;
    min-width: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 14px;
    border: none;
    border-right: 1px solid var(--color-border);
    border-bottom: 3px solid transparent;
    background: transparent;
    color: var(--color-text-muted);
    font-family: var(--font-serif);
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    border-radius: 0;
    text-decoration: none;
    white-space: nowrap;
}

.app-main-workspace .tab-btn:last-child {
    border-right: none;
}

.app-main-workspace .tab-btn:hover {
    color: var(--color-heading);
    background: rgba(0, 0, 0, 0.03);
}

.app-main-workspace .tab-btn.active {
    color: var(--color-heading);
    border-bottom: 3px solid var(--color-accent);
    background: var(--color-paper);
}

.app-main-workspace .tab-btn svg {
    width: 16px;
    height: 16px;
    opacity: 0.6;
}

.app-main-workspace .tab-btn.active svg {
    opacity: 1;
    color: var(--color-accent);
}

.tab-panel {
    display: none;
    flex-direction: column;
    gap: 16px;
}

.tab-panel.active {
    display: flex;
}

/* Attached Printable Sheet */
.app-main-workspace .page-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    background: #fafaf8;
    border: 1px solid var(--color-border);
    border-top: none;
    box-shadow: 0 4px 16px var(--color-paper-shadow);
    padding: 24px 32px;
    box-sizing: border-box;
    border-radius: 0 0 8px 8px;
}

/* Engineering Title Block (Nimiö) */
.engineering-title-block {
    border: 2px solid var(--color-heading);
    margin-bottom: 18px;
    background: #ffffff;
}

.title-block-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid var(--color-heading);
}

.title-block-main-title {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-heading);
}

.title-block-main-subtitle {
    font-size: 0.78rem;
    color: var(--color-text-secondary);
}

.std-badge {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    background: #0f172a;
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 3px;
    letter-spacing: 0.5px;
}

.title-block-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1.2fr 1.2fr;
}

.title-block-cell {
    padding: 5px 10px;
    border-right: 1px solid var(--color-heading);
}

.title-block-cell:last-child {
    border-right: none;
}

.title-block-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--color-text-secondary);
}

.title-block-val {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-heading);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Visualizers & Diagrams --- */
.visualizer-card,
.weld-visualizer-card,
.playground-canvas-card {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    margin-bottom: 16px;
}

.visualizer-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--color-heading);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--color-border-light);
    padding-bottom: 4px;
}

.svg-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #fafaf8;
    border-radius: 4px;
    padding: 10px 14px;
    box-sizing: border-box;
    overflow: hidden;
}

.svg-container svg {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
}

.playground-svg-container {
    width: 100%;
    background: #fdfdfc;
    border: 1px solid var(--color-border-light);
    border-radius: 4px;
    display: flex;
    justify-content: center;
    padding: 8px 0;
}

.vector-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
    padding: 8px 0 4px;
    font-size: 0.74rem;
    color: var(--color-heading);
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.legend-dot--force { background: #0055a3; }
.legend-dot--perp  { background: #e65100; }
.legend-dot--trans { background: #c62828; }
.legend-dot--long  { background: #2e7d32; }

.live-decomp-card {
    margin-top: 10px;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.8rem;
}

.educational-callout {
    background: #f0fdf4;
    border-left: 4px solid #22c55e;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-bottom: 12px;
    color: #166534;
}

/* --- Document Calculation Sections & Steps --- */
.doc-section {
    margin-bottom: 18px;
}

.doc-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--color-border-light);
    padding-bottom: 4px;
}

.doc-section-num {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-accent);
}

.doc-section-header h3 {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--color-heading);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ---- Calculation Steps & Formula Typography (Aligned with Suite Standards) ---- */
/* Step cards, headers, numbers, and formulas are inherited from shared/document.css */

.formula-block .katex .fbox,
.formula-block .katex .boxed {
    border: none !important;
    padding: 0 !important;
}

/* --- Tables & Summary Matrices --- */
.result-table-wrapper {
    margin-top: 16px;
}

.table-title {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--color-heading);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.report-table,
.verification-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    overflow: hidden;
    font-size: 0.80rem;
    margin-top: 8px;
}

.report-table th,
.verification-table th {
    background: #f4f2ee;
    padding: 8px 10px;
    font-weight: 700;
    color: var(--color-heading);
    border-bottom: 1px solid var(--color-border);
    text-align: left;
}

.report-table td,
.verification-table td {
    padding: 7px 10px;
    border-bottom: 1px solid var(--color-border-light);
    color: var(--color-heading);
}

.report-table tbody tr:last-child td,
.verification-table tbody tr:last-child td {
    border-bottom: none;
}

.report-table tbody tr:last-child td,
.verification-table tbody tr:last-child td {
    border-bottom: none;
}

.report-table tbody tr:hover,
.verification-table tbody tr:hover {
    background: #f8fafc;
}

.status-badge-pass,
.status-badge-fail {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 3px;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: var(--font-mono);
}

.status-badge-pass {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.status-badge-fail {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.calc-alert {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.82rem;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.calc-alert--success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.calc-alert--warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.print-module-title {
    display: none;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-heading);
    margin-bottom: 12px;
    border-bottom: 2px solid var(--color-heading);
    padding-bottom: 4px;
}

/* --- Footer --- */
.doc-footer {
    margin-top: 24px;
    padding-top: 12px;
    border-top: 1px solid var(--color-border-light);
    font-size: 0.72rem;
    color: var(--color-text-muted);
    text-align: center;
}

/* ============================================================
   PRINT MEDIA RULES (@page and @media print)
   ============================================================ */
@page {
    size: A4 portrait;
    margin: 10mm 12mm;
}

@media print {
    .app-sidebar-dock,
    .top-hub-nav,
    .doc-actions-bar,
    .tab-nav,
    .btn-export,
    .btn-dock-action,
    .print-hide {
        display: none !important;
    }

    body {
        background: #ffffff !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .workspace-wrapper {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .app-main-workspace {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .page-container {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        border: none !important;
        background: #ffffff !important;
    }

    /* Print Active tab or all tabs cleanly */
    .tab-panel {
        display: none !important;
    }

    .tab-panel.active {
        display: flex !important;
    }

    .print-module-title {
        display: block !important;
    }

    .doc-section,
    .calc-step,
    .visualizer-card,
    .weld-visualizer-card,
    .playground-canvas-card,
    .result-table-wrapper,
    .engineering-title-block {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .print-page-break {
        page-break-before: always;
        break-before: page;
    }
}

/* ============================================================
   TOP HUB NAV ACTIVE TAG & DRAWER TOGGLE
   ============================================================ */
.nav-active-tag {
    font-size: 0.72rem;
    font-weight: 700;
    font-family: var(--font-mono, monospace);
    background: #eff6ff;
    color: var(--color-accent, #0055a3);
    border: 1px solid #bfdbfe;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.02em;
}

.drawer-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #ffffff;
    border: 1px solid var(--color-border, #d1d5db);
    color: var(--color-heading, #0f172a);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.drawer-toggle-btn:hover {
    background: #f8fafc;
    border-color: var(--color-accent, #0055a3);
    color: var(--color-accent, #0055a3);
}

/* ============================================================
   WELDED JOINTS MEMBER DRAWER (SLIDE-OUT SIDE OVERLAY)
   ============================================================ */
.weld-member-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 360px;
    max-width: 90vw;
    background: #ffffff;
    border-left: 1px solid var(--color-border, #d1d5db);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.weld-member-drawer.open {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid var(--color-border, #d1d5db);
    background: #f8fafc;
}

.drawer-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.drawer-heading {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--color-heading, #0f172a);
}

.drawer-count-badge {
    font-size: 0.70rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    background: #e2e8f0;
    color: #475569;
}

.drawer-close-btn {
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}

.drawer-close-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.drawer-proj-banner {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 0.78rem;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drawer-toolbar {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 6px;
    padding: 8px 12px;
    background: #ffffff;
    border-bottom: 1px solid var(--color-border, #d1d5db);
}

.btn-drawer-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 5px 8px;
    font-size: 0.74rem;
    font-weight: 600;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    cursor: pointer;
    color: #334155;
    transition: all 0.15s;
}

.btn-drawer-action:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}

.btn-drawer-action-danger:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.drawer-card {
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 6px;
    padding: 10px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.15s ease;
}

.drawer-card:hover {
    border-color: #94a3b8;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.drawer-card.active {
    border-color: var(--color-accent, #0055a3);
    background: #f0f9ff;
    box-shadow: 0 0 0 1px var(--color-accent, #0055a3);
}

.card-top,
.drawer-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.card-tag,
.drawer-card-code {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--color-heading, #0f172a);
    font-family: var(--font-mono, monospace);
}

.card-pill,
.drawer-card-status {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    white-space: nowrap;
}

.card-pill.pill-pass,
.card-pill.pass,
.drawer-card-status.pass {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.card-pill.pill-fail,
.card-pill.fail,
.drawer-card-status.fail {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.drawer-card-body {
    font-size: 0.74rem;
    color: #475569;
    line-height: 1.4;
}

.drawer-card-gov {
    font-size: 0.72rem;
    margin-top: 4px;
    font-weight: 600;
    color: #0055a3;
}

.drawer-card.is-locked {
    border-color: #fde68a;
    background: #fffbeb;
}

.card-pill.locked,
.pill-locked {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.card-lock-btn {
    background: transparent;
    border: 1px solid var(--color-border, #cbd5e1);
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 0.72rem;
    cursor: pointer;
    transition: all 0.15s;
    color: #475569;
}

.card-lock-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.dock-is-locked input,
.dock-is-locked select,
.dock-is-locked button:not(#btn-toggle-project-settings) {
    pointer-events: none;
    opacity: 0.75;
    background-color: #f8fafc !important;
}
