/* ============================================================
   Sanad Lab Kutub Arbaah Style - Step 22
   ============================================================ */

.sanad-kutub-hero {
    background: linear-gradient(135deg, #064e3b, #0f172a);
    color: #fff;
    border-radius: 30px;
    padding: 38px;
    margin: 28px 0;
    border-bottom: 6px solid #d6a84f;
    box-shadow: 0 22px 60px rgba(15,23,42,.16);
}

.sanad-kutub-hero h1 {
    margin-top: 0;
    font-size: 32px;
}

.sanad-kutub-hero p {
    color: #ecfdf5;
    line-height: 2.1;
    max-width: 950px;
}

.sanad-kutub-panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 28px;
    padding: 32px;
    box-shadow: 0 18px 50px rgba(15,23,42,.06);
}

.kutub-filter-bar {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.kutub-filter-bar input,
.kutub-filter-bar select {
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    padding: 12px 14px;
    font-family: inherit;
    background: #f8fafc;
}

.kutub-filter-bar input:focus,
.kutub-filter-bar select:focus {
    outline: none;
    background: #fff;
    border-color: #14532d;
    box-shadow: 0 0 0 4px rgba(20,83,45,.12);
}

.sanad-case-card {
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    padding: 24px;
    margin-bottom: 24px;
    background: #ffffff;
    box-shadow: 0 8px 25px rgba(15,23,42,.03);
    transition: all .2s ease;
}

.sanad-case-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 14px 35px rgba(15,23,42,.07);
}

.sanad-case-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 14px;
    margin-bottom: 16px;
}

.sanad-case-title {
    margin: 0;
    font-size: 20px;
    color: #064e3b;
}

.sanad-case-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.sk-badge {
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.sk-source { background: #eff6ff; color: #1d4ed8; }
.sk-grade-sahih { background: #ecfdf5; color: #166534; }
.sk-grade-hasan { background: #fefce8; color: #854d0e; }
.sk-grade-muwaththaq { background: #f0fdf4; color: #15803d; }
.sk-grade-daif { background: #fef2f2; color: #991b1b; }
.sk-grade-mursal { background: #fff7ed; color: #c2410c; }

.sanad-raw-matn {
    background: #f8fafc;
    border-right: 4px solid #d6a84f;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 16px;
    font-size: 16px;
    line-height: 2.2;
    color: #0f172a;
    direction: rtl;
}

.sanad-chain-visual {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 18px 0;
    background: #fdfdfd;
    border: 1px solid #eef2f6;
    border-radius: 16px;
    padding: 16px;
}

.chain-node {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.chain-node-idx {
    width: 28px;
    height: 28px;
    background: #14532d;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    flex-shrink: 0;
}

.chain-node-info {
    flex-grow: 1;
}

.chain-node-name {
    font-weight: 800;
    color: #0f172a;
}

.chain-node-tabaqah {
    font-size: 12px;
    color: #64748b;
    margin-right: 8px;
}

.chain-node-status {
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
}

.node-thiqah { background: #ecfdf5; color: #166534; }
.node-mamdooh { background: #fefce8; color: #854d0e; }
.node-daif { background: #fef2f2; color: #991b1b; }
.node-majhool { background: #f1f5f9; color: #475569; }

.sanad-analysis-box {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 14px;
    padding: 16px;
    margin-top: 14px;
    line-height: 2.1;
    color: #166534;
}

.sanad-academic-note {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 14px;
    padding: 14px;
    margin-top: 10px;
    line-height: 2;
    color: #92400e;
    font-size: 13px;
}

@media (max-width: 850px) {
    .kutub-filter-bar {
        grid-template-columns: 1fr;
    }
    .sanad-kutub-hero,
    .sanad-kutub-panel {
        padding: 20px;
    }
}