/* ═══════════════════════════════════════════════════════════════
   BAS Portal — Component Styles
   Shared building blocks used by the JS-rendered widgets on the
   dashboard, project page and video review page.
   ═══════════════════════════════════════════════════════════════ */

/* ── Flash / Notice Messages ─────────────────────────────────── */
.bas-component-message {
    padding: 12px 16px;
    margin: 0 0 16px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: #eef3f8;
    color: #243142;
    font-size: 13px;
}
.bas-component-message-success { background: #e8f7ee; color: #176b38; border-color: #bfe3cc; }
.bas-component-message-error { background: #fdeced; color: #a3202a; border-color: #f3c4c9; }

/* ── Component Card ──────────────────────────────────────────── */
.bas-component-card { margin-bottom: 24px; }
.bas-component-card .bas-card-body { padding: 20px; }

/* ── Inline Forms (comment, upload, task create) ─────────────── */
.bas-inline-form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    padding: 16px;
    margin-bottom: 18px;
    background: #f7f8fa;
    border: 1px solid #e3e7eb;
    border-radius: 10px;
}
.bas-inline-form textarea {
    width: 100%;
    resize: vertical;
    min-height: 74px;
}
.bas-inline-form input,
.bas-inline-form select,
.bas-inline-form textarea,
.bas-profile-form input,
.bas-task-status,
.bas-status-editor select {
    border: 1px solid #ccd3da;
    border-radius: 8px;
    padding: 9px 12px;
    background: #fff;
    font-size: 13.5px;
    color: #24282a;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.bas-inline-form input:focus,
.bas-inline-form select:focus,
.bas-inline-form textarea:focus,
.bas-profile-form input:focus,
.bas-task-status:focus,
.bas-status-editor select:focus {
    border-color: #800033;
    box-shadow: 0 0 0 3px rgba(128, 0, 51, 0.08);
    outline: none;
}
.bas-inline-form progress {
    width: 100%;
    accent-color: #800033;
}

/* ── Comment Threads (project page) ──────────────────────────── */
.bas-thread-layout {
    display: grid;
    grid-template-columns: minmax(280px, 42%) 1fr;
    gap: 18px;
}
.bas-thread-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.bas-thread-summary {
    width: 100%;
    display: grid;
    grid-template-columns: 58px 1fr auto;
    gap: 12px;
    align-items: start;
    text-align: left;
    padding: 13px 14px;
    border: 1px solid #e0e4e8;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.bas-thread-summary:hover {
    border-color: #800033;
    box-shadow: 0 3px 10px rgba(38, 45, 54, 0.08);
}
.bas-thread-time {
    font-weight: 800;
    color: #800033;
    font-variant-numeric: tabular-nums;
}
.bas-thread-copy,
.bas-thread-state {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.bas-thread-copy strong { font-size: 13px; color: #24282a; }
.bas-thread-copy span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12.5px;
    color: #697176;
}
.bas-thread-state { align-items: flex-end; }
.bas-thread-state small { font-size: 11px; color: #697176; }

.bas-thread-detail {
    min-height: 230px;
    padding: 18px;
    border: 1px solid #e0e4e8;
    border-radius: 12px;
    background: #fafbfc;
}
.bas-thread-detail-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.bas-thread-detail-head > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.bas-thread-detail-head strong { font-size: 13.5px; color: #24282a; }
.bas-thread-detail-head span { font-size: 12px; color: #697176; }
.bas-thread-close {
    border: 0;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #697176;
    padding: 0 4px;
}
.bas-thread-close:hover { color: #a3202a; }

.bas-thread-original {
    padding: 14px;
    background: #fff;
    border-left: 3px solid #800033;
    border-radius: 8px;
}
.bas-thread-original img {
    display: block;
    width: 100%;
    max-height: 260px;
    object-fit: contain;
    margin: 10px 0;
    background: #111;
    border-radius: 6px;
}
.bas-thread-original p { margin: 8px 0 0; font-size: 13.5px; color: #24282a; }
.bas-thread-original small { display: block; margin-top: 8px; color: #697176; font-size: 12px; }

.bas-replies {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 14px 0;
}
.bas-reply {
    padding: 11px 14px;
    border-radius: 9px;
    background: #fff;
    border: 1px solid #e5e7ea;
}
.bas-reply strong,
.bas-reply span { display: block; }
.bas-reply strong { font-size: 12.5px; color: #24282a; }
.bas-reply span { font-size: 11.5px; color: #697176; }
.bas-reply p { margin: 6px 0 0; font-size: 13px; color: #33383b; }

.bas-reply-form {
    margin-top: 6px;
}
.bas-reply-form textarea {
    width: 100%;
    margin-bottom: 10px;
    min-height: 64px;
    border: 1px solid #ccd3da;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13.5px;
    resize: vertical;
}
.bas-reply-form textarea:focus {
    border-color: #800033;
    box-shadow: 0 0 0 3px rgba(128, 0, 51, 0.08);
    outline: none;
}

/* ── Comment Status Editor ───────────────────────────────────── */
.bas-status-editor {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 12px 0;
    padding: 10px 12px;
    border: 1px solid #e5e7ea;
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    color: #33383b;
}

/* ── Correction Round (inline banner) ────────────────────────── */
.bas-correction-inline {
    display: flex;
    gap: 18px;
    align-items: center;
    flex-wrap: wrap;
    padding: 12px 16px;
    margin-bottom: 16px;
    border-radius: 10px;
    border: 1px solid #ead19a;
    background: #fff7e8;
    font-size: 13px;
    color: #33383b;
}
.bas-correction-inline strong { color: #800033; }

/* ── Lists (files, tasks, versions, notifications) ───────────── */
.bas-file-list,
.bas-task-list,
.bas-version-list,
.bas-notification-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.bas-file-list .bas-empty,
.bas-task-list .bas-empty,
.bas-version-list .bas-empty,
.bas-notification-list .bas-empty { padding: 32px 16px; }

.bas-file-row,
.bas-task-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 16px;
    border: 1px solid #e1e5e9;
    border-radius: 10px;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.bas-file-row:hover,
.bas-task-row:hover {
    border-color: #c9cdd1;
    box-shadow: 0 3px 10px rgba(29, 35, 37, 0.06);
}

.bas-file-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 40px;
    border-radius: 8px;
    background: #f0e4e9;
    color: #800033;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}

.bas-file-copy,
.bas-task-copy {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}
.bas-file-copy strong,
.bas-task-copy strong {
    font-size: 13.5px;
    color: #24282a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bas-file-copy small,
.bas-task-copy small { color: #697176; font-size: 12px; }
.bas-file-copy span { color: #33383b; font-size: 12.5px; }

.bas-task-priority {
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #f0f1f2;
    color: #697176;
    flex-shrink: 0;
}
.bas-task-priority-high { background: #fff4da; color: #a36a00; }
.bas-task-priority-critical { background: #fdeced; color: #a3202a; }
.bas-task-priority-low { background: #eef3f8; color: #315b7d; }

.bas-task-status {
    cursor: pointer;
    min-height: 34px;
}

/* ── Notification Rows (dashboard panel) ─────────────────────── */
.bas-notification-row {
    display: grid;
    grid-template-columns: 10px 1fr;
    gap: 12px;
    text-align: left;
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #e1e5e9;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.bas-notification-row:hover {
    border-color: #d7a7bb;
    background: #fffafc;
    box-shadow: 0 3px 10px rgba(128, 0, 51, 0.07);
    transform: translateY(-1px);
}
.bas-notification-row.is-unread:hover {
    border-color: #cf93ad;
    background: #fdf1f6;
}
.bas-notification-row > span:last-child {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.bas-notification-row strong {
    font-size: 13px;
    color: #24282a;
}
.bas-notification-row > span:last-child > span {
    font-size: 12.5px;
    color: #697176;
}
.bas-notification-row small {
    color: #697176;
    font-size: 11.5px;
}
.bas-notification-dot {
    width: 8px;
    height: 8px;
    margin-top: 6px;
    border-radius: 50%;
    background: #ccd3da;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}
.bas-notification-row.is-unread {
    background: #fff8fb;
    border-color: #d7a7bb;
}
.bas-notification-row.is-unread .bas-notification-dot {
    background: #800033;
    box-shadow: 0 0 0 3px rgba(128, 0, 51, 0.12);
}
.bas-notification-row .button { flex-shrink: 0; }

/* “Mark all as read” action in the notification card head */
.bas-card-head .bas-mark-all-read,
.bas-notifications .bas-mark-all-read {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 30px;
    padding: 4px 12px;
    border: 1px solid #d9dcdf;
    border-radius: 8px;
    background: #fff;
    color: #697176;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.bas-card-head .bas-mark-all-read:hover,
.bas-notifications .bas-mark-all-read:hover {
    border-color: #800033;
    color: #800033;
    background: #fdf6f9;
    box-shadow: 0 2px 6px rgba(128, 0, 51, 0.08);
}
.bas-card-head .bas-mark-all-read:disabled,
.bas-notifications .bas-mark-all-read:disabled {
    opacity: 0.55;
    cursor: default;
    box-shadow: none;
}

/* ── Profile ─────────────────────────────────────────────────── */
.bas-profile-header {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 22px;
    padding: 18px;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    background: #fafbfc;
}
.bas-profile-header img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
}
.bas-profile-header > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.bas-profile-header strong { font-size: 16px; color: #24282a; }
.bas-profile-header span { font-size: 12.5px; color: #697176; }

.bas-profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.bas-profile-grid label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 600;
    font-size: 12.5px;
    color: #33383b;
}
.bas-profile-grid input {
    font-weight: 400;
    min-height: 40px;
}
.bas-profile-grid input:disabled {
    background: #f4f5f6;
    color: #697176;
}

/* ── Project Workspace (Logistikzentrum page) ────────────────── */
.bas-project-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #e1e5e9;
}

/* Secondary action buttons (Videos / Kommentare / Dateien / Aufgaben) */
.bas-project-actions a.button:not(.bas-btn-primary),
.bas-project-actions button.button:not(.bas-btn-primary) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 18px;
    border: 1px solid #d9dcdf;
    border-radius: 8px;
    background: #fff;
    color: #24282a;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: none;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.bas-project-actions a.button:not(.bas-btn-primary):hover,
.bas-project-actions button.button:not(.bas-btn-primary):hover {
    border-color: #800033;
    color: #800033;
    background: #fff;
}

/* Project detail fields */
.bas-field-group {
    margin: 0 0 20px;
    padding: 0 0 18px;
    border-bottom: 1px solid #eef0f2;
}
.bas-field-group:last-child { border-bottom: none; }
.bas-field-group h4 {
    margin: 0 0 12px;
    font-size: 11.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #697176;
}
.bas-field-group p {
    margin: 0;
    font-size: 13.5px;
    color: #33383b;
    line-height: 1.65;
}
.bas-field-item {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 8px 0;
    font-size: 13.5px;
}
.bas-field-label {
    flex: 0 0 190px;
    font-size: 12.5px;
    font-weight: 600;
    color: #697176;
}
.bas-field-value {
    flex: 1;
    min-width: 0;
    color: #24282a;
    word-break: break-word;
}

/* Correction round summary */
.bas-correction-summary {
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
    padding: 18px;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    background: #fafbfc;
}
.bas-correction-counter {
    font-size: 30px;
    font-weight: 800;
    color: #800033;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}
.bas-correction-label {
    font-size: 12px;
    color: #697176;
    margin-bottom: 8px;
}
.bas-correction-bar {
    width: 260px;
    max-width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #e3e7eb;
    overflow: hidden;
}
.bas-correction-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #800033, #c2577f);
}

/* Final approval */
.bas-approval-status {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 18px;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    background: #fafbfc;
}
.bas-approval-icon {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    font-size: 22px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e1e5e9;
}
.bas-approval-text {
    flex: 1;
    min-width: 200px;
    font-size: 14px;
    font-weight: 600;
    color: #24282a;
}
.bas-approval-text small {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    font-weight: 400;
    color: #697176;
}
.bas-approval-btn {
    margin-left: auto;
}

/* Activity timeline (project page) */
.bas-activity-list {
    display: flex;
    flex-direction: column;
    padding: 2px 0;
}
.bas-activity-item {
    display: flex;
    gap: 14px;
    padding: 0 0 18px;
    position: relative;
}
.bas-activity-item::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 16px;
    bottom: 0;
    width: 2px;
    background: #e3e7eb;
    border-radius: 1px;
}
.bas-activity-item:last-child { padding-bottom: 0; }
.bas-activity-item:last-child::before { display: none; }
.bas-activity-dot {
    position: relative;
    z-index: 1;
    width: 12px;
    height: 12px;
    margin-top: 3px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #800033;
    box-shadow: 0 0 0 4px rgba(128, 0, 51, 0.1);
}
.bas-activity-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.bas-activity-text {
    font-size: 13.5px;
    color: #24282a;
    line-height: 1.5;
}
.bas-activity-time {
    font-size: 11.5px;
    color: #697176;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 800px) {
    .bas-thread-layout { grid-template-columns: 1fr; }
    .bas-thread-summary { grid-template-columns: 52px 1fr; }
    .bas-thread-state { grid-column: 2; align-items: flex-start; }
    .bas-profile-grid { grid-template-columns: 1fr; }
    .bas-file-row,
    .bas-task-row,
    .bas-version-item { align-items: flex-start; flex-wrap: wrap; }
    .bas-field-item { flex-direction: column; gap: 2px; }
    .bas-field-label { flex-basis: auto; }
    .bas-approval-btn { margin-left: 0; width: 100%; }
}
/* ═══════════════════════════════════════════════════════════════
   Project page right rail — Korrekturschleifen / Finale Freigabe /
   Aktivität: flattened, aligned, consistent with the portal cards.
   ═══════════════════════════════════════════════════════════════ */
.bas-dashboard-shell .bas-correction-summary {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
}
.bas-dashboard-shell .bas-correction-counter {
    min-width: 70px;
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1;
    background: linear-gradient(120deg, #800033, #b0205c);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #800033;
}
.bas-dashboard-shell .bas-correction-label {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.5;
    color: #697176;
}
.bas-dashboard-shell .bas-correction-bar {
    width: 100%;
    margin-top: 16px;
}
.bas-dashboard-shell .bas-correction-bar-fill {
    background: linear-gradient(90deg, #800033, #c2577f);
}

/* Guarantee even left/right padding for these widget bodies on every
   page layout — some renders drop the .bas-card-body wrapper. */
.bas-dashboard-shell .bas-widget > .bas-card {
    padding: 0;
}
.bas-dashboard-shell .bas-widget .bas-card-head {
    padding-left: 20px;
    padding-right: 20px;
}
.bas-dashboard-shell .bas-widget .bas-card-body,
.bas-dashboard-shell .bas-widget > .bas-card > .bas-correction-summary,
.bas-dashboard-shell .bas-widget > .bas-card > .bas-approval-status {
    padding-left: 20px;
    padding-right: 20px;
}

/* Final approval */
.bas-dashboard-shell .bas-approval-status {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: nowrap;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
}
.bas-dashboard-shell .bas-approval-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 13px;
    border: 1px solid rgba(36, 40, 42, .08);
    background: linear-gradient(160deg, #faf7f9, #f3ecef);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}
.bas-dashboard-shell .bas-approval-icon img {
    width: 21px;
    height: 21px;
}
.bas-dashboard-shell .bas-approval-text {
    flex: 1;
    min-width: 0;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.45;
    color: #24282a;
}
.bas-dashboard-shell .bas-approval-text small {
    margin-top: 3px;
    font-size: 12px;
    font-weight: 400;
    color: #697176;
}
.bas-dashboard-shell .bas-approval-btn {
    margin-left: auto;
    flex-shrink: 0;
}

/* Activity timeline */
.bas-dashboard-shell .bas-activity-list {
    gap: 0;
    max-height: 360px;
    overflow-y: auto;
    padding: 4px 6px 4px 2px;
    scrollbar-width: thin;
    scrollbar-color: #d9dcdf transparent;
}
.bas-dashboard-shell .bas-activity-list::-webkit-scrollbar { width: 5px; }
.bas-dashboard-shell .bas-activity-list::-webkit-scrollbar-thumb {
    background: #d9dcdf;
    border-radius: 4px;
}
.bas-dashboard-shell .bas-activity-item {
    gap: 13px;
    padding: 0 0 16px;
}
.bas-dashboard-shell .bas-activity-item::before {
    left: 4px;
    top: 15px;
    width: 2px;
    background: linear-gradient(180deg, rgba(128, 0, 51, .22), rgba(128, 0, 51, .06));
}
.bas-dashboard-shell .bas-activity-dot {
    width: 10px;
    height: 10px;
    margin-top: 4px;
    background: linear-gradient(160deg, #b0205c, #800033);
    box-shadow: 0 0 0 4px rgba(128, 0, 51, .1);
}
.bas-dashboard-shell .bas-activity-content { gap: 2px; }
.bas-dashboard-shell .bas-activity-text {
    font-size: 13px;
    line-height: 1.5;
    color: #2c3134;
}
.bas-dashboard-shell .bas-activity-time {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .02em;
    color: #8b9296;
}

/* ═══════════════════════════════════════════════════════════════
   Review Comments — composer, correction banner & thread panels
   (project page / dashboard "Kommentare & Review-Threads")
   ═══════════════════════════════════════════════════════════════ */

/* ── Comment composer ────────────────────────────────────────── */
.bas-comment-create {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px;
    margin-bottom: 18px;
    background: #fff;
    border: 1px solid #e2e6e9;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(16, 24, 32, .04);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.bas-comment-create:focus-within {
    border-color: #800033;
    box-shadow: 0 0 0 3px rgba(128, 0, 51, .08);
}
.bas-comment-create textarea {
    width: 100%;
    min-height: 78px;
    margin: 0;
    padding: 11px 13px;
    border: 1px solid #e0e4e8;
    border-radius: 10px;
    background: #fbfcfd;
    font-size: 13.5px;
    line-height: 1.55;
    color: #24282a;
    resize: vertical;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.bas-comment-create textarea::placeholder { color: #9aa1a6; }
.bas-comment-create textarea:focus {
    outline: none;
    background: #fff;
    border-color: #800033;
    box-shadow: 0 0 0 3px rgba(128, 0, 51, .08);
}
.bas-comment-create .button,
.bas-comment-create .bas-btn,
.bas-comment-create .bas-btn-primary {
    align-self: flex-end;
    min-height: 36px;
}

/* ── Correction-round banner ─────────────────────────────────── */
.bas-correction-inline {
    display: flex;
    align-items: center;
    gap: 10px 20px;
    flex-wrap: wrap;
    padding: 12px 16px;
    margin-bottom: 18px;
    border-radius: 12px;
    border: 1px solid #ecd6a2;
    background: linear-gradient(180deg, #fffaf0, #fff6e3);
    font-size: 13px;
    color: #4f4637;
}
.bas-correction-inline > span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.bas-correction-inline strong {
    color: #800033;
    font-size: 13.5px;
}
.bas-correction-inline > span + span {
    font-weight: 600;
    color: #a36a00;
}
.bas-correction-inline > span + span::before {
    content: "";
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #d9b06a;
}
.bas-correction-inline .bas-submit-round {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 7px 15px;
    border: 1px solid #800033;
    border-radius: 8px;
    background: #800033;
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: none;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.bas-correction-inline .bas-submit-round:hover {
    background: #a02050;
    border-color: #a02050;
    box-shadow: 0 4px 10px rgba(128, 0, 51, .18);
}
.bas-correction-inline .bas-submit-round:disabled {
    opacity: .55;
    cursor: default;
    box-shadow: none;
}

/* ── Thread layout ───────────────────────────────────────────── */
.bas-thread-layout {
    display: grid;
    grid-template-columns: minmax(280px, 40%) 1fr;
    gap: 18px;
    align-items: start;
}
.bas-thread-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
    min-width: 0;
}

/* Thread summary card */
.bas-thread-summary {
    width: 100%;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
    text-align: left;
    padding: 12px 14px;
    border: 1px solid #e3e7ea;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(16, 24, 32, .03);
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease, background .15s ease;
}
.bas-thread-summary:hover {
    border-color: #d7a7bb;
    background: #fffafc;
    box-shadow: 0 3px 10px rgba(128, 0, 51, .07);
    transform: translateY(-1px);
}
.bas-thread-summary.active {
    border-color: #800033;
    background: #fcf6f9;
    box-shadow: inset 0 0 0 1px rgba(128, 0, 51, .06), 0 4px 12px rgba(128, 0, 51, .09);
}
.bas-thread-time {
    font-size: 11.5px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: .02em;
    color: #800033;
    background: #f7eaf0;
    border: 1px solid #eed6e0;
    border-radius: 7px;
    padding: 4px 8px;
    line-height: 1.2;
    white-space: nowrap;
}
.bas-thread-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.bas-thread-copy strong {
    font-size: 13px;
    font-weight: 600;
    color: #24282a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bas-thread-copy > span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12.5px;
    color: #697176;
}
.bas-thread-state {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    min-width: 0;
}
.bas-thread-state small {
    font-size: 11px;
    color: #8b9296;
    white-space: nowrap;
}

/* Colored status badges (data-status added to each summary) */
.bas-thread-summary[data-status="open"] .bas-badge,
.bas-thread-original[data-status="open"] .bas-badge {
    background: #fbe9ec; color: #9d2636; border-color: #f0c2cb;
}
.bas-thread-summary[data-status="clarification_required"] .bas-badge,
.bas-thread-original[data-status="clarification_required"] .bas-badge {
    background: #fff4da; color: #a36a00; border-color: #ead19a;
}
.bas-thread-summary[data-status="in_progress"] .bas-badge,
.bas-thread-original[data-status="in_progress"] .bas-badge {
    background: #eaf1f7; color: #315b7d; border-color: #c6dbea;
}
.bas-thread-summary[data-status="implemented"] .bas-badge,
.bas-thread-original[data-status="implemented"] .bas-badge,
.bas-thread-summary[data-status="resolved"] .bas-badge,
.bas-thread-original[data-status="resolved"] .bas-badge {
    background: #e9f4ee; color: #267a4b; border-color: #bedcc9;
}
.bas-thread-summary[data-status="closed"] .bas-badge,
.bas-thread-original[data-status="closed"] .bas-badge {
    background: #f0f1f2; color: #5f666b; border-color: #d9dcdf;
}

/* ── Thread detail pane ──────────────────────────────────────── */
.bas-thread-detail {
    min-height: 260px;
    padding: 0;
    border: 1px solid #e3e7ea;
    border-radius: 14px;
    background: #fafbfc;
    overflow: hidden;
}
.bas-thread-detail .bas-empty {
    padding: 56px 20px;
    text-align: center;
    color: #8b9296;
}
.bas-thread-detail .bas-empty p { margin: 0; font-size: 13px; }

.bas-thread-detail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    background: #fff;
    border-bottom: 1px solid #eceff1;
}
.bas-thread-detail-head > div { min-width: 0; }
.bas-thread-detail-head strong { font-size: 13.5px; color: #24282a; }
.bas-thread-detail-head span { font-size: 12px; color: #697176; }
.bas-thread-close {
    border: 0;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #f0f1f2;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    color: #697176;
    padding: 0;
    transition: background .15s ease, color .15s ease;
}
.bas-thread-close:hover { background: #fbe9ec; color: #9d2636; }

.bas-thread-detail-inner {
    padding: 18px;
}

/* Original comment */
.bas-thread-original {
    position: relative;
    padding: 15px 16px 15px 17px;
    background: #fff;
    border: 1px solid #e8ebee;
    border-left: 3px solid #800033;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(16, 24, 32, .04);
}
.bas-thread-original > div:first-child {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: #697176;
}
.bas-thread-original > div:first-child strong { color: #24282a; font-weight: 700; }
.bas-thread-original img {
    display: block;
    width: 100%;
    max-height: 260px;
    object-fit: contain;
    margin: 12px 0 0;
    background: #14171a;
    border-radius: 10px;
}
.bas-thread-original p {
    margin: 10px 0 0;
    font-size: 13.5px;
    line-height: 1.6;
    color: #2c3134;
    white-space: pre-wrap;
}
.bas-thread-original small {
    display: block;
    margin-top: 10px;
    font-size: 11.5px;
    color: #8b9296;
}

/* Replies */
.bas-replies {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 16px 0 4px;
    padding-left: 14px;
    border-left: 2px solid #eceff1;
}
.bas-replies .bas-empty {
    padding: 14px 4px !important;
    text-align: left !important;
}
.bas-replies .bas-empty p { color: #8b9296; font-size: 12.5px; }
.bas-reply {
    padding: 11px 14px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #e8ebee;
    box-shadow: 0 1px 2px rgba(16, 24, 32, .03);
}
.bas-reply strong,
.bas-reply span { display: block; }
.bas-reply strong { font-size: 12.5px; color: #24282a; }
.bas-reply span { font-size: 11.5px; color: #8b9296; margin-top: 1px; }
.bas-reply p { margin: 7px 0 0; font-size: 13px; line-height: 1.55; color: #33383b; white-space: pre-wrap; }

/* Reply form */
.bas-reply-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
    padding: 13px;
    background: #f2f4f6;
    border: 1px solid #e3e7ea;
    border-radius: 12px;
}
.bas-reply-form textarea {
    width: 100%;
    min-height: 62px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid #e0e4e8;
    border-radius: 9px;
    background: #fff;
    font-size: 13px;
    line-height: 1.5;
    resize: vertical;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.bas-reply-form textarea::placeholder { color: #9aa1a6; }
.bas-reply-form textarea:focus {
    outline: none;
    border-color: #800033;
    box-shadow: 0 0 0 3px rgba(128, 0, 51, .08);
}
.bas-reply-form .button,
.bas-reply-form .bas-btn,
.bas-reply-form .bas-btn-primary {
    align-self: flex-end;
    min-height: 34px;
}

/* Status editor (detail pane) */
.bas-status-editor {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0 0;
    padding: 10px 12px;
    border: 1px solid #e8ebee;
    border-radius: 10px;
    background: #fff;
    font-size: 12px;
    font-weight: 600;
    color: #697176;
}
.bas-status-editor select {
    flex: 1;
    min-height: 32px;
    padding: 4px 9px;
    border: 1px solid #d9dcdf;
    border-radius: 8px;
    background: #fff;
    font-size: 12.5px;
    color: #33383b;
    cursor: pointer;
}
.bas-status-editor select:focus {
    outline: none;
    border-color: #800033;
    box-shadow: 0 0 0 3px rgba(128, 0, 51, .08);
}

/* Detail content sits directly inside the pane (no inner wrapper),
   so give every child except the header a side gutter. */
.bas-thread-detail > .bas-thread-original {
    margin: 18px 18px 0;
}
.bas-thread-detail > .bas-replies {
    margin-left: 18px;
    margin-right: 18px;
}
.bas-thread-detail > .bas-status-editor {
    margin: 14px 18px 0;
}
.bas-thread-detail > .bas-reply-form {
    margin-left: 18px;
    margin-right: 18px;
    margin-bottom: 18px;
}

/* Stack thread columns on narrow widths */
@media (max-width: 860px) {
    .bas-thread-layout {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════════
   Videos card — upload composer + version rows (renderVideos).
   Clean, aligned and consistent with the rest of the portal.
   ═══════════════════════════════════════════════════════════════ */

/* Upload composer: two text fields on row one, description and
   the file drop field full width below, button bottom-right. */
.bas-video-upload {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 10px;
    padding: 18px;
    margin-bottom: 18px;
    border: 1px solid #ecdfe5;
    border-radius: 14px;
    background: linear-gradient(180deg, #fdfafb 0%, #fbf5f8 100%);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.bas-video-upload:focus-within {
    border-color: #d9aec0;
    box-shadow: 0 0 0 3px rgba(128, 0, 51, 0.05);
}

.bas-video-upload input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    margin: 0;
}
.bas-video-upload input[name="version_number"] { grid-column: 1; }
.bas-video-upload input[name="title"] { grid-column: 2; }
.bas-video-upload input[name="description"] { grid-column: 1 / -1; }

/* File picker: hairline dashed field with a branded select button */
.bas-video-upload input[type="file"] {
    grid-column: 1 / -1;
    width: 100%;
    padding: 5px 6px 5px 5px;
    border: 1px dashed #d3bfc9;
    border-radius: 10px;
    background: #fff;
    color: #697176;
    font-size: 12.5px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.bas-video-upload input[type="file"]:hover {
    border-color: #b26e8d;
    background: #fffdfe;
}
.bas-video-upload input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: 8px 16px;
    border: 0;
    border-radius: 8px;
    background: #800033;
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}
.bas-video-upload input[type="file"]:hover::file-selector-button { background: #a01342; }

/* Submit pinned bottom-right of the composer */
.bas-video-upload .bas-btn-primary {
    grid-column: 1 / -1;
    justify-self: end;
    min-height: 38px;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
}

/* Version rows inside the Videos widget */
.bas-project-videos .bas-version-item {
    padding: 13px 14px;
    margin-bottom: 0;
    gap: 10px 14px;
    flex-wrap: wrap;
    border-radius: 12px;
}

/* Version number as a soft burgundy chip */
.bas-project-videos .bas-version-item > .bas-version-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 5px 11px;
    border-radius: 8px;
    background: #f7eaf0;
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

/* Title / date typography inside the version row */
.bas-project-videos .bas-version-info { gap: 3px; }
.bas-project-videos .bas-version-info strong {
    font-size: 13.5px;
    font-weight: 700;
    color: #24282a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bas-project-videos .bas-version-info strong:empty { display: none; }
.bas-project-videos .bas-version-info small {
    font-size: 11.5px;
    color: #697176;
}

/* Right-aligned action cluster (status + counts + buttons) */
.bas-project-videos .bas-version-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    flex-wrap: wrap;
}

/* Comment count — subtle pill instead of bare text */
.bas-project-videos .bas-version-actions > small {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    background: #f3f1f2;
    color: #5f6a70;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

/* Badges inside rows stay compact and never shrink */
.bas-project-videos .bas-version-actions .bas-badge { flex: 0 0 auto; }

/* Workflow select — matches the light row buttons */
.bas-video-workflow-status {
    -webkit-appearance: none;
    appearance: none;
    min-height: 32px;
    padding: 4px 30px 4px 11px;
    border: 1px solid #d9dcdf;
    border-radius: 8px;
    background: #fff url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%235f6a70' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center;
    font-size: 12.5px;
    font-weight: 600;
    color: #33383b;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.bas-video-workflow-status:hover {
    border-color: #d7a7bb;
    background-color: #fffdfe;
}
.bas-video-workflow-status:focus {
    outline: none;
    border-color: #800033;
    box-shadow: 0 0 0 3px rgba(128, 0, 51, 0.08);
}
.bas-video-workflow-status:disabled {
    opacity: 0.55;
    cursor: default;
}

/* Status colors — in review is blue so it stands apart from draft */
.bas-badge[data-workflow="in_review"] {
    background: #eaf1f7;
    color: #315b7d;
    border-color: #c6dbea;
}

/* Publish button — burgundy outline, clearly an action */
.bas-video-publish {
    border-color: #d9aec0 !important;
    color: #800033 !important;
}
.bas-video-publish:hover {
    border-color: #800033 !important;
    background: #fdf6f9 !important;
    color: #800033 !important;
}

@media (max-width: 620px) {
    .bas-video-upload { grid-template-columns: 1fr; }
    .bas-video-upload input[name="version_number"],
    .bas-video-upload input[name="title"],
    .bas-video-upload input[name="description"],
    .bas-video-upload input[type="file"],
    .bas-video-upload .bas-btn-primary { grid-column: 1; }
    .bas-project-videos .bas-version-actions { margin-left: 0; justify-content: flex-start; }
}

/* ── Uploads view: one collapsible section per project ────────── */
.bas-video-acc {
    margin-bottom: 14px;
}
.bas-video-acc:last-child { margin-bottom: 0; }

/* Header row — same visual DNA as the thread/version rows */
.bas-video-acc-head {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 11px 14px;
    background: #fff;
    border: 1px solid #e3e7ea;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(16, 24, 32, .03);
    font: inherit;
    color: #24282a;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.bas-video-acc-head:hover {
    border-color: #d7a7bb;
    background: #fffafc;
    box-shadow: 0 3px 10px rgba(128, 0, 51, .07);
}
.bas-video-acc.is-open .bas-video-acc-head {
    border-color: #e3b6c9;
    background: #fdf8fa;
}

/* Icon tile */
.bas-video-acc-ic {
    flex: 0 0 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: #f7eaf0;
    color: #800033;
}
.bas-video-acc.is-open .bas-video-acc-ic {
    background: #fbe4ec;
}

/* Name + project number */
.bas-video-acc-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1 1 auto;
}
.bas-video-acc-copy b {
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: -.01em;
    color: #24282a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bas-video-acc-copy small {
    font-size: 11px;
    color: #8b9296;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bas-video-acc-copy small:empty { display: none; }

/* Version count chip */
.bas-video-acc-count {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    background: #f3f1f2;
    color: #5f6a70;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.bas-video-acc-count[hidden] { display: none; }

/* Chevron rotates when the section is open */
.bas-video-acc-chev {
    flex: 0 0 auto;
    color: #9aa1a6;
    transition: transform .2s ease, color .2s ease;
}
.bas-video-acc.is-open .bas-video-acc-chev {
    color: #800033;
    transform: rotate(180deg);
}

/* Collapsible body: the existing Videos card, revealed on open */
.bas-video-acc-body {
    display: none;
    margin-top: 8px;
}
.bas-video-acc.is-open .bas-video-acc-body {
    display: block;
    animation: basVideoAccIn .18s ease;
}
@keyframes basVideoAccIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.bas-video-acc-body .bas-project-videos .bas-card,
.bas-video-acc-body .bas-project-videos .bas-component-card {
    margin-bottom: 0;
}

@media (max-width: 520px) {
    .bas-video-acc-head { flex-wrap: wrap; gap: 8px 10px; }
    .bas-video-acc-copy { flex-basis: calc(100% - 120px); }
}
