/* ============================================================
   BSX Report SINGLE
   Requires: bsx-design.css, bsx-base.css
   ============================================================ */
.bsx-related-reports p {
    display: contents;
}
.rep-eval-container {
    max-height: 630px;
    overflow:auto;
}
.rep-eval-body {
    font-family: courier;
    font-size:0.9rem;
}

.rep-log-container {
    max-height: 630px;
    overflow:auto;
}
.rep-log-body {
    font-family: courier;
    font-size:0.9rem;
}



/* Container */
.reprel-container {
    display:        flex;
    flex-direction: column;
    gap:            2px;
    max-width:      1320px;
}

/* Row — grid with 5 columns */
.reprel-row {
    display:               grid;
    grid-template-columns: 80px 1fr 120px 100px;
    grid-template-areas:   "type title date link"
                           "type summary summary summary";
    gap:                   0 10px;
    align-items:           center;
    padding:               8px 12px;
    background:            #21201e;
    border-left:           2px solid transparent;
    transition:            border-color 0.2s ease, background 0.2s ease;
}

.reprel-row:hover {
    background:   #37353a;
    border-color: #edcb82;
}

/* Type badge */
.reprel-type {
    grid-area:   type;
    font-size:   0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color:       #edcb82;
    opacity:     0.6;
}

.reprel-type.is-followup {
    color:   #edcb82;
    opacity: 1;
}

/* Title */
.reprel-title {
    grid-area:   title;
    font-size:   0.9rem;
    color:       #e8e6e2;
    white-space: nowrap;
    overflow:    hidden;
    text-overflow: ellipsis;
}

/* Date */
.reprel-date {
    grid-area:  date;
    font-size:  0.8rem;
    color:      #7a7875;
    text-align: right;
}

/* Link */
.reprel-link {
    grid-area:  link;
    text-align: right;
}

.reprel-link a {
    font-size:      0.75rem;
    color:          #edcb82;
    text-decoration: none;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    opacity:        0.7;
    transition:     opacity 0.2s ease;
}

.reprel-link a:hover {
    opacity: 1;
}

/* Summary */
.reprel-summary {
    grid-area:  summary;
    font-size:  0.8rem;
    color:      #7a7875;
    padding-top: 4px;
    line-height: 1.5;
}


.rep-single-container {
    display:             grid;
    grid-template-columns: repeat(5, 1fr);
    overflow:auto;
    gap:                 10px;
    align-items:         center;
    padding:             10px;
    max-width:           1320px;
    heigth:              350px;
    background:          var(--bsx-bg-dark);
    grid-template-rows:  30px 50px 50px 30px;
    grid-template-areas:
        "rtit  rtit .    .    cass"
        "dat   rsum rsum rsum img2"
        "fup   rsum rsum rsum img1"
        "link  rsum rsum rsum comp";
}


/* Grid areas */
.rep-title        { grid-area: rtit; font-size: var(--bsx-text-2xl);}
.rep-cass         { grid-area: cass; color: var(--bsx-accent); font-size: var(--bsx-text-2xl); text-align:right;padding-right:20px;}
.rep-link         { grid-area: link; font-size: var(--bsx-text-base); }
.rep-dat          { grid-area: dat;  font-size: var(--bsx-text-base); }
.rep-rsum         { grid-area: rsum; font-size: var(--bsx-text-base); align-self:start;}
.rep-fup          { grid-area: fup;  font-size: var(--bsx-text-base); }
.rep-comp         { grid-area: comp; color: var(--bsx-accent); font-size: var(--bsx-text-2xl); text-align:right;padding-right:20px;}

.rep-comp-logo    { grid-area: img1; }
.rep-cass-logo    { grid-area: img2; }



/* Logos */
.rep-corp-img       { align-self: center; justify-self: end; }
.rep-corp-img img   { max-width: 100%; height: 50px; object-fit: contain; }
.rep-cass-img       { align-self: center; justify-self: end; }
.rep-cass-img img   { justify-self:end; max-width: 100%; height: 50px; object-fit: contain; }


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

@media (max-width: 768px) {
    .rep-single-container {
        grid-template-columns: 2fr 1fr 2fr;
        grid-template-rows:    40px 40px;
        grid-template-areas:
            "rtit rtit dat  "
            "sym  .    fup  "
            "comp .    cass "
            "rsum rsum rsum "
            max-width: 480px;
    }

    .rep-comp-logo, .rep-cass-logo, .rep-corp-img, .rep-corp-img img,
    .rep-cass-img, .rep-cass-img img { display: none; }
}


.bsx-related-reports {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bsx-report-row {
    display: grid;
    grid-template-columns: 270px 400px 120px 250px;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
    background: #37353a;
    transition: background 0.15s ease;
    border: 1px solid #f1eee7);
}
.bsx-report-row:last-child { border-bottom: none; }
.bsx-report-row:hover      { background: rgba(0,0,0,0.04); }

.bsx-report-row__entities  { display: flex; flex-direction: column; gap: 6px; }
.bsx-entity                { display: flex; align-items: center; gap: 7px; }
.bsx-entity__logo img      { width: 80px; height: 50px; border-radius: 3px; object-fit: contain; flex-shrink: 0; }
.bsx-entity__name          { font-size: 1.1rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bsx-entity--target .bsx-entity__name { font-weight: 400; opacity: 0.75; }

.bsx-report-row__meta { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; white-space: nowrap; }
.bsx-date             { font-size: 1rem; opacity: 0.6; }

.bsx-tag          { display: block; font-size: 0.9rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; padding: 2px 7px; border-radius: 3px; }
.bsx-tag--initial { background: #e6f4ea; color: #1e6e38; }
.bsx-tag--fup     { background: #e8eeff; color: #2644a8; }

.bsx-report-row__summary {
    font-size: 0.9rem; opacity: 0.7; line-height: 1.45;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
}

.bsx-report-row__kpis { display: flex; gap: 8px; }
.bsx-kpi {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 52px; height: 24px; border-radius: 4px;
    background: rgba(0,0,0,0.05); font-size: 1rem; font-weight: 600;
}
.bsx-kpi:empty { visibility: hidden; }

.bsx-ext-link { display: flex; align-items: center; justify-content: center; color: inherit; opacity: 0.4; transition: opacity 0.15s; padding: 4px; border-radius: 4px; }
.bsx-ext-link:hover { opacity: 1; }

.bsx-no-related { font-size: 1rem; opacity: 0.5; padding: 8px 0; }

@media (max-width: 640px) {
    .bsx-report-row {
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto auto auto;
        gap: 8px;
    }
    .bsx-report-row__entities { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; gap: 12px; }
    .bsx-report-row__meta     { grid-column: 1; flex-direction: row; align-items: center; gap: 8px; }
    .bsx-report-row__summary  { grid-column: 1 / -1; }
    .bsx-report-row__kpis     { grid-column: 1; }
    .bsx-report-row__actions  { grid-column: 2; grid-row: 2; }
}

