/* sessions-matrix-drawer.css — Detail Drawer overlay, shell, sections, and session editor standalone shell */

/* ── Detail Drawer overlay ───────────────────────────────────── */
.matrix-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 35;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base, 200ms);
}
.matrix-drawer-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

/* ── Detail Drawer ───────────────────────────────────────────── */
.matrix-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: 45vw;
    max-width: 600px;
    min-width: 400px;
    background: var(--bg-surface, #fff);
    border-left: 1px solid var(--border-default, #e5e7eb);
    box-shadow: -10px 0 28px rgba(15,23,42,0.06), -2px 0 8px rgba(15,23,42,0.04);
    transform: translateX(100%);
    transition: transform var(--transition-base, 200ms) ease;
    z-index: 40;
    display: flex;
    flex-direction: column;
}
.matrix-drawer.is-open { transform: translateX(0); }

@media (max-width: 1199px) {
    .matrix-drawer { width: 60%; min-width: 0; max-width: none; }
}
@media (max-width: 767px) {
    .matrix-drawer { width: 100%; }
}

.matrix-drawer.is-pinned ~ .matrix-drawer-overlay { display: none; }

/* Drawer header */
.matrix-drawer-header {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-default, #e5e7eb);
    background: var(--bg-surface, #fff);
    z-index: 1;
    flex-shrink: 0;
}
.matrix-drawer-nav-btn {
    height: 30px;
    padding: 0 10px;
    border: 1px solid var(--border-default, #e5e7eb);
    border-radius: var(--radius-md, 6px);
    background: var(--bg-surface, #fff);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: var(--weight-semibold, 600);
    color: var(--fg-secondary, #374151);
    cursor: pointer;
}
.matrix-drawer-nav-btn:hover { background: var(--bg-page, #f9fafb); color: var(--fg-primary, #111827); }
.matrix-drawer-nav-btn:disabled { opacity: 0.4; cursor: default; }
.matrix-drawer-title {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.matrix-drawer-title-date {
    font-size: 14px;
    font-weight: var(--weight-bold, 700);
    color: var(--fg-primary, #111827);
    text-align: center;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.matrix-drawer-close {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    cursor: pointer;
    color: var(--fg-tertiary, #9ca3af);
}
.matrix-drawer-close:hover { background: var(--color-neutral-100, #f3f4f6); color: var(--fg-primary, #111827); }

/* Drawer sub-header */
.matrix-drawer-subheader {
    padding: 10px 18px;
    border-bottom: 1px solid var(--border-default, #e5e7eb);
    background: var(--bg-page, #f9fafb);
    font-size: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.matrix-drawer-full-link {
    color: var(--color-primary-600, #2563eb);
    text-decoration: none;
    font-size: 12.5px;
    font-weight: var(--weight-semibold, 600);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.matrix-drawer-full-link:hover { text-decoration: underline; }

/* Drawer body */
.matrix-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.matrix-drawer-body.is-drawer .session-view-actions { display: none; }

/* Pin button */
.matrix-drawer-pin {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: none;
    border: 1px solid var(--border-default, #e5e7eb);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    cursor: pointer;
    color: var(--fg-tertiary, #9ca3af);
}
.matrix-drawer-pin.is-pinned {
    background: var(--color-primary-50, #eff6ff);
    color: var(--color-primary-600, #2563eb);
    border-color: var(--color-primary-200, #bfdbfe);
}
@media (min-width: 1200px), (max-width: 767px) {
    .matrix-drawer-pin { display: none; }
}

/* Drawer sub-skeleton */
.matrix-drawer-sub-skeleton {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 24px 0;
}
.matrix-drawer-sub-skeleton-line {
    height: 16px;
    background: var(--bg-muted, #f3f4f6);
    border-radius: 4px;
    width: var(--skeleton-line-width, 70%);
}

/* ── Drawer body — custom layout sections ──────────────────── */

/* Flagged status badge in subheader */
.drw-status {
    font-size: 10px;
    font-weight: var(--weight-bold, 700);
    letter-spacing: var(--tracking-wider, 0.07em);
    text-transform: uppercase;
    color: var(--color-danger, #dc2626);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    background: var(--color-danger-light, #fee2e2);
    border-radius: var(--radius-full, 9999px);
}
.drw-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 99px;
    background: var(--color-danger, #dc2626);
}
.drw-absent-badge {
    font-size: 10px;
    font-weight: var(--weight-bold, 700);
    letter-spacing: var(--tracking-wider, 0.07em);
    text-transform: uppercase;
    color: var(--color-neutral-600, #4b5563);
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    background: var(--color-neutral-100, #f3f4f6);
    border-radius: var(--radius-full, 9999px);
}
.drw-absent-badge[hidden] {
    display: none;
}

/* Section wrapper */
.drw-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.drw-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}
.drw-section-title {
    font-size: 10.5px;
    font-weight: var(--weight-bold, 700);
    letter-spacing: var(--tracking-wider, 0.07em);
    text-transform: uppercase;
    color: var(--fg-tertiary);
}
.drw-section-meta {
    font-size: 11px;
    color: var(--fg-tertiary);
}

/* Critical callout */
.drw-callout {
    background: var(--color-danger-light, #fee2e2);
    border: 1px solid #fecaca;
    border-radius: var(--radius-md, 6px);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.drw-callout-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: var(--weight-bold, 700);
    letter-spacing: var(--tracking-wider, 0.07em);
    text-transform: uppercase;
    color: var(--color-danger, #dc2626);
}
.drw-callout-text {
    font-size: 13px;
    color: #7f1d1d;
    line-height: 1.55;
}

/* Score grid */
.drw-scores {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.drw-score {
    background: var(--bg-page);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md, 6px);
    padding: 12px 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.drw-score.is-critical {
    border-color: #fecaca;
    background: var(--color-danger-light, #fee2e2);
}
.drw-score-label {
    font-size: 10.5px;
    font-weight: var(--weight-bold, 700);
    letter-spacing: var(--tracking-wider, 0.07em);
    text-transform: uppercase;
    color: var(--fg-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.drw-score.is-critical .drw-score-label { color: var(--color-danger, #dc2626); }
.drw-score-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
.drw-score-value {
    font-size: 24px;
    font-weight: var(--weight-extrabold, 800);
    color: var(--fg-primary);
    letter-spacing: var(--tracking-tight, -0.02em);
    line-height: 1;
}
.drw-score.is-critical .drw-score-value { color: var(--color-danger, #dc2626); }
.drw-score-of {
    font-size: 12px;
    font-weight: var(--weight-medium, 500);
    color: var(--fg-tertiary);
    margin-left: 2px;
}
.drw-bar {
    height: 4px;
    background: var(--color-neutral-100, #f3f4f6);
    border-radius: 99px;
    overflow: hidden;
}
.drw-bar-fill {
    display: block;
    height: 100%;
    border-radius: 99px;
    transition: width 0.3s ease;
}
.drw-bar-fill--1 { background: #b91c1c; }
.drw-bar-fill--2 { background: #ef4444; }
.drw-bar-fill--3 { background: var(--color-warning, #d97706); }
.drw-bar-fill--4 { background: var(--color-success, #16a34a); }
.drw-bar-fill--bool-true  { background: var(--color-success, #16a34a); }
.drw-bar-fill--bool-false { background: var(--color-danger, #dc2626); }
.drw-bar-fill--pct-green  { background: var(--color-success, #16a34a); }
.drw-bar-fill--pct-amber  { background: var(--color-warning, #d97706); }
.drw-bar-fill--pct-red    { background: var(--color-danger, #dc2626); }
.drw-bar-fill--neutral    { background: var(--color-neutral-300, #d1d5db); }

/* Topic tags */
.drw-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.drw-tag {
    padding: 4px 9px;
    font-size: 11.5px;
    font-weight: var(--weight-semibold, 600);
    border-radius: var(--radius-full, 9999px);
    background: var(--color-neutral-100, #f3f4f6);
    color: var(--fg-secondary);
}

/* Text field */
.drw-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.drw-field-label {
    font-size: 10.5px;
    font-weight: var(--weight-bold, 700);
    letter-spacing: var(--tracking-wider, 0.07em);
    text-transform: uppercase;
    color: var(--fg-tertiary);
}
.drw-field-value {
    font-size: 13px;
    color: var(--fg-primary);
    line-height: 1.55;
    white-space: pre-wrap;
}

/* Drawer footer */
.matrix-drawer-footer {
    padding: 12px 18px;
    border-top: 1px solid var(--border-default);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    background: var(--bg-surface);
    flex-shrink: 0;
}
.drw-footer-meta {
    font-size: 11.5px;
    color: var(--fg-tertiary);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.drw-footer-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.drw-footer-btn {
    height: 30px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md, 6px);
    font-size: 12px;
    font-weight: var(--weight-semibold, 600);
    color: var(--fg-primary);
    cursor: pointer;
}
.drw-footer-btn:hover { background: var(--bg-page); border-color: var(--border-strong, #9ca3af); }

/* ── Session editor standalone shell (add/edit mode, no matrix) ─────────────── */

.session-editor-standalone {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    padding: var(--space-8, 2rem);
    background: var(--bg-page, #f9fafb);
}
