/* =============================================================================
   COORDINATOR — Phase C1: Transaction Command Center
   New styles: KPI strip, transaction cards, updated empty state.
   Existing coordinator styles remain in client.css for modal/folder compat.
   ============================================================================= */

/* ── Styled confirm dialog ───────────────────────────────────────────────────── */
.tx-confirm-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0, 0, 0, 0.55);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    opacity: 0; transition: opacity 0.18s ease;
    backdrop-filter: blur(2px);
}
.tx-confirm-overlay.tx-confirm-visible { opacity: 1; }

.tx-confirm-modal {
    background: #1e293b;
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 14px;
    padding: 28px 28px 22px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 24px 64px rgba(0,0,0,0.5);
    transform: translateY(6px);
    transition: transform 0.18s ease;
}
.tx-confirm-overlay.tx-confirm-visible .tx-confirm-modal { transform: translateY(0); }

.tx-confirm-title {
    font-size: 1rem;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 8px;
}
.tx-confirm-body {
    font-size: 0.875rem;
    color: #94a3b8;
    line-height: 1.55;
    margin-bottom: 22px;
}
.tx-confirm-title + .tx-confirm-actions { margin-top: 22px; }

.tx-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.tx-confirm-btn {
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.12s, background 0.12s;
    border: none;
}
.tx-confirm-cancel {
    background: rgba(255,255,255,0.06);
    color: #94a3b8;
    border: 1px solid rgba(255,255,255,0.1);
}
.tx-confirm-cancel:hover { background: rgba(255,255,255,0.11); }
.tx-confirm-ok {
    background: #6366f1;
    color: #fff;
}
.tx-confirm-ok:hover { opacity: 0.88; }

/* ── KPI / Filter Tab Strip ─────────────────────────────────────────────────── */

.coordinator-kpi-strip {
    display: flex;
    gap: 10px;
    padding: 14px 0 10px;
}

.coordinator-kpi-tile {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 11px 8px;
    border-radius: 10px;
    border: 2px solid transparent;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    min-width: 0;
    user-select: none;
}

.coordinator-kpi-tile:hover {
    background: rgba(255, 255, 255, 0.09);
    transform: translateY(-1px);
}

.coordinator-kpi-tile.active {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.13);
}

.coordinator-kpi-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1;
    color: #e0e0e0;
}

.coordinator-kpi-label {
    font-size: 0.67rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #888;
    margin-top: 5px;
    white-space: nowrap;
}

/* ── Transaction Cards ───────────────────────────────────────────────────────── */

.coordinator-tx-card {
    background: #2a2a2a;
    border: 2px solid transparent;
    border-radius: 14px;
    padding: 20px 18px 16px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
    position: relative;
}

.coordinator-tx-card:hover {
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.18);
}

.coordinator-tx-card-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding-right: 28px;
}

.coordinator-tx-type-badge {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(102, 126, 234, 0.18);
    color: #a5b4fc;
    border: 1px solid rgba(102, 126, 234, 0.3);
    flex-shrink: 0;
}

.coordinator-tx-stage-badge {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 8px;
    border-radius: 4px;
    margin-left: auto;
    flex-shrink: 0;
}

.coordinator-tx-stage-badge.stage-draft            { background: rgba(148,163,184,0.12); color: #94a3b8; border: 1px solid rgba(148,163,184,0.22); }
.coordinator-tx-stage-badge.stage-building         { background: rgba(96,165,250,0.12);  color: #60a5fa; border: 1px solid rgba(96,165,250,0.22); }
.coordinator-tx-stage-badge.stage-internal_review  { background: rgba(167,139,250,0.12); color: #a78bfa; border: 1px solid rgba(167,139,250,0.22); }
.coordinator-tx-stage-badge.stage-ready            { background: rgba(52,211,153,0.12);  color: #34d399; border: 1px solid rgba(52,211,153,0.22); }
.coordinator-tx-stage-badge.stage-sent             { background: rgba(251,191,36,0.12);  color: #fbbf24; border: 1px solid rgba(251,191,36,0.22); }
.coordinator-tx-stage-badge.stage-partially_signed { background: rgba(251,146,60,0.12);  color: #fb923c; border: 1px solid rgba(251,146,60,0.22); }
.coordinator-tx-stage-badge.stage-fully_signed     { background: rgba(34,197,94,0.14);   color: #4ade80; border: 1px solid rgba(34,197,94,0.24); }
.coordinator-tx-stage-badge.stage-under_contract   { background: rgba(251,146,60,0.12);  color: #fb923c; border: 1px solid rgba(251,146,60,0.22); }
.coordinator-tx-stage-badge.stage-pending_close    { background: rgba(250,204,21,0.12);  color: #fbbf24; border: 1px solid rgba(250,204,21,0.22); }
.coordinator-tx-stage-badge.stage-closing          { background: rgba(250,204,21,0.18);  color: #f59e0b; border: 1px solid rgba(250,204,21,0.28); }
.coordinator-tx-stage-badge.stage-closed           { background: rgba(34,197,94,0.1);    color: #86efac; border: 1px solid rgba(34,197,94,0.18); }
.coordinator-tx-stage-badge.stage-archived         { background: rgba(100,116,139,0.1);  color: #64748b; border: 1px solid rgba(100,116,139,0.18); }
.coordinator-tx-stage-badge.stage-cancelled        { background: rgba(239,68,68,0.08);   color: #f87171; border: 1px solid rgba(239,68,68,0.15); }

.coordinator-tx-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #e0e0e0;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.coordinator-tx-address {
    font-size: 0.78rem;
    color: #888;
    margin-bottom: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.coordinator-tx-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    flex-wrap: wrap;
}

.coordinator-tx-meta {
    font-size: 0.73rem;
    color: #777;
}

.coordinator-tx-deadline {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: 20px;
    margin-left: auto;
    white-space: nowrap;
}

.coordinator-tx-deadline.deadline-ok      { background: rgba(34,197,94,0.1);   color: #4ade80; }
.coordinator-tx-deadline.deadline-warning { background: rgba(250,204,21,0.12); color: #fbbf24; }
.coordinator-tx-deadline.deadline-urgent  { background: rgba(239,68,68,0.12);  color: #f87171; }

.coordinator-tx-delete {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.18);
    font-size: 0.72rem;
    cursor: pointer;
    padding: 3px 6px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
    line-height: 1;
}

.coordinator-tx-delete:hover {
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
}

/* ── Empty State (enhanced) ──────────────────────────────────────────────────── */

.coordinator-empty-icon {
    font-size: 2.2rem;
    line-height: 1;
    opacity: 0.35;
    margin-bottom: 2px;
}

.coordinator-empty-title {
    font-size: 1rem;
    font-weight: 600;
    color: #e0e0e0;
}

/* ── No-match state (search / tab filter returns zero results) ──────────────── */

.coordinator-no-match {
    padding: 44px 20px;
    text-align: center;
    font-size: 0.84rem;
    color: #555;
    grid-column: 1 / -1;
}

/* ── Luxury theme overrides ──────────────────────────────────────────────────── */

body[data-theme^="luxury"] .coordinator-kpi-tile,
body[data-theme="luxury"] .coordinator-kpi-tile {
    background: var(--bg-card, #f5f5f5);
    border-color: var(--border-soft, #e0e0e0);
}

body[data-theme^="luxury"] .coordinator-kpi-tile:hover,
body[data-theme="luxury"] .coordinator-kpi-tile:hover {
    background: var(--card-bg-alt, #efefef);
}

body[data-theme^="luxury"] .coordinator-kpi-tile.active,
body[data-theme="luxury"] .coordinator-kpi-tile.active {
    border-color: var(--accent-primary, #667eea);
    background: rgba(102, 126, 234, 0.07);
}

body[data-theme^="luxury"] .coordinator-kpi-value,
body[data-theme="luxury"] .coordinator-kpi-value {
    color: var(--text-primary);
}

body[data-theme^="luxury"] .coordinator-kpi-label,
body[data-theme="luxury"] .coordinator-kpi-label {
    color: var(--text-muted);
}

body[data-theme^="luxury"] .coordinator-tx-card,
body[data-theme="luxury"] .coordinator-tx-card {
    background: var(--bg-card);
    border-color: var(--border-soft);
    box-shadow: var(--shadow-card);
}

body[data-theme^="luxury"] .coordinator-tx-card:hover,
body[data-theme="luxury"] .coordinator-tx-card:hover {
    background: var(--card-bg-alt, var(--bg-card));
    border-color: var(--accent-primary);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

body[data-theme^="luxury"] .coordinator-tx-title,
body[data-theme="luxury"] .coordinator-tx-title {
    color: var(--text-primary);
}

body[data-theme^="luxury"] .coordinator-tx-address,
body[data-theme="luxury"] .coordinator-tx-address,
body[data-theme^="luxury"] .coordinator-tx-meta,
body[data-theme="luxury"] .coordinator-tx-meta {
    color: var(--text-muted);
}

body[data-theme^="luxury"] .coordinator-tx-footer,
body[data-theme="luxury"] .coordinator-tx-footer {
    border-top-color: var(--border-soft);
}

body[data-theme^="luxury"] .coordinator-tx-delete,
body[data-theme="luxury"] .coordinator-tx-delete {
    color: var(--text-muted);
}

body[data-theme^="luxury"] .coordinator-empty-title,
body[data-theme="luxury"] .coordinator-empty-title {
    color: var(--text-primary);
}

/* ── Deep Blue theme overrides ───────────────────────────────────────────────── */

body[data-theme="deep-blue"] .coordinator-kpi-tile {
    background: rgba(30, 58, 138, 0.14);
    border-color: rgba(59, 130, 246, 0.15);
}

body[data-theme="deep-blue"] .coordinator-kpi-tile.active {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.12);
}

body[data-theme="deep-blue"] .coordinator-tx-card {
    background: rgba(30, 58, 138, 0.12);
    border-color: rgba(59, 130, 246, 0.14);
}

body[data-theme="deep-blue"] .coordinator-tx-card:hover {
    background: rgba(30, 58, 138, 0.22);
    border-color: #3b82f6;
}

/* ── Responsive ──────────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
    .coordinator-kpi-strip {
        gap: 6px;
    }

    .coordinator-kpi-tile {
        padding: 9px 4px;
    }

    .coordinator-kpi-value {
        font-size: 1.3rem;
    }

    .coordinator-kpi-label {
        font-size: 0.6rem;
    }
}

/* ── Phase C2: Transaction Wizard ────────────────────────────────────────────── */

.tx-wizard-modal {
    max-width: 600px;
    width: 92%;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
}

.tx-wizard-progress {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 14px 24px 0;
}

.tx-wizard-step-dot {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.12);
    transition: background 0.2s;
}

.tx-wizard-step-dot.active { background: #667eea; }
.tx-wizard-step-dot.done   { background: rgba(102, 126, 234, 0.45); }

.tx-wizard-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    min-height: 240px;
}

.tx-wizard-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    flex-shrink: 0;
}

.tx-wizard-footer-right {
    display: flex;
    gap: 10px;
}

/* step labels */
.tx-step-title {
    font-size: 1rem;
    font-weight: 600;
    color: #e0e0e0;
    margin: 0 0 4px;
}

.tx-step-hint {
    font-size: 0.78rem;
    color: #888;
    margin: 0 0 20px;
}

/* field groups */
.tx-field-group {
    margin-bottom: 16px;
}

.tx-field-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    margin-bottom: 6px;
}

.tx-field-optional {
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.72rem;
}

.tx-required {
    color: #f87171;
}

.tx-text-input,
.tx-search-input {
    width: 100%;
    padding: 9px 12px;
    background: #3a3a3a;
    border: 1px solid #555;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 13px;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.tx-text-input:focus,
.tx-search-input:focus {
    outline: none;
    border-color: #667eea;
}

.tx-select-input {
    width: 100%;
    padding: 9px 12px;
    background: #3a3a3a;
    border: 1px solid #555;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 13px;
    box-sizing: border-box;
    transition: border-color 0.15s;
    appearance: none;
    cursor: pointer;
}
.tx-select-input:focus { outline: none; border-color: #667eea; }

/* client dropdown */
.tx-client-dropdown-wrapper {
    position: relative;
}

.tx-client-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    background: #3a3a3a;
    border: 1px solid #555;
    border-radius: 8px;
    max-height: 180px;
    overflow-y: auto;
    z-index: 300;
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

.tx-client-option {
    padding: 9px 12px;
    font-size: 13px;
    color: #e0e0e0;
    cursor: pointer;
    transition: background 0.15s;
}

.tx-client-option:hover,
.tx-client-option.selected { background: rgba(102, 126, 234, 0.15); }

.tx-selected-client {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    font-size: 0.85rem;
    color: #e0e0e0;
}

.tx-selected-client-clear {
    margin-left: auto;
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 2px 4px;
}

/* Type step */
.tx-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
}

.tx-type-card {
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 16px 10px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.tx-type-card:hover { border-color: rgba(102, 126, 234, 0.5); background: rgba(102, 126, 234, 0.06); }
.tx-type-card.selected { border-color: #667eea; background: rgba(102, 126, 234, 0.13); }

.tx-type-icon { font-size: 1.5rem; margin-bottom: 7px; }
.tx-type-label { font-size: 0.8rem; font-weight: 600; color: #e0e0e0; }

/* Mode step */
.tx-mode-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.tx-mode-card {
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px 16px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.tx-mode-card:hover { border-color: rgba(102, 126, 234, 0.5); background: rgba(102, 126, 234, 0.06); }
.tx-mode-card.selected { border-color: #667eea; background: rgba(102, 126, 234, 0.13); }

.tx-mode-icon { font-size: 1.8rem; margin-bottom: 10px; }
.tx-mode-title { font-size: 0.88rem; font-weight: 600; color: #e0e0e0; margin-bottom: 4px; }
.tx-mode-desc  { font-size: 0.73rem; color: #888; line-height: 1.4; }

/* Package step */
.tx-package-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tx-package-card {
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 14px 16px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.tx-package-card:hover { border-color: rgba(102, 126, 234, 0.5); background: rgba(102, 126, 234, 0.06); }
.tx-package-card.selected { border-color: #667eea; background: rgba(102, 126, 234, 0.13); }

.tx-package-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.tx-package-name { font-size: 0.88rem; font-weight: 600; color: #e0e0e0; }

.tx-package-mock-badge {
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 3px;
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.25);
}

.tx-package-desc  { font-size: 0.74rem; color: #888; margin-bottom: 8px; }
.tx-package-forms { font-size: 0.72rem; color: #a0aec0; }

/* Manual forms step */
.tx-manual-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.tx-manual-filter-btn {
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: transparent;
    color: #aaa;
    font-size: 0.74rem;
    cursor: pointer;
    transition: all 0.15s;
}

.tx-manual-filter-btn:hover { border-color: #667eea; color: #e0e0e0; }
.tx-manual-filter-btn.active { background: #667eea; border-color: #667eea; color: white; }

.tx-manual-forms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
    max-height: 240px;
    overflow-y: auto;
}

.tx-form-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.78rem;
    color: #ccc;
    transition: border-color 0.15s, background 0.15s;
    user-select: none;
}

.tx-form-item:hover { border-color: rgba(102, 126, 234, 0.4); background: rgba(102, 126, 234, 0.06); }
.tx-form-item.selected { border-color: #667eea; background: rgba(102, 126, 234, 0.12); color: #e0e0e0; }

.tx-form-icon { font-size: 0.72rem; font-weight: 700; opacity: 0.7; min-width: 28px; text-align: center; }
.tx-form-check { margin-left: auto; color: #667eea; font-size: 0.8rem; }
.tx-form-lib-badge { margin-left: auto; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.04em; background: rgba(72, 187, 120, 0.18); color: #68d391; border: 1px solid rgba(72, 187, 120, 0.3); border-radius: 4px; padding: 1px 5px; }

.tx-form-search-input {
    width: 100%;
    box-sizing: border-box;
    padding: 7px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: #e0e0e0;
    font-size: 0.8rem;
    margin-bottom: 10px;
    outline: none;
    transition: border-color 0.15s;
}
.tx-form-search-input::placeholder { color: #666; }
.tx-form-search-input:focus { border-color: rgba(102, 126, 234, 0.5); }

.tx-manual-count {
    font-size: 0.75rem;
    color: #888;
    margin-top: 10px;
}

/* Dates step */
.tx-dates-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.tx-date-field label {
    display: block;
    font-size: 0.74rem;
    font-weight: 500;
    color: #888;
    margin-bottom: 5px;
}

.tx-date-field input[type="date"] {
    width: 100%;
    padding: 8px 10px;
    background: #3a3a3a;
    border: 1px solid #555;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 13px;
    box-sizing: border-box;
}

.tx-date-field input[type="date"]:focus {
    outline: none;
    border-color: #667eea;
}

.tx-skip-hint {
    font-size: 0.75rem;
    color: #888;
    margin-top: 14px;
    font-style: italic;
}

/* Review step */
.tx-review-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tx-review-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
}

.tx-review-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    min-width: 90px;
    flex-shrink: 0;
}

.tx-review-value {
    font-size: 0.85rem;
    color: #e0e0e0;
}

/* Transaction Team step */
.tx-team-section {
    margin-bottom: 18px;
}

.tx-team-section-header {
    margin-bottom: 8px;
}

.tx-team-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
}

.tx-team-add-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.tx-team-input {
    flex: 1;
    min-width: 120px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 7px 10px;
    color: #e0e0e0;
    font-size: 0.82rem;
    outline: none;
    transition: border-color 0.15s;
}

.tx-team-input:focus {
    border-color: #667eea;
}

.tx-team-input::placeholder {
    color: #666;
}

/* Make csr-btn fill the flex row like the text inputs */
.tx-team-add-row .csr-btn {
    flex: 1;
    min-width: 130px;
    padding: 7px 10px;
    font-size: 0.82rem;
    border-radius: 8px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: #e0e0e0;
    text-align: left;
}

.tx-team-add-row .csr-btn:hover:not(.csr-disabled) {
    background: rgba(255,255,255,0.1);
    border-color: rgba(102, 126, 234, 0.5);
}

.tx-team-add-btn {
    flex-shrink: 0;
    background: rgba(102, 126, 234, 0.15);
    border: 1px solid rgba(102, 126, 234, 0.35);
    border-radius: 8px;
    color: #667eea;
    font-size: 0.82rem;
    padding: 7px 14px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.tx-team-add-btn:hover {
    background: rgba(102, 126, 234, 0.28);
    border-color: rgba(102, 126, 234, 0.6);
}

.tx-party-list {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.tx-party-empty {
    font-size: 0.82rem;
    color: #666;
    text-align: center;
    padding: 18px 0 10px;
}

.tx-party-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.06);
}

.tx-party-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.tx-party-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 7px;
    border-radius: 20px;
    flex-shrink: 0;
}

.tx-party-badge--internal {
    background: rgba(102, 126, 234, 0.18);
    color: #7b9ef8;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.tx-party-badge--external {
    background: rgba(80, 200, 120, 0.15);
    color: #6bcf8e;
    border: 1px solid rgba(80, 200, 120, 0.3);
}

.tx-party-name {
    font-size: 0.85rem;
    color: #e0e0e0;
    font-weight: 500;
}

.tx-party-role {
    font-size: 0.75rem;
    color: #888;
}

.tx-party-detail {
    font-size: 0.75rem;
    color: #777;
}

.tx-party-remove {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #666;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.15s;
}

.tx-party-remove:hover {
    color: #e05757;
}

/* Loading / empty states */
.tx-wizard-loading,
.tx-wizard-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    color: #888;
    font-size: 0.85rem;
    flex-direction: column;
    gap: 10px;
    text-align: center;
}

/* Theme overrides */
body[data-theme^="luxury"] .tx-text-input,
body[data-theme="luxury"] .tx-text-input,
body[data-theme^="luxury"] .tx-search-input,
body[data-theme="luxury"] .tx-search-input,
body[data-theme^="luxury"] .tx-select-input,
body[data-theme="luxury"] .tx-select-input,
body[data-theme^="luxury"] .tx-date-field input[type="date"],
body[data-theme="luxury"] .tx-date-field input[type="date"] {
    background: var(--control-bg) !important;
    color: var(--control-text) !important;
    border-color: var(--control-border) !important;
}

body[data-theme^="luxury"] .tx-client-list,
body[data-theme="luxury"] .tx-client-list {
    background: var(--bg-card);
    border-color: var(--border-soft);
}

body[data-theme^="luxury"] .tx-type-card,
body[data-theme="luxury"] .tx-type-card,
body[data-theme^="luxury"] .tx-mode-card,
body[data-theme="luxury"] .tx-mode-card,
body[data-theme^="luxury"] .tx-package-card,
body[data-theme="luxury"] .tx-package-card,
body[data-theme^="luxury"] .tx-form-item,
body[data-theme="luxury"] .tx-form-item {
    border-color: var(--border-soft);
    background: var(--bg-card);
}

body[data-theme^="luxury"] .tx-type-card.selected,
body[data-theme="luxury"] .tx-type-card.selected,
body[data-theme^="luxury"] .tx-mode-card.selected,
body[data-theme="luxury"] .tx-mode-card.selected,
body[data-theme^="luxury"] .tx-package-card.selected,
body[data-theme="luxury"] .tx-package-card.selected,
body[data-theme^="luxury"] .tx-form-item.selected,
body[data-theme="luxury"] .tx-form-item.selected {
    border-color: var(--accent-primary);
    background: rgba(102, 126, 234, 0.07);
}

body[data-theme^="luxury"] .tx-step-title,
body[data-theme="luxury"] .tx-step-title,
body[data-theme^="luxury"] .tx-type-label,
body[data-theme="luxury"] .tx-type-label,
body[data-theme^="luxury"] .tx-mode-title,
body[data-theme="luxury"] .tx-mode-title,
body[data-theme^="luxury"] .tx-package-name,
body[data-theme="luxury"] .tx-package-name,
body[data-theme^="luxury"] .tx-review-value,
body[data-theme="luxury"] .tx-review-value {
    color: var(--text-primary);
}

body[data-theme^="luxury"] .tx-step-hint,
body[data-theme="luxury"] .tx-step-hint,
body[data-theme^="luxury"] .tx-mode-desc,
body[data-theme="luxury"] .tx-mode-desc,
body[data-theme^="luxury"] .tx-package-desc,
body[data-theme="luxury"] .tx-package-desc,
body[data-theme^="luxury"] .tx-review-label,
body[data-theme="luxury"] .tx-review-label,
body[data-theme^="luxury"] .tx-field-label,
body[data-theme="luxury"] .tx-field-label {
    color: var(--text-muted);
}

body[data-theme^="luxury"] .tx-wizard-footer,
body[data-theme="luxury"] .tx-wizard-footer {
    border-top-color: var(--border-soft);
}

body[data-theme^="luxury"] .tx-review-row,
body[data-theme="luxury"] .tx-review-row {
    background: var(--bg-card);
}

body[data-theme="deep-blue"] .tx-text-input,
body[data-theme="deep-blue"] .tx-search-input,
body[data-theme="deep-blue"] .tx-select-input {
    background: rgba(15, 30, 70, 0.5);
    border-color: rgba(59, 130, 246, 0.2);
    color: #e0e0e0;
}

body[data-theme="deep-blue"] .tx-type-card,
body[data-theme="deep-blue"] .tx-mode-card,
body[data-theme="deep-blue"] .tx-package-card,
body[data-theme="deep-blue"] .tx-form-item {
    background: rgba(30, 58, 138, 0.12);
    border-color: rgba(59, 130, 246, 0.15);
}

body[data-theme="deep-blue"] .tx-type-card.selected,
body[data-theme="deep-blue"] .tx-mode-card.selected,
body[data-theme="deep-blue"] .tx-package-card.selected,
body[data-theme="deep-blue"] .tx-form-item.selected {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.12);
}

/* =============================================================================
   COORDINATOR — Phase C3: Transaction Workspace
   ============================================================================= */

/* ── Workspace layout ──────────────────────────────────────────────────────── */

#coordinatorWorkspaceView {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
    background: #13131f;  /* solid base so the animated page bg doesn't bleed through */
}

/* ── Workspace header ──────────────────────────────────────────────────────── */

.tx-ws-header {
    padding: 16px 20px 14px;
    background: #1a1a2a;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.tx-ws-back {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    color: #94a3b8;
    background: #1e1e30;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 5px 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.tx-ws-back:hover { background: #252540; color: #e0e0e0; }

.tx-ws-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.tx-ws-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #e0e0e0;
    margin: 0;
}

.tx-ws-edit-info-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    color: #888;
    font-size: 0.72rem;
    padding: 3px 9px;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
    flex-shrink: 0;
}

.tx-ws-edit-info-btn:hover { color: #c7d2fe; background: rgba(99, 102, 241, 0.12); border-color: rgba(99, 102, 241, 0.3); }

/* Participant / view-only badge in workspace header */
.tx-ws-participant-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #7b9ef8;
    background: rgba(102, 126, 234, 0.12);
    border: 1px solid rgba(102, 126, 234, 0.28);
    border-radius: 6px;
    padding: 4px 10px;
    flex-shrink: 0;
}

.tx-ws-meta-chip--empty {
    opacity: 0.35;
    font-style: italic;
}

/* ── Edit Transaction Modal ───────────────────────────────────────────────────── */

.tx-edit-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tx-edit-modal {
    background: #1e1e30;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    width: 100%;
    max-width: 560px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.tx-edit-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.tx-edit-modal-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #e0e0e0;
}

.tx-edit-modal-close {
    background: none;
    border: none;
    color: #64748b;
    font-size: 1rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.15s;
}

.tx-edit-modal-close:hover { color: #f87171; }

.tx-edit-modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    flex: 1;
}

.tx-edit-divider {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.07);
    margin: 4px 0;
}

/* Picker wrapper divs inside the edit modal add rows need flex:1 */
#txEditInternalAddRow > div,
#txEditInternalAddRow > div .csr-btn,
.tx-team-add-row > div[id$="Container"],
.tx-team-add-row > div[id$="Container"] .csr-btn {
    flex: 1;
    min-width: 0;
    width: 100%;
}

.tx-edit-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tx-edit-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
}

.tx-edit-input {
    background: #2a2a40;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 7px;
    padding: 9px 12px;
    font-size: 0.85rem;
    color: #e2e8f0;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.tx-edit-input::placeholder { color: #4a5568; }
.tx-edit-input:focus { outline: none; border-color: rgba(102, 126, 234, 0.6); }

.tx-edit-modal-footer {
    display: flex;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    justify-content: flex-end;
}

.tx-ws-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.tx-ws-meta-chip {
    font-size: 0.7rem;
    color: #888;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 3px 10px;
}

.tx-ws-stage-select {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 6px;
    color: #ccc;
    font-size: 0.72rem;
    padding: 3px 8px;
    cursor: pointer;
    transition: border-color 0.15s;
}

.tx-ws-stage-select:focus { outline: none; border-color: #667eea; }

/* ── Tab bar ───────────────────────────────────────────────────────────────── */

.tx-ws-tab-bar {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0 16px;
    flex-shrink: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.tx-ws-tab-bar::-webkit-scrollbar { display: none; }

.tx-ws-tab {
    padding: 10px 16px;
    font-size: 0.79rem;
    font-weight: 500;
    color: #777;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
    margin-bottom: -1px;
}

.tx-ws-tab:hover { color: #ccc; }
.tx-ws-tab.active { color: #e0e0e0; border-bottom-color: #667eea; }

/* ── Tab panels ────────────────────────────────────────────────────────────── */

.tx-ws-panel {
    padding: 20px;
    overflow-y: auto;
}

/* ── Documents tab ─────────────────────────────────────────────────────────── */

.tx-ws-doc-section { margin-bottom: 22px; }

.tx-ws-doc-section-title {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #555;
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tx-ws-doc-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

/* ── Bulk action bar ──────────────────────────────────────────────────────────── */
.tx-ws-bulk-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    background: rgba(102, 126, 234, 0.08);
    border: 1px solid rgba(102, 126, 234, 0.22);
    border-radius: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.tx-ws-bulk-count {
    font-size: 0.78rem;
    font-weight: 600;
    color: #b0b0d0;
    flex-shrink: 0;
}
.tx-ws-bulk-sep { font-size: 0.75rem; color: #444; flex-shrink: 0; }
.tx-ws-bulk-label {
    font-size: 0.74rem;
    color: #666;
    flex-shrink: 0;
    margin-right: 2px;
}
.tx-ws-bulk-status-btn {
    padding: 3px 10px;
    border-radius: 4px;
    border: 1px solid rgba(102, 126, 234, 0.35);
    background: rgba(102, 126, 234, 0.1);
    color: #aaa;
    font-size: 0.73rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.1s, color 0.1s, border-color 0.1s;
}
.tx-ws-bulk-status-btn:hover {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}
.tx-ws-bulk-clear-btn {
    margin-left: auto;
    padding: 2px 6px;
    border: none;
    background: none;
    color: #555;
    font-size: 0.82rem;
    cursor: pointer;
    flex-shrink: 0;
    line-height: 1;
}
.tx-ws-bulk-clear-btn:hover { color: #f87171; }

/* Checkbox for doc row bulk selection */
.tx-ws-doc-check {
    width: 14px;
    height: 14px;
    accent-color: #667eea;
    cursor: pointer;
    flex-shrink: 0;
}

.tx-ws-doc-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    background: #232336;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: background 0.15s;
}

.tx-ws-doc-item:hover { background: #2a2a42; }

.tx-ws-doc-icon {
    width: 34px;
    height: 34px;
    border-radius: 7px;
    background: rgba(102, 126, 234, 0.14);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.62rem;
    font-weight: 700;
    color: #a5b4fc;
    flex-shrink: 0;
    letter-spacing: 0;
}

.tx-ws-doc-info { flex: 1; min-width: 0; }

.tx-ws-doc-name {
    font-size: 0.84rem;
    color: #e0e0e0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tx-ws-doc-category {
    font-size: 0.68rem;
    color: #666;
    margin-top: 2px;
    text-transform: capitalize;
}

.tx-ws-doc-status {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 8px;
    border-radius: 20px;
    flex-shrink: 0;
}

.tx-ws-doc-status.status-pending         { background: rgba(156,163,175,0.14); color: #9ca3af; }
.tx-ws-doc-status.status-generated       { background: rgba(96,165,250,0.14);  color: #60a5fa; }
.tx-ws-doc-status.status-uploaded        { background: rgba(52,211,153,0.14);  color: #34d399; }
.tx-ws-doc-status.status-ready           { background: rgba(52,211,153,0.2);   color: #34d399; }
.tx-ws-doc-status.status-sent            { background: rgba(251,191,36,0.14);  color: #fbbf24; }
.tx-ws-doc-status.status-viewed          { background: rgba(251,191,36,0.2);   color: #f59e0b; }
.tx-ws-doc-status.status-partially_signed { background: rgba(251,146,60,0.14); color: #fb923c; }
.tx-ws-doc-status.status-signed          { background: rgba(52,211,153,0.24);  color: #10b981; }
.tx-ws-doc-status.status-archived        { background: rgba(107,114,128,0.14); color: #6b7280; }

/* ── Activity tab ──────────────────────────────────────────────────────────── */

.tx-ws-activity-feed {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tx-ws-activity-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

/* Legacy dot — kept for backward compat but no longer emitted */
.tx-ws-activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #667eea;
    margin-top: 5px;
    flex-shrink: 0;
}

/* Typed activity icon (replaces plain dot) */
.tx-ws-activity-icon {
    font-size: 0.72rem;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
    line-height: 1;
}

.tx-ws-activity-body { flex: 1; }

.tx-ws-activity-desc {
    font-size: 0.83rem;
    color: #ccc;
    line-height: 1.4;
}

.tx-ws-activity-meta {
    font-size: 0.68rem;
    color: #555;
    margin-top: 2px;
}

/* ── Notes tab ─────────────────────────────────────────────────────────────── */

.tx-ws-note-composer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 20px;
    margin-bottom: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 16px;
}

.tx-ws-note-input {
    width: 100%;
    min-height: 76px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 0.84rem;
    resize: vertical;
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color 0.15s;
}

.tx-ws-note-input:focus { outline: none; border-color: #667eea; }

.tx-ws-note-submit { align-self: flex-end; }

/* ── Dates tab ─────────────────────────────────────────────────────────────── */

.tx-ws-dates-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.tx-ws-date-card {
    padding: 14px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.tx-ws-date-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #555;
    margin-bottom: 6px;
}

.tx-ws-date-value {
    font-size: 0.88rem;
    color: #e0e0e0;
    font-weight: 500;
}

.tx-ws-date-value.empty {
    color: #444;
    font-style: italic;
    font-size: 0.78rem;
}

/* ── Tasks placeholder ─────────────────────────────────────────────────────── */

.tx-ws-tasks-placeholder {
    text-align: center;
    padding: 44px 20px;
    color: #555;
    font-size: 0.84rem;
}

/* ── Loading / empty ───────────────────────────────────────────────────────── */

.tx-ws-loading,
.tx-ws-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 50px 20px;
    color: #555;
    font-size: 0.84rem;
    text-align: center;
}

/* ── Theme: luxury ─────────────────────────────────────────────────────────── */

body[data-theme^="luxury"] #coordinatorWorkspaceView,
body[data-theme="luxury"]  #coordinatorWorkspaceView {
    background: var(--bg-surface, #0f0f1a);
}

body[data-theme^="luxury"] .tx-ws-header,
body[data-theme="luxury"] .tx-ws-header {
    background: var(--bg-card);
    border-bottom-color: var(--border-soft);
}

body[data-theme^="luxury"] .tx-ws-doc-item,
body[data-theme="luxury"] .tx-ws-doc-item,
body[data-theme^="luxury"] .tx-ws-date-card,
body[data-theme="luxury"] .tx-ws-date-card {
    background: var(--bg-card);
    border-color: var(--border-soft);
}

body[data-theme^="luxury"] .tx-ws-note-input,
body[data-theme="luxury"] .tx-ws-note-input {
    background: var(--control-bg);
    border-color: var(--control-border);
    color: var(--control-text);
}

body[data-theme^="luxury"] .tx-ws-stage-select,
body[data-theme="luxury"] .tx-ws-stage-select {
    background: var(--bg-card);
    border-color: var(--border-soft);
    color: var(--text-secondary);
}

/* ── Theme: deep-blue ──────────────────────────────────────────────────────── */

body[data-theme="deep-blue"] #coordinatorWorkspaceView {
    background: #050f2e;
}

body[data-theme="deep-blue"] .tx-ws-header {
    background: rgba(20, 40, 100, 0.9);
    border-bottom-color: rgba(59, 130, 246, 0.2);
}

body[data-theme="deep-blue"] .tx-ws-doc-item,
body[data-theme="deep-blue"] .tx-ws-date-card {
    background: rgba(30, 58, 138, 0.18);
    border-color: rgba(59, 130, 246, 0.15);
}

/* =============================================================================
   COORDINATOR — Phase C4: Document Lifecycle / Packet Manager
   ============================================================================= */

/* ── Packet summary bar ────────────────────────────────────────────────────── */

.tx-ws-packet-summary {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    margin-bottom: 18px;
    flex-wrap: wrap;
    min-height: 52px;
}

.tx-ws-packet-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 56px;
}

.tx-ws-packet-stat-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: #e0e0e0;
    line-height: 1;
}

.tx-ws-packet-stat-denom {
    font-size: 0.75rem;
    font-weight: 400;
    color: #666;
}

.tx-ws-packet-stat-label {
    font-size: 0.62rem;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 4px;
    white-space: nowrap;
}

.tx-ws-packet-stat.missing .tx-ws-packet-stat-value { color: #f87171; }
.tx-ws-packet-stat.signed  .tx-ws-packet-stat-value { color: #34d399; }

.tx-ws-packet-divider {
    width: 1px;
    height: 28px;
    background: rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.tx-ws-packet-empty-label {
    font-size: 0.82rem;
    color: #555;
}

.tx-ws-packet-add-btn {
    margin-left: auto;
    font-size: 0.73rem;
    padding: 6px 12px;
    border-radius: 7px;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.28);
    color: #a5b4fc;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}

.tx-ws-packet-add-btn:hover { background: rgba(102, 126, 234, 0.2); }
.tx-ws-packet-add-btn.open  { background: rgba(102, 126, 234, 0.06); color: #888; }

/* ── Missing doc highlight ─────────────────────────────────────────────────── */

.tx-ws-doc-item.doc-missing {
    border-color: rgba(248, 113, 113, 0.28);
    background: rgba(248, 113, 113, 0.04);
}

.tx-ws-doc-missing-badge {
    font-size: 0.63rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 8px;
    border-radius: 20px;
    background: rgba(248, 113, 113, 0.14);
    color: #f87171;
    flex-shrink: 0;
}

/* ── Per-doc actions + menu ────────────────────────────────────────────────── */

.tx-ws-doc-actions {
    position: relative;
    flex-shrink: 0;
    margin-left: 4px;
}

.tx-ws-doc-menu-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: none;
    border: 1px solid transparent;
    color: #555;
    cursor: pointer;
    font-size: 1rem;
    letter-spacing: 0.08em;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.tx-ws-doc-menu-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
}

.tx-ws-doc-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: #2a2a2a;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    min-width: 186px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    z-index: 200;
    overflow: hidden;
    padding: 6px 0;
}

.tx-ws-doc-menu-label {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #444;
    padding: 4px 12px 6px;
}

.tx-ws-doc-menu-item {
    padding: 7px 12px;
    font-size: 0.78rem;
    color: #bbb;
    cursor: pointer;
    transition: background 0.1s;
}

.tx-ws-doc-menu-item:hover   { background: rgba(255, 255, 255, 0.06); }
.tx-ws-doc-menu-item.current { color: #a5b4fc; font-weight: 500; }
.tx-ws-doc-menu-item.danger  { color: #f87171; }
.tx-ws-doc-menu-item.danger:hover { background: rgba(248, 113, 113, 0.08); }

.tx-ws-doc-menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.07);
    margin: 4px 0;
}

/* ── Add document panel ────────────────────────────────────────────────────── */

.tx-ws-add-doc-panel {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(102, 126, 234, 0.22);
    border-radius: 10px;
    margin-bottom: 18px;
    overflow: hidden;
}

.tx-ws-add-doc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.tx-ws-add-doc-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: #e0e0e0;
}

.tx-ws-add-doc-close {
    background: none;
    border: none;
    color: #555;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0 2px;
    line-height: 1;
    transition: color 0.12s;
}

.tx-ws-add-doc-close:hover { color: #e0e0e0; }

.tx-ws-add-doc-mode-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.tx-ws-add-doc-mode-tab {
    padding: 7px 14px;
    font-size: 0.73rem;
    color: #666;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color 0.12s, border-color 0.12s;
    margin-bottom: -1px;
}

.tx-ws-add-doc-mode-tab.active { color: #e0e0e0; border-bottom-color: #667eea; }

.tx-ws-add-doc-body { padding: 12px 14px; }

.tx-ws-add-doc-search {
    width: 100%;
    padding: 7px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 7px;
    color: #e0e0e0;
    font-size: 0.78rem;
    box-sizing: border-box;
    margin-bottom: 8px;
    font-family: inherit;
}

.tx-ws-add-doc-search:focus { outline: none; border-color: #667eea; }

.tx-ws-add-doc-form-list {
    max-height: 150px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 2px;
}

.tx-ws-add-doc-form-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    cursor: pointer;
    font-size: 0.77rem;
    color: #bbb;
    transition: background 0.12s, border-color 0.12s;
    user-select: none;
}

.tx-ws-add-doc-form-item:hover   { background: rgba(255, 255, 255, 0.04); }
.tx-ws-add-doc-form-item.selected {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    color: #e0e0e0;
}

.tx-ws-add-doc-form-icon { font-size: 0.62rem; font-weight: 700; min-width: 26px; text-align: center; opacity: 0.7; }
.tx-ws-add-doc-check     { margin-left: auto; color: #667eea; font-size: 0.78rem; }

/* Loading / empty message inside add-doc panel body */
.tx-ws-add-doc-state {
    font-size: 0.76rem;
    color: #555;
    padding: 6px 0;
}

/* Custom document name field */
.tx-ws-add-doc-field {
    margin-bottom: 8px;
}

.tx-ws-add-doc-field-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #666;
    margin-bottom: 5px;
}

.tx-ws-add-doc-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

#txWsAddDocConfirmBtn {
    padding: 7px 18px;
    font-size: 0.82rem;
    min-width: 0;
    width: auto;
}

.tx-ws-add-doc-required-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.73rem;
    color: #777;
    cursor: pointer;
    user-select: none;
}

/* ── Theme overrides (C4) ──────────────────────────────────────────────────── */

body[data-theme^="luxury"] .tx-ws-packet-summary,
body[data-theme="luxury"]  .tx-ws-packet-summary { background: var(--bg-card); }

body[data-theme^="luxury"] .tx-ws-add-doc-panel,
body[data-theme="luxury"]  .tx-ws-add-doc-panel  {
    background: var(--bg-card);
    border-color: var(--border-soft);
}

body[data-theme^="luxury"] .tx-ws-doc-menu,
body[data-theme="luxury"]  .tx-ws-doc-menu {
    background: var(--bg-card);
    border-color: var(--border-soft);
}

body[data-theme="deep-blue"] .tx-ws-packet-summary { background: rgba(30, 58, 138, 0.1); }
body[data-theme="deep-blue"] .tx-ws-add-doc-panel  {
    background: rgba(30, 58, 138, 0.08);
    border-color: rgba(59, 130, 246, 0.2);
}

/* =============================================================================
   COORDINATOR — Phase C5: Tasks + Dates
   ============================================================================= */

/* ── Tasks panel ─────────────────────────────────────────────────────────────── */

.tx-ws-tasks-header {
    display: flex;
    justify-content: flex-end;
    padding: 0 0 12px;
}

.tx-ws-add-task-btn {
    font-size: 0.78rem;
    padding: 5px 14px;
    width: auto;
    min-width: 0;
}

.tx-ws-tasks-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tx-ws-task-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.12s;
}

.tx-ws-task-row:hover { background: rgba(255, 255, 255, 0.07); }

.tx-ws-task-row.done { opacity: 0.5; }

.tx-ws-task-check {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.25);
    background: transparent;
    color: #4ade80;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.12s, background 0.12s;
    margin-top: 1px;
}

.tx-ws-task-row.done .tx-ws-task-check {
    background: rgba(74, 222, 128, 0.2);
    border-color: #4ade80;
}

.tx-ws-task-check:hover { border-color: #4ade80; }

.tx-ws-task-check--readonly {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: #4ade80;
    margin-top: 1px;
}

.tx-ws-task-body { flex: 1; min-width: 0; }

.tx-ws-task-title {
    font-size: 0.88rem;
    color: var(--text-primary, #e2e8f0);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tx-ws-task-row.done .tx-ws-task-title {
    text-decoration: line-through;
    color: var(--text-secondary, #94a3b8);
}

.tx-ws-task-due {
    font-size: 0.73rem;
    color: var(--text-secondary, #94a3b8);
    margin-top: 2px;
}

.tx-ws-task-due.overdue { color: #f87171; }

.tx-ws-task-row.overdue { border-color: rgba(248, 113, 113, 0.25); }

.tx-ws-tasks-done-group {
    margin-top: 12px;
    font-size: 0.8rem;
}

.tx-ws-tasks-done-group > summary {
    cursor: pointer;
    color: var(--text-secondary, #94a3b8);
    padding: 6px 0;
    user-select: none;
    list-style: none;
}

.tx-ws-tasks-done-group > summary::before { content: '▸ '; }
.tx-ws-tasks-done-group[open] > summary::before { content: '▾ '; }

/* ── New task form ─────────────────────────────────────────────────────────── */

.tx-ws-new-task-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 12px;
}

.tx-ws-new-task-input,
.tx-ws-new-task-due-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 7px 10px;
    color: var(--text-primary, #e2e8f0);
    font-size: 0.88rem;
    box-sizing: border-box;
}

.tx-ws-new-task-input:focus,
.tx-ws-new-task-due-input:focus {
    outline: none;
    border-color: rgba(96, 165, 250, 0.5);
}

.tx-ws-new-task-actions {
    display: flex;
    gap: 8px;
}

/* ── Dates panel (C5 editable) ────────────────────────────────────────────── */

.tx-ws-dates-toolbar {
    display: flex;
    justify-content: flex-end;
    padding: 0 0 12px;
}

.tx-ws-edit-dates-btn {
    font-size: 0.78rem;
    padding: 5px 14px;
    width: auto;
    min-width: 0;
}

.tx-ws-dates-edit-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tx-ws-dates-fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.tx-ws-date-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.tx-ws-date-field-label {
    font-size: 0.73rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary, #94a3b8);
    font-weight: 600;
}

.tx-ws-date-field-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 7px 10px;
    color: var(--text-primary, #e2e8f0);
    font-size: 0.85rem;
    width: 100%;
    box-sizing: border-box;
}

.tx-ws-date-field-input:focus {
    outline: none;
    border-color: rgba(96, 165, 250, 0.5);
}

.tx-ws-dates-edit-actions {
    display: flex;
    gap: 8px;
}

/* ── Loading state ────────────────────────────────────────────────────────── */

.tx-ws-loading {
    padding: 24px 0;
    color: var(--text-secondary, #94a3b8);
    font-size: 0.85rem;
    text-align: center;
}

/* =============================================================================
   COORDINATOR — Phase C6: Package Admin
   ============================================================================= */

/* ── Top bar ─────────────────────────────────────────────────────────────────── */

.pkg-admin-top-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: #1a1a2a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    margin-bottom: 20px;
}

#pkgNewBtn { width: auto; min-width: 0; }

.pkg-admin-title {
    flex: 1;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary, #e2e8f0);
    margin: 0;
}

/* ── Package list ─────────────────────────────────────────────────────────────── */

.pkg-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pkg-list-state {
    margin: 8px 0;
    padding: 40px 24px;
    text-align: center;
    color: #c0c8d8;
    font-size: 0.9rem;
    background: #242432;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

.pkg-card {
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #2a2a2a;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: background 0.12s, border-color 0.12s;
}

.pkg-card:hover { background: #323240; border-color: rgba(255, 255, 255, 0.18); }

.pkg-card-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pkg-card-name {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary, #e2e8f0);
}

.pkg-card-badges {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.pkg-badge {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 4px;
}

.pkg-badge-active   { background: rgba(74, 222, 128, 0.15); color: #4ade80; }
.pkg-badge-inactive { background: rgba(148, 163, 184, 0.12); color: #94a3b8; }
.pkg-badge-system   { background: rgba(96, 165, 250, 0.15); color: #60a5fa; }

.pkg-card-desc {
    font-size: 0.82rem;
    color: var(--text-secondary, #94a3b8);
    line-height: 1.4;
}

.pkg-card-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.pkg-meta-chip {
    font-size: 0.73rem;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary, #94a3b8);
}

.pkg-card-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    padding-top: 4px;
}

.pkg-btn-deactivate {
    background: rgba(248, 113, 113, 0.12);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.pkg-btn-deactivate:hover { background: rgba(248, 113, 113, 0.2); }

.pkg-readonly-label {
    font-size: 0.75rem;
    color: var(--text-secondary, #94a3b8);
    font-style: italic;
}

/* ── Package editor ───────────────────────────────────────────────────────────── */

.pkg-editor {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: #1e1e2c;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0 20px 20px;
}

.pkg-editor-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    margin-bottom: 0;
}

.pkg-editor-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #e2e8f0);
    margin: 0;
    flex: 1;
}

.pkg-editor-readonly-notice {
    margin: 12px 0 0;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    font-size: 0.82rem;
}

.pkg-editor-section {
    padding: 18px 0 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.pkg-editor-section:last-of-type { border-bottom: none; }

.pkg-editor-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.pkg-editor-section-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary, #94a3b8);
}

/* ── Info fields ──────────────────────────────────────────────────────────────── */

.pkg-editor-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pkg-field { display: flex; flex-direction: column; gap: 5px; }

.pkg-field-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.pkg-field-row .pkg-field { flex: 1; }

.pkg-field-checkbox {
    flex: 0 0 auto !important;
    padding-bottom: 4px;
}

.pkg-field-label {
    font-size: 0.73rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary, #94a3b8);
}

.pkg-field-input {
    background: #3a3a4a;
    border: 1px solid #4a4a5e;
    border-radius: 6px;
    padding: 8px 10px;
    color: #e2e8f0;
    font-size: 0.88rem;
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
}

.pkg-field-input::placeholder { color: #64748b; }

.pkg-field-input:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.6);
    background: #3e3e52;
}

.pkg-active-toggle {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.85rem;
    color: var(--text-primary, #e2e8f0);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

/* ── Form entries ─────────────────────────────────────────────────────────────── */

.pkg-forms-list, .pkg-tasks-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pkg-form-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.pkg-form-row-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    flex-wrap: wrap;
}

.pkg-form-key {
    font-size: 0.72rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(96, 165, 250, 0.1);
    color: #93c5fd;
    font-family: monospace;
    white-space: nowrap;
    flex-shrink: 0;
}

.pkg-form-name {
    font-size: 0.85rem;
    color: var(--text-primary, #e2e8f0);
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pkg-form-cat {
    font-size: 0.73rem;
    color: var(--text-secondary, #94a3b8);
    flex-shrink: 0;
}

.pkg-form-row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.pkg-required-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    color: var(--text-secondary, #94a3b8);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.pkg-remove-btn {
    background: transparent;
    border: none;
    color: rgba(248, 113, 113, 0.7);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 4px;
    line-height: 1;
    transition: color 0.12s, background 0.12s;
}

.pkg-remove-btn:hover {
    color: #f87171;
    background: rgba(248, 113, 113, 0.1);
}

.pkg-section-empty {
    padding: 12px 0 4px;
    font-size: 0.83rem;
    color: var(--text-secondary, #94a3b8);
    font-style: italic;
}

/* ── Add form panel ───────────────────────────────────────────────────────────── */

.pkg-add-form-panel {
    margin-bottom: 12px;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    overflow: hidden;
}

.pkg-add-form-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.pkg-add-mode-tab {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    background: transparent;
    border: none;
    color: var(--text-secondary, #94a3b8);
    cursor: pointer;
    transition: color 0.12s, background 0.12s;
}

.pkg-add-mode-tab.active {
    color: var(--text-primary, #e2e8f0);
    background: rgba(255, 255, 255, 0.05);
    font-weight: 600;
}

.pkg-add-mode-tab:hover:not(.active) { color: var(--text-primary, #e2e8f0); }

.pkg-add-form-search {
    width: 100%;
    box-sizing: border-box;
    background: #3a3a4a;
    border: none;
    border-bottom: 1px solid #4a4a5e;
    padding: 9px 14px;
    color: var(--text-primary, #e2e8f0);
    font-size: 0.85rem;
}

.pkg-add-form-search::placeholder { color: #64748b; }
.pkg-add-form-search:focus { outline: none; border-bottom-color: rgba(102, 126, 234, 0.6); }

.pkg-add-form-list {
    max-height: 200px;
    overflow-y: auto;
}

.pkg-add-form-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background 0.1s;
}

.pkg-add-form-item:hover { background: rgba(255, 255, 255, 0.06); }

.pkg-add-form-icon {
    font-size: 0.72rem;
    font-weight: 700;
    width: 30px;
    text-align: center;
    padding: 3px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 4px;
    color: var(--text-secondary, #94a3b8);
    flex-shrink: 0;
}

.pkg-add-form-item-info { flex: 1; min-width: 0; }

.pkg-add-form-item-name {
    font-size: 0.84rem;
    color: var(--text-primary, #e2e8f0);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pkg-add-form-item-cat {
    font-size: 0.72rem;
    color: var(--text-secondary, #94a3b8);
}

.pkg-add-custom-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
}

.pkg-add-custom-input {
    background: #3a3a4a;
    border: 1px solid #4a4a5e;
    border-radius: 6px;
    padding: 7px 10px;
    color: var(--text-primary, #e2e8f0);
    font-size: 0.85rem;
    width: 100%;
    box-sizing: border-box;
}

.pkg-add-custom-input::placeholder { color: #64748b; }
.pkg-add-custom-input:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.6);
    background: #3e3e52;
}

.pkg-add-form-footer {
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ── Task template rows ───────────────────────────────────────────────────────── */

.pkg-task-header-row {
    display: grid;
    grid-template-columns: 1fr 80px 1fr 1fr 28px;
    gap: 8px;
    padding: 0 4px 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary, #94a3b8);
}

.pkg-task-row {
    display: grid;
    grid-template-columns: 1fr 80px 1fr 1fr 28px;
    gap: 8px;
    align-items: center;
    padding: 6px 4px;
    border-radius: 6px;
}

.pkg-task-row:hover { background: rgba(255, 255, 255, 0.03); }

.pkg-task-input,
.pkg-task-offset,
.pkg-task-select {
    background: #333344;
    border: 1px solid #4a4a5e;
    border-radius: 5px;
    padding: 6px 8px;
    color: #e2e8f0;
    font-size: 0.82rem;
    width: 100%;
    box-sizing: border-box;
}

.pkg-task-input::placeholder { color: #64748b; }

.pkg-task-input:focus,
.pkg-task-offset:focus,
.pkg-task-select:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.55);
    background: #3a3a50;
}

.pkg-task-offset { text-align: center; }

/* ── Editor footer ────────────────────────────────────────────────────────────── */

.pkg-editor-footer {
    display: flex;
    gap: 10px;
    padding: 20px 0 8px;
}

/* ── Theme overrides (C6) ─────────────────────────────────────────────────────── */

body[data-theme^="luxury"] .pkg-card,
body[data-theme="luxury"]  .pkg-card    { background: var(--bg-card); border-color: var(--border-soft); }

body[data-theme^="luxury"] .pkg-add-form-panel,
body[data-theme="luxury"]  .pkg-add-form-panel { background: var(--bg-card); border-color: var(--border-soft); }

body[data-theme^="luxury"] .pkg-editor,
body[data-theme="luxury"]  .pkg-editor  { background: var(--bg-card); border-color: var(--border-soft); }

body[data-theme^="luxury"] .pkg-list-state,
body[data-theme="luxury"]  .pkg-list-state { background: var(--bg-card); border-color: var(--border-soft); color: var(--text-secondary, #94a3b8); }

body[data-theme^="luxury"] .pkg-field-input,
body[data-theme="luxury"]  .pkg-field-input,
body[data-theme^="luxury"] .pkg-task-input,
body[data-theme="luxury"]  .pkg-task-input,
body[data-theme^="luxury"] .pkg-task-offset,
body[data-theme="luxury"]  .pkg-task-offset,
body[data-theme^="luxury"] .pkg-task-select,
body[data-theme="luxury"]  .pkg-task-select,
body[data-theme^="luxury"] .pkg-add-form-search,
body[data-theme="luxury"]  .pkg-add-form-search,
body[data-theme^="luxury"] .pkg-add-custom-input,
body[data-theme="luxury"]  .pkg-add-custom-input { background: var(--bg-input, rgba(255,255,255,0.06)); border-color: var(--border-soft); }

body[data-theme="deep-blue"] .pkg-card { background: rgba(30, 58, 138, 0.08); border-color: rgba(59, 130, 246, 0.15); }
body[data-theme="deep-blue"] .pkg-add-form-panel { background: rgba(30, 58, 138, 0.06); border-color: rgba(59, 130, 246, 0.2); }
body[data-theme="deep-blue"] .pkg-editor  { background: rgba(20, 40, 100, 0.15); border-color: rgba(59, 130, 246, 0.12); }
body[data-theme="deep-blue"] .pkg-list-state { background: rgba(20, 40, 100, 0.1); border-color: rgba(59, 130, 246, 0.1); }
body[data-theme="deep-blue"] .pkg-field-input,
body[data-theme="deep-blue"] .pkg-task-input,
body[data-theme="deep-blue"] .pkg-task-offset,
body[data-theme="deep-blue"] .pkg-task-select,
body[data-theme="deep-blue"] .pkg-add-form-search,
body[data-theme="deep-blue"] .pkg-add-custom-input { background: rgba(30, 58, 138, 0.12); border-color: rgba(59, 130, 246, 0.2); }

/* =============================================================================
   COORDINATOR — Phase C7: Form Source Resolution Badges
   ============================================================================= */

/* ── Workspace document row — form source badge ───────────────────────────────── */

.tx-ws-form-source-badge {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 6px;
    vertical-align: middle;
    flex-shrink: 0;
}

.tx-ws-form-source-badge.mock {
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.25);
}

/* ── Package editor — form entry source badge ─────────────────────────────────── */

.pkg-form-source-badge {
    display: inline-block;
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 3px;
    flex-shrink: 0;
}

.pkg-form-source-badge.mock {
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.pkg-form-source-badge.library {
    background: rgba(96, 165, 250, 0.1);
    color: #60a5fa;
    border: 1px solid rgba(96, 165, 250, 0.2);
}

/* =============================================================================
   COORDINATOR — Polish Pass: Missing Stage Badges, Step Labels, UX Improvements
   ============================================================================= */

/* ── Wizard step label ────────────────────────────────────────────────────────── */

.tx-wizard-step-dots {
    display: flex;
    align-items: center;
    gap: 5px;
}

.tx-wizard-step-label {
    font-size: 0.72rem;
    color: #666;
    margin-top: 8px;
    letter-spacing: 0.01em;
}

/* ── Tasks panel — improved header + empty state ─────────────────────────────── */
/* Update existing .tx-ws-tasks-header layout to space-between for label + button */
.tx-ws-tasks-header { justify-content: space-between; align-items: center; }

.tx-ws-tasks-header-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary, #94a3b8);
    display: flex;
    align-items: center;
    gap: 6px;
}

.tx-ws-tasks-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: rgba(102, 126, 234, 0.2);
    color: #a5b4fc;
    font-size: 0.68rem;
    font-weight: 700;
}

.tx-ws-task-empty {
    text-align: center;
    padding: 36px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.tx-ws-task-empty-icon {
    font-size: 1.6rem;
    opacity: 0.4;
    line-height: 1;
}

.tx-ws-task-empty-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary, #94a3b8);
}

.tx-ws-task-empty-sub {
    font-size: 0.76rem;
    color: #555;
    max-width: 280px;
    line-height: 1.4;
}

/* ── Overdue task row — stronger emphasis ────────────────────────────────────── */

.tx-ws-task-row.overdue {
    border-color: rgba(248, 113, 113, 0.3);
    background: rgba(248, 113, 113, 0.04);
}

.tx-ws-task-row.overdue .tx-ws-task-title {
    color: #fca5a5;
}

/* ── Workspace stage select — labeled wrapper ────────────────────────────────── */

.tx-ws-stage-wrapper {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 4px 8px 4px 10px;
    flex-shrink: 0;
}

.tx-ws-stage-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #666;
    white-space: nowrap;
}

/* Override bare select inside wrapper — no double border */
.tx-ws-stage-wrapper .tx-ws-stage-select {
    background: transparent;
    border: none;
    padding: 0;
    font-size: 0.78rem;
    color: #ccc;
}

.tx-ws-stage-wrapper .tx-ws-stage-select:focus { outline: none; }

/* ── Dates toolbar — hint text ───────────────────────────────────────────────── */

/* Update existing .tx-ws-dates-toolbar to align space-between instead of flex-end */
.tx-ws-dates-toolbar { justify-content: space-between; }

.tx-ws-dates-toolbar-hint {
    font-size: 0.76rem;
    color: #555;
    font-style: italic;
}

/* (coordinator-no-match defined above in dashboard styles) */

/* ── Luxury theme — polish pass additions ────────────────────────────────────── */

body[data-theme^="luxury"] .tx-ws-task-empty-title,
body[data-theme="luxury"]  .tx-ws-task-empty-title {
    color: var(--text-secondary);
}

body[data-theme^="luxury"] .tx-ws-stage-wrapper,
body[data-theme="luxury"]  .tx-ws-stage-wrapper {
    background: var(--bg-card);
    border-color: var(--border-soft);
}

body[data-theme^="luxury"] .tx-ws-stage-wrapper .tx-ws-stage-select,
body[data-theme="luxury"]  .tx-ws-stage-wrapper .tx-ws-stage-select {
    color: var(--text-secondary);
}

/* ── Deep-blue theme — polish pass additions ─────────────────────────────────── */

body[data-theme="deep-blue"] .tx-ws-stage-wrapper {
    background: rgba(30, 58, 138, 0.12);
    border-color: rgba(59, 130, 246, 0.2);
}

/* ── Coordinator-specific csr-btn overrides ──────────────────────────────────── */

/* Compact selects inside task rows */
.pkg-task-row .csr-btn {
    padding: 5px 8px;
    font-size: 0.8rem;
    border-radius: 5px;
    background: #333344;
}

/* Dropdown opened from a renderCustomSelect (coordinator JS) */
.csr-btn > .coordinator-toolbar-dropdown {
    width: 100%;
    max-height: 220px;
    overflow-y: auto;
}

/* ── Stage custom dropdown button ───────────────────────────────────────────── */

.tx-ws-stage-btn {
    background: transparent;
    border: none;
    padding: 0;
    font-size: 0.78rem;
    color: #ccc;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.tx-ws-stage-btn:hover { color: #e0e0e0; }
.tx-ws-stage-btn:focus { outline: none; }

/* Read-only stage display for participant-only access */
.tx-ws-stage-btn--readonly {
    font-size: 0.8rem;
    font-weight: 600;
    color: #94a3b8;
    cursor: default;
}

body[data-theme^="luxury"] .tx-ws-stage-btn,
body[data-theme="luxury"]  .tx-ws-stage-btn { color: var(--text-secondary); }

body[data-theme="deep-blue"] .tx-ws-stage-btn { color: #93c5fd; }

/* ── Custom date picker popup ───────────────────────────────────────────────── */

.tx-dp-popup {
    background: #1e1e30;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 12px;
    width: 220px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    user-select: none;
}

.tx-dp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.tx-dp-month-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #c7d2fe;
    text-align: center;
    flex: 1;
}

.tx-dp-nav-btn {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
    transition: color 0.15s, background 0.15s;
}

.tx-dp-nav-btn:hover { color: #a5b4fc; background: rgba(99, 102, 241, 0.1); }

.tx-dp-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.tx-dp-day-header {
    font-size: 9px;
    color: #475569;
    text-align: center;
    padding: 2px 0;
    font-weight: 600;
    text-transform: uppercase;
}

.tx-dp-day {
    font-size: 11px;
    color: #64748b;
    text-align: center;
    padding: 4px 2px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    line-height: 1.2;
}

.tx-dp-day:hover { background: rgba(99, 102, 241, 0.18); color: #c7d2fe; }
.tx-dp-day.today { background: rgba(99, 102, 241, 0.25); color: #a5b4fc; font-weight: 700; }
.tx-dp-day.selected { background: rgba(99, 102, 241, 0.5); color: #e0e7ff; font-weight: 600; }
.tx-dp-day.other-month { color: #1e293b; pointer-events: none; }

.tx-dp-footer {
    margin-top: 8px;
    text-align: right;
}

.tx-dp-clear-btn {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 0.72rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.15s;
}

.tx-dp-clear-btn:hover { color: #f87171; }

/* ── Date picker trigger button ─────────────────────────────────────────────── */

.tx-dp-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 0.82rem;
    color: #ccc;
    cursor: pointer;
    text-align: left;
    box-sizing: border-box;
    transition: border-color 0.15s, background 0.15s;
}

.tx-dp-btn:hover { border-color: rgba(96, 165, 250, 0.5); background: rgba(255, 255, 255, 0.07); }
.tx-dp-btn:focus { outline: none; border-color: rgba(96, 165, 250, 0.5); }
.tx-dp-btn.placeholder { color: #555; }

/* =============================================================================
   COORDINATOR — Final Polish Pass
   ============================================================================= */

/* ── Participant-only notice bar (below tab bar) ─────────────────────────────── */

.tx-ws-participant-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background: rgba(102, 126, 234, 0.07);
    border-bottom: 1px solid rgba(102, 126, 234, 0.15);
    font-size: 0.78rem;
    color: #7b9ef8;
}

/* ── Error states in tab panels ──────────────────────────────────────────────── */

.tx-ws-error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 32px 20px;
    text-align: center;
}

.tx-ws-error-msg {
    font-size: 0.85rem;
    color: #f87171;
}

/* ── Task tab badge (pending + overdue counts) ───────────────────────────────── */

.tx-ws-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    font-size: 0.66rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.13);
    color: #aaa;
    margin-left: 5px;
    vertical-align: middle;
}

.tx-ws-tab-badge.overdue {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* ── Dates tab — clean empty state ──────────────────────────────────────────── */

.tx-ws-dates-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 40px 20px;
    text-align: center;
}

.tx-ws-dates-empty-icon {
    font-size: 2rem;
    opacity: 0.4;
}

.tx-ws-dates-empty-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #888;
}

.tx-ws-dates-empty-sub {
    font-size: 0.78rem;
    color: #666;
}

/* ── Dates tab — only show set dates in view mode ────────────────────────────── */

.tx-ws-dates-grid { flex-wrap: wrap; }

/* ── Participant chip on dashboard transaction cards ─────────────────────────── */

.coordinator-tx-participant-chip {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 7px;
    border-radius: 4px;
    background: rgba(102, 126, 234, 0.12);
    color: #7b9ef8;
    border: 1px solid rgba(102, 126, 234, 0.22);
    margin-left: auto;
}

/* =============================================================================
   Phase D1 — Dispatch tab + Draft Builder
   ============================================================================= */

/* ── Dispatch tab panel ──────────────────────────────────────────────────────── */

.tx-ws-dispatch-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 48px 24px;
    text-align: center;
}
.tx-ws-dispatch-empty-icon  { font-size: 2rem; opacity: 0.35; }
.tx-ws-dispatch-empty-title { font-size: 0.92rem; font-weight: 600; color: #888; }
.tx-ws-dispatch-empty-sub   { font-size: 0.78rem; color: #666; margin-bottom: 6px; }

.tx-ws-dispatch-new-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 6px;
    background: #667eea;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    transition: background 0.15s;
}
.tx-ws-dispatch-new-btn:hover { background: #7b91f5; }

.tx-ws-dispatch-toolbar {
    padding: 14px 20px 8px;
    display: flex;
    justify-content: flex-end;
}

.tx-ws-dispatch-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 20px 20px;
}

.tx-ws-dispatch-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 14px 16px;
}
.tx-ws-dispatch-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}
.tx-ws-dispatch-card-title { font-size: 0.88rem; font-weight: 600; color: #e0e0e0; }
.tx-ws-dispatch-card-meta  { font-size: 0.75rem; color: #777; display: flex; gap: 6px; }

.tx-ws-dispatch-status {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 8px;
    border-radius: 4px;
    flex-shrink: 0;
}
.dispatch-status-draft { background: rgba(255,255,255,0.08); color: #aaa; }
.dispatch-status-sent  { background: rgba(102,126,234,0.18); color: #7b9ef8; }
.dispatch-status-done  { background: rgba(52,211,153,0.15);  color: #34d399; }
.dispatch-status-void  { background: rgba(239,68,68,0.12);   color: #f87171; }

.tx-ws-dispatch-card-recips { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.tx-ws-dispatch-recip-row   { display: flex; align-items: center; gap: 8px; font-size: 0.78rem; }
.tx-ws-dispatch-recip-name  { color: #ccc; }
.tx-ws-dispatch-recip-role  { color: #888; font-size: 0.72rem; }
.tx-ws-dispatch-recip-more  { font-size: 0.72rem; color: #666; margin-top: 2px; }

/* ── Dispatch Builder modal ───────────────────────────────────────────────────── */

.dispatch-builder-modal {
    max-width: 560px;
    width: 100%;
}

.dispatch-builder-step-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-wrap: wrap;
}
.dbuild-step-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.08);
    color: #666;
    flex-shrink: 0;
}
.dbuild-step-dot.active { background: #667eea; color: #fff; }
.dbuild-step-dot.done   { background: rgba(52, 211, 153, 0.2); color: #34d399; }
.dbuild-step-label { font-size: 0.75rem; color: #666; }
.dbuild-step-label.active { color: #e0e0e0; font-weight: 600; }
.dbuild-step-sep   { font-size: 0.7rem; color: #444; margin: 0 2px; }

.dispatch-builder-body {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 60vh;
    overflow-y: auto;
}
.dispatch-builder-footer {
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    gap: 10px;
}

/* Step form fields */
.dbuild-field   { display: flex; flex-direction: column; gap: 6px; }
.dbuild-label   { font-size: 0.78rem; font-weight: 600; color: #aaa; }
.dbuild-optional { font-weight: 400; color: #666; }

.dbuild-input {
    width: 100%;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: #e0e0e0;
    font-size: 0.85rem;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s;
}
.dbuild-input:focus { border-color: #667eea; }
.dbuild-textarea    { min-height: 80px; resize: vertical; }
.dbuild-input-sm    { flex: 1; }

/* Step 2 — document list */
.dbuild-section-label  { font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #666; margin-top: 4px; }
.dbuild-inelig-header  { font-size: 0.72rem; color: #555; margin-top: 12px; margin-bottom: 4px; }
.dbuild-empty-note     { font-size: 0.8rem; color: #666; padding: 12px 0; }

.dbuild-doc-list { display: flex; flex-direction: column; gap: 4px; }
.dbuild-doc-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.07);
    cursor: pointer;
    transition: background 0.12s;
}
.dbuild-doc-item:hover:not(.ineligible) { background: rgba(255,255,255,0.05); }
.dbuild-doc-item.selected  { background: rgba(102,126,234,0.1); border-color: rgba(102,126,234,0.3); }
.dbuild-doc-item.ineligible { opacity: 0.4; cursor: default; }
.dbuild-doc-item input[type="checkbox"] { accent-color: #667eea; width: 15px; height: 15px; flex-shrink: 0; }
.dbuild-doc-icon  { font-size: 0.7rem; font-weight: 700; color: #888; flex-shrink: 0; min-width: 30px; text-align: center; }
.dbuild-doc-name  { flex: 1; font-size: 0.82rem; color: #ccc; }
.dbuild-doc-badge { font-size: 0.68rem; color: #666; flex-shrink: 0; }
.dbuild-doc-badge.muted { color: #444; }

/* Step 3 — recipients */
.dbuild-recip-list     { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.dbuild-recip-row      { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: rgba(255,255,255,0.04); border-radius: 6px; border: 1px solid rgba(255,255,255,0.07); }
.dbuild-recip-info     { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dbuild-recip-name     { font-size: 0.83rem; color: #ddd; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dbuild-recip-email    { font-size: 0.73rem; color: #777; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dbuild-recip-remove   { background: none; border: none; color: #666; cursor: pointer; font-size: 1rem; line-height: 1; padding: 2px 4px; flex-shrink: 0; }
.dbuild-recip-remove:hover { color: #f87171; }

/* Role pill toggle — replaces native <select> to avoid overflow-y:auto clipping in modal */
.dbuild-role-toggle {
    display: flex;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.12);
    flex-shrink: 0;
}
.dbuild-role-btn {
    background: none;
    border: none;
    border-right: 1px solid rgba(255,255,255,0.08);
    color: #777;
    font-size: 0.72rem;
    font-weight: 500;
    padding: 4px 8px;
    cursor: pointer;
    transition: background 0.1s, color 0.1s;
    white-space: nowrap;
}
.dbuild-role-btn:last-child { border-right: none; }
.dbuild-role-btn:hover { background: rgba(255,255,255,0.06); color: #ccc; }
.dbuild-role-btn.active { background: #667eea; color: #fff; }

.dbuild-suggest-list   { display: flex; flex-direction: column; gap: 4px; margin-bottom: 4px; }
.dbuild-suggest-item   { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: rgba(255,255,255,0.03); border-radius: 6px; border: 1px solid rgba(255,255,255,0.06); cursor: pointer; text-align: left; width: 100%; transition: background 0.12s; }
.dbuild-suggest-item:hover { background: rgba(102,126,234,0.08); border-color: rgba(102,126,234,0.2); }
.dbuild-suggest-name   { font-size: 0.82rem; color: #ccc; flex: 1; }
.dbuild-suggest-meta   { font-size: 0.72rem; color: #777; }
.dbuild-suggest-add    { font-size: 0.72rem; font-weight: 600; color: #667eea; flex-shrink: 0; }

.dbuild-manual-row     { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Step 4 — review */
.dbuild-review         { display: flex; flex-direction: column; gap: 14px; }
.dbuild-review-row     { display: flex; flex-direction: column; gap: 4px; }
.dbuild-review-label   { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #666; }
.dbuild-review-value   { font-size: 0.85rem; color: #ccc; }
.dbuild-review-list    { margin: 4px 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.dbuild-review-list li { font-size: 0.82rem; color: #ccc; }
.dbuild-review-notice  { font-size: 0.76rem; color: #666; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07); border-radius: 6px; padding: 10px 12px; margin-top: 4px; }

/* =============================================================================
   Phase D2 — Dispatch detail view + manual execution layer
   ============================================================================= */

/* ── Dispatch card clickable ─────────────────────────────────────────────────── */
.tx-ws-dispatch-card { cursor: pointer; transition: border-color 0.12s, background 0.12s; }
.tx-ws-dispatch-card:hover { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.14); }

/* ── Recipient status chips on list cards ────────────────────────────────────── */
.tx-ws-dispatch-recip-status { font-size: 0.65rem; font-weight: 700; padding: 1px 6px; border-radius: 3px; flex-shrink: 0; }
.dispatch-recip-pending  { background: rgba(255,255,255,0.07); color: #888; }
.dispatch-recip-sent     { background: rgba(102,126,234,0.15); color: #7b9ef8; }
.dispatch-recip-viewed   { background: rgba(168,85,247,0.15);  color: #c084fc; }
.dispatch-recip-signed   { background: rgba(52,211,153,0.15);  color: #34d399; }
.dispatch-recip-declined { background: rgba(239,68,68,0.12);   color: #f87171; }

/* ── Detail nav / back button ────────────────────────────────────────────────── */
.tx-ws-dispatch-detail-nav { padding: 12px 20px 0; }
.tx-ws-dispatch-back {
    background: none; border: none; color: #667eea; font-size: 0.8rem;
    cursor: pointer; padding: 0; font-weight: 600;
}
.tx-ws-dispatch-back:hover { color: #7b91f5; text-decoration: underline; }

/* ── Detail container ────────────────────────────────────────────────────────── */
.tx-ws-dispatch-detail {
    padding: 16px 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tx-ws-dispatch-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.tx-ws-dispatch-detail-title { font-size: 1rem; font-weight: 700; color: #e0e0e0; }
.tx-ws-dispatch-detail-meta  { font-size: 0.74rem; color: #666; display: flex; gap: 6px; flex-wrap: wrap; }
.tx-ws-dispatch-detail-notes {
    font-size: 0.82rem; color: #aaa;
    background: rgba(255,255,255,0.03); border-radius: 6px;
    padding: 10px 12px; border: 1px solid rgba(255,255,255,0.06);
    white-space: pre-wrap;
}

/* ── Section titles ──────────────────────────────────────────────────────────── */
.tx-ws-dispatch-section-title {
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.06em; color: #666; margin-top: 4px;
}
.tx-ws-dispatch-empty-section { font-size: 0.8rem; color: #555; padding: 6px 0; }

/* ── Detail action buttons ───────────────────────────────────────────────────── */
.tx-ws-dispatch-detail-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tx-ws-dispatch-action-btn {
    padding: 6px 14px; border-radius: 6px; border: none; cursor: pointer;
    font-size: 0.8rem; font-weight: 600; transition: opacity 0.15s;
}
.tx-ws-dispatch-action-btn:disabled { opacity: 0.5; cursor: default; }
.tx-ws-dispatch-action-btn.primary   { background: #667eea; color: #fff; }
.tx-ws-dispatch-action-btn.primary:hover { background: #7b91f5; }
.tx-ws-dispatch-action-btn.success   { background: rgba(52,211,153,0.2); color: #34d399; border: 1px solid rgba(52,211,153,0.3); }
.tx-ws-dispatch-action-btn.success:hover { background: rgba(52,211,153,0.3); }
.tx-ws-dispatch-action-btn.danger    { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.25); }
.tx-ws-dispatch-action-btn.danger:hover { background: rgba(239,68,68,0.25); }
.tx-ws-dispatch-action-btn.secondary { background: rgba(255,255,255,0.07); color: #aaa; border: 1px solid rgba(255,255,255,0.1); }
.tx-ws-dispatch-action-btn.secondary:hover { background: rgba(255,255,255,0.12); }
.tx-ws-dispatch-void-reason { font-size: 0.76rem; color: #f87171; margin-left: 4px; }

/* ── Void form ───────────────────────────────────────────────────────────────── */
.tx-ws-dispatch-void-form {
    display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
    padding: 10px 12px;
    background: rgba(239,68,68,0.06); border: 1px solid rgba(239,68,68,0.15); border-radius: 6px;
}
.tx-ws-dispatch-void-input {
    flex: 1; min-width: 160px; padding: 6px 10px; border-radius: 5px;
    border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.05);
    color: #e0e0e0; font-size: 0.82rem; outline: none;
}
.tx-ws-dispatch-void-input:focus { border-color: #f87171; }

/* ── Documents section in detail ─────────────────────────────────────────────── */
.tx-ws-dispatch-doc-list    { display: flex; flex-direction: column; gap: 6px; }
.tx-ws-dispatch-doc-row {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; background: rgba(255,255,255,0.03);
    border-radius: 6px; border: 1px solid rgba(255,255,255,0.06);
}
.tx-ws-dispatch-doc-icon  { font-size: 0.68rem; font-weight: 700; color: #888; min-width: 28px; text-align: center; flex-shrink: 0; }
.tx-ws-dispatch-doc-name  { flex: 1; font-size: 0.82rem; color: #ccc; }
.tx-ws-dispatch-doc-estatus {
    font-size: 0.65rem; font-weight: 700; padding: 1px 6px; border-radius: 3px; flex-shrink: 0;
    text-transform: lowercase;
}
.exstatus-none       { background: rgba(255,255,255,0.07); color: #666; }
.exstatus-in_dispatch { background: rgba(102,126,234,0.15); color: #7b9ef8; }
.exstatus-signed     { background: rgba(52,211,153,0.15); color: #34d399; }
.exstatus-voided     { background: rgba(239,68,68,0.12); color: #f87171; }

.tx-ws-dispatch-doc-action {
    padding: 3px 10px; border-radius: 5px; border: 1px solid rgba(102,126,234,0.3);
    background: rgba(102,126,234,0.1); color: #7b9ef8; font-size: 0.72rem; cursor: pointer;
    font-weight: 600; flex-shrink: 0; transition: background 0.12s;
}
.tx-ws-dispatch-doc-action:hover { background: rgba(102,126,234,0.2); }
.tx-ws-dispatch-doc-action.view  { border-color: rgba(52,211,153,0.3); background: rgba(52,211,153,0.08); color: #34d399; }
.tx-ws-dispatch-doc-action.view:hover { background: rgba(52,211,153,0.16); }

/* ── Recipients section in detail ────────────────────────────────────────────── */
.tx-ws-dispatch-recip-detail-list { display: flex; flex-direction: column; gap: 6px; }
.tx-ws-dispatch-recip-detail-row {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 8px 12px; background: rgba(255,255,255,0.03);
    border-radius: 6px; border: 1px solid rgba(255,255,255,0.06);
}
.tx-ws-dispatch-recip-detail-info { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.tx-ws-dispatch-recip-detail-name  { font-size: 0.85rem; color: #ddd; font-weight: 600; }
.tx-ws-dispatch-recip-detail-role  { font-size: 0.72rem; color: #777; }
.tx-ws-dispatch-recip-detail-email { font-size: 0.72rem; color: #666; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-ws-dispatch-recip-detail-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.tx-ws-dispatch-recip-action {
    padding: 3px 8px; border-radius: 4px; border: 1px solid rgba(102,126,234,0.3);
    background: rgba(102,126,234,0.08); color: #7b9ef8; font-size: 0.7rem; cursor: pointer;
    font-weight: 600; transition: background 0.12s;
}
.tx-ws-dispatch-recip-action:hover { background: rgba(102,126,234,0.18); }
.tx-ws-dispatch-recip-action.danger { border-color: rgba(239,68,68,0.25); background: rgba(239,68,68,0.07); color: #f87171; }
.tx-ws-dispatch-recip-action.danger:hover { background: rgba(239,68,68,0.16); }

/* ── Audit trail events ──────────────────────────────────────────────────────── */
.tx-ws-dispatch-events   { display: flex; flex-direction: column; gap: 4px; }
.tx-ws-dispatch-event-row {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.76rem; padding: 4px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.tx-ws-dispatch-event-type  { color: #aaa; flex: 1; text-transform: capitalize; }
.tx-ws-dispatch-event-actor { color: #777; }
.tx-ws-dispatch-event-ts    { color: #555; flex-shrink: 0; }

/* ── D3: Recipient timestamps ────────────────────────────────────────────────── */
.tx-ws-recip-ts          { font-size: 0.68rem; color: #666; }
.tx-ws-recip-ts-signed   { color: #34d399; }
.tx-ws-recip-ts-declined { color: #f87171; }

/* ── D3: Portal link + remind buttons ───────────────────────────────────────── */
.tx-ws-dispatch-recip-portal-btn,
.tx-ws-dispatch-recip-remind-btn {
    padding: 3px 8px; border-radius: 4px; font-size: 0.7rem; font-weight: 600;
    cursor: pointer; transition: background 0.12s; white-space: nowrap;
}
.tx-ws-dispatch-recip-portal-btn {
    border: 1px solid rgba(99,102,241,0.3);
    background: rgba(99,102,241,0.08);
    color: #a5b4fc;
}
.tx-ws-dispatch-recip-portal-btn:hover:not(:disabled) { background: rgba(99,102,241,0.18); }
.tx-ws-dispatch-recip-remind-btn {
    border: 1px solid rgba(251,191,36,0.25);
    background: rgba(251,191,36,0.07);
    color: #fbbf24;
}
.tx-ws-dispatch-recip-remind-btn:hover:not(:disabled) { background: rgba(251,191,36,0.15); }
.tx-ws-dispatch-recip-portal-btn:disabled,
.tx-ws-dispatch-recip-remind-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── D4-B: Signing Packet section ────────────────────────────────────────── */
.tx-ws-dispatch-packet-section {
    padding: 10px 0 4px;
}
.tx-ws-packet-gen-state {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.tx-ws-packet-gen-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}
.tx-ws-packet-gen-badge {
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(99,102,241,0.18);
    color: #818cf8;
    border: 1px solid rgba(99,102,241,0.3);
    border-radius: 4px;
    padding: 1px 7px;
    white-space: nowrap;
}
.tx-ws-packet-gen-label {
    font-size: 0.82rem;
    color: var(--text-muted, #94a3b8);
}
.tx-ws-packet-gen-failed {
    color: #f87171;
}
.tx-ws-packet-gen-skipped {
    font-size: 0.75rem;
    color: #fbbf24;
}
.tx-ws-packet-gen-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.tx-ws-packet-gen-btn {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    background: #6366f1;
    color: #fff;
    transition: background 0.15s;
    white-space: nowrap;
}
.tx-ws-packet-gen-btn:hover:not(:disabled) { background: #4f46e5; }
.tx-ws-packet-gen-btn.view {
    background: rgba(52,211,153,0.15);
    color: #34d399;
    border: 1px solid rgba(52,211,153,0.3);
}
.tx-ws-packet-gen-btn.view:hover:not(:disabled) { background: rgba(52,211,153,0.25); }
.tx-ws-packet-gen-btn.secondary {
    background: var(--surface2, #1e293b);
    color: var(--text-muted, #94a3b8);
    border: 1px solid var(--border, #334155);
}
.tx-ws-packet-gen-btn.secondary:hover:not(:disabled) { background: var(--surface3, #334155); }
.tx-ws-packet-gen-btn:disabled { opacity: 0.5; cursor: not-allowed; }
