/* ============================================
 * [xem_tuoi_lam_an] — xem tuổi hợp làm ăn N người (v0.41.x)
 * ============================================ */

.xtla-wrap .xtvc-title { margin-bottom: 8px; }

/* ----- Partners grid in form ----- */
.xtla-partners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}
.xtla-partner { position: relative; }
.xtla-partner legend { position: relative; padding-right: 32px; }
.xtla-remove-partner {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #b91c1c;
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.xtla-remove-partner:hover { background: #fecaca; }

.xtla-add-partner-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
}
.xtla-add-partner {
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #94a3b8;
    border-radius: 6px;
    color: #1e293b;
    font-weight: 500;
    cursor: pointer;
}
.xtla-add-partner:hover { background: #f1f5f9; border-color: #64748b; }
.xtla-add-partner-wrap small { color: #64748b; }

/* ----- Industry fieldset ----- */
.xtla-industry-fieldset {
    margin-bottom: 20px;
    padding: 14px 18px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fafafa;
}
.xtla-industry-fieldset legend {
    padding: 0 8px;
    font-weight: 600;
    color: #374151;
}
.xtla-industry-fieldset legend small {
    font-weight: 400;
    color: #6b7280;
}
.xtla-industry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 8px;
}
.xtla-industry-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 12px;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.xtla-industry-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.xtla-industry-card:hover { border-color: #94a3b8; background: #f8fafc; }
.xtla-industry-card-selected {
    border-color: #b8860b;
    background: #fdf8eb;
    box-shadow: 0 0 0 2px rgba(184, 134, 11, 0.15);
}
.xtla-industry-icon { font-size: 22px; margin-bottom: 2px; }
.xtla-industry-card strong { font-size: 14px; color: #1f2937; margin-bottom: 4px; }
.xtla-industry-card small { font-size: 11.5px; color: #6b7280; line-height: 1.4; }

/* ----- Result: names header ----- */
.xtla-names { flex-wrap: wrap; justify-content: center; }
.xtla-names .xtvc-vs { margin: 0 8px; }

/* ----- Quick summary industry score ----- */
.xtla-qs-industry {
    margin: 12px 0;
    padding: 8px 12px;
    background: rgba(184, 134, 11, 0.08);
    border-left: 3px solid #b8860b;
    border-radius: 4px;
}
.xtla-qs-industry-score { font-weight: 700; color: #b8860b; margin-left: 6px; }

/* ----- Partners summary grid + role badges ----- */
.xtla-partners-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
}
.xtla-person-card { position: relative; }
.xtla-person-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.xtla-person-card-head h4 { margin: 0; }
.xtla-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}
.xtla-role-ceo        { background: #b8860b; }
.xtla-role-finance    { background: #047857; }
.xtla-role-operations { background: #4a5568; }
.xtla-role-marketing  { background: #c2410c; }
.xtla-role-reason {
    margin-top: 8px;
    padding: 8px 10px;
    background: #f8fafc;
    border-left: 2px solid #cbd5e1;
    border-radius: 4px;
    font-size: 14.5px;
    color: #475569;
    line-height: 1.55;
}

/* ----- Matrix pairwise ----- */
.xtla-matrix-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}
.xtla-pair-card {
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}
.xtla-pair-card[open] {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.xtla-pair-good    { border-color: #86efac; background: linear-gradient(90deg, #f0fdf4 0%, #ffffff 30%); }
.xtla-pair-neutral { border-color: #cbd5e1; background: linear-gradient(90deg, #f8fafc 0%, #ffffff 30%); }
.xtla-pair-bad     { border-color: #fca5a5; background: linear-gradient(90deg, #fef2f2 0%, #ffffff 30%); }

.xtla-pair-card > summary {
    list-style: none;
    cursor: pointer;
    padding: 12px 14px;
}
.xtla-pair-card > summary::-webkit-details-marker { display: none; }
.xtla-pair-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.xtla-pair-names {
    font-size: 15px;
    color: #1f2937;
}
.xtla-pair-names .xtvc-vs {
    margin: 0 6px;
    color: #94a3b8;
}
.xtla-pair-score {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    white-space: nowrap;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
}
.xtla-pair-score small {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.xtla-pair-good .xtla-pair-score    { color: #047857; }
.xtla-pair-bad .xtla-pair-score     { color: #b91c1c; }
.xtla-pair-verdict {
    margin: 6px 0 8px 0;
    font-size: 13.5px;
    color: #475569;
}
.xtla-pair-factors {
    padding: 8px 14px 14px 14px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    border-top: 1px solid #e5e7eb;
}

/* ----- Cluster analysis ----- */
.xtla-cluster-item {
    display: flex;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
    border-radius: 8px;
    border-left: 4px solid #cbd5e1;
    background: #f8fafc;
}
.xtla-cluster-icon { font-size: 22px; line-height: 1; flex-shrink: 0; }
.xtla-cluster-body h4 { margin: 0 0 4px 0; font-size: 15px; }
.xtla-cluster-body p { margin: 4px 0; font-size: 15px; line-height: 1.55; }
.xtla-cluster-good {
    border-left-color: #16a34a;
    background: linear-gradient(90deg, #f0fdf4 0%, #ffffff 60%);
}
.xtla-cluster-good h4 { color: #166534; }
.xtla-cluster-bad {
    border-left-color: #dc2626;
    background: linear-gradient(90deg, #fef2f2 0%, #ffffff 60%);
}
.xtla-cluster-bad h4 { color: #991b1b; }
.xtla-cluster-critical {
    border-left-color: #b91c1c;
    background: linear-gradient(90deg, #fee2e2 0%, #fff5f5 60%);
}
.xtla-cluster-critical h4 { color: #7f1d1d; }
.xtla-cluster-warning {
    border-left-color: #d97706;
    background: linear-gradient(90deg, #fffbeb 0%, #ffffff 60%);
}
.xtla-cluster-warning h4 { color: #92400e; }

/* ----- Industry section ----- */
.xtla-industry-section {
    background: linear-gradient(135deg, #fdf8eb 0%, #fff 50%);
}
.xtla-industry-overall {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 10px 0 16px 0;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #f3e8c0;
    border-radius: 8px;
}
.xtla-industry-overall-score {
    font-size: 32px;
    font-weight: 800;
    color: #b8860b;
    line-height: 1;
    flex-shrink: 0;
}
.xtla-industry-overall p { margin: 2px 0; }
.xtla-industry-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}
.xtla-industry-table thead { background: #f3f4f6; }
.xtla-industry-table th {
    text-align: left;
    padding: 10px 14px;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
}
.xtla-industry-table td {
    padding: 9px 14px;
    border-bottom: 1px solid #f3f4f6;
}
.xtla-industry-table th:first-child,
.xtla-industry-table td:first-child {
    padding-left: 18px;
}
.xtla-industry-table th:last-child,
.xtla-industry-table td:last-child {
    padding-right: 18px;
}
.xtla-industry-table tr:last-child td { border-bottom: none; }

/* Responsive */
@media (max-width: 600px) {
    .xtla-pair-head { flex-direction: column; align-items: flex-start; }
    .xtla-pair-score { align-items: flex-start; }
    .xtla-industry-overall { flex-direction: column; text-align: center; }
}

/* Small phones — collapse multi-col grids về 1 cột để tránh squeeze */
@media (max-width: 480px) {
    .xtla-partners-grid,
    .xtla-partners-summary-grid,
    .xtla-result-industry-grid {
        grid-template-columns: 1fr;
    }
    .xtla-industry-grid {
        grid-template-columns: 1fr 1fr;
    }
}
