/* =====================================================
   RIL Manager – ECL Tennis  v2.1
   ===================================================== */

/* --- Container --- */
.ril-manager-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 900px;
    margin: 0 auto;
    color: #333;
}

/* --- Header --- */
.ril-header {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #1a5276;
    color: #fff;
    padding: 16px 20px;
    border-radius: 8px 8px 0 0;
    margin-bottom: 0;
}
.ril-logo {
    width: 56px;
    height: auto;
}
.ril-title {
    margin: 0;
    font-size: 1.4rem;
    color: #fff;
}
.ril-subtitle {
    margin: 4px 0 0;
    opacity: .85;
    font-size: .9rem;
}

/* --- Tabs --- */
.ril-tabs {
    display: flex;
    gap: 4px;
    background: #1a5276;
    padding: 0 16px 10px;
}
.ril-tab {
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    padding: 8px 18px;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    font-size: .95rem;
    transition: background .2s;
}
.ril-tab:hover  { background: rgba(255,255,255,.28); }
.ril-tab.active { background: #fff; color: #1a5276; font-weight: 600; }

/* --- Tab content --- */
.ril-tab-content { display: none; }
.ril-tab-content.active { display: block; }

/* --- Sections --- */
.ril-section {
    border: 1px solid #dde;
    border-radius: 0 0 8px 8px;
    padding: 16px 20px 12px;
    background: #fff;
}
.ril-section-title {
    margin: 0 0 12px;
    font-size: 1.1rem;
    color: #1a5276;
    border-bottom: 2px solid #1a5276;
    padding-bottom: 6px;
}

/* --- Tables --- */
.ril-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .92rem;
}
.ril-table th,
.ril-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
}
.ril-table th {
    background: #1a5276;
    color: #fff;
    font-weight: 600;
}
.ril-table tbody tr:hover { background: #f0f5ff; }

/* --- Standings : ECL row --- */
.ril-ecl-row { background: #eaf4fb !important; }
.ril-ecl-row:hover { background: #d6eaf8 !important; }
.ril-badge-ecl {
    display: inline-block;
    background: #1a5276;
    color: #fff;
    font-size: .75rem;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 4px;
    vertical-align: middle;
}

/* --- Match badges --- */
.ril-badge {
    display: inline-block;
    width: 26px;
    height: 26px;
    line-height: 26px;
    text-align: center;
    border-radius: 50%;
    font-weight: 700;
    font-size: .85rem;
}
.ril-win  { background: #27ae60; color: #fff; }
.ril-loss { background: #c0392b; color: #fff; }
.ril-draw { background: #95a5a6; color: #fff; }

/* --- Match result row highlight --- */
.ril-result-win  td { border-left: 4px solid #27ae60; }
.ril-result-loss td { border-left: 4px solid #c0392b; }
.ril-result-draw td { border-left: 4px solid #95a5a6; }

/* --- Score --- */
.ril-score { font-weight: 700; font-size: 1rem; color: #1a5276; }

/* --- Detail buttons --- */
.ril-detail-ajax {
    background: #1a5276;
    color: #fff;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: .82rem;
    transition: background .2s;
}
.ril-detail-ajax:hover { background: #154360; }
.ril-detail-link {
    margin-left: 6px;
    font-size: .82rem;
    color: #1a5276;
}

/* --- Detail panel --- */
.ril-detail-cell { padding: 0 !important; border: none !important; }
.ril-detail-panel {
    background: #f8fafe;
    border: 1px solid #d5e8f5;
    border-radius: 6px;
    padding: 14px 16px;
    margin: 4px 0 6px;
    font-size: .88rem;
}
.ril-detail-panel h4 {
    margin: 8px 0 6px;
    color: #1a5276;
    font-size: .95rem;
}
.ril-detail-panel table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
}
.ril-detail-panel th,
.ril-detail-panel td {
    padding: 5px 8px;
    border-bottom: 1px solid #e0e8f0;
}
.ril-detail-panel th { background: #d6eaf8; color: #1a5276; }
.ril-detail-panel .winner-row { background: #eafaf1; font-weight: 600; }
.ril-detail-loading { color: #888; font-style: italic; }
.ril-error { color: #c0392b; }

/* --- Captain badge --- */
.ril-captain-row { background: #fef9e7 !important; }
.ril-badge-captain {
    display: inline-block;
    background: #f39c12;
    color: #fff;
    width: 20px; height: 20px;
    line-height: 20px;
    text-align: center;
    border-radius: 50%;
    font-size: .75rem;
    font-weight: 700;
    margin-left: 4px;
    vertical-align: middle;
}

/* --- Bilan & notes --- */
.ril-bilan {
    margin: 12px 0 4px;
    font-size: .95rem;
}
.ril-note, .ril-source {
    font-size: .8rem;
    color: #888;
    margin: 6px 0 0;
}
.ril-source a { color: #1a5276; }

/* --- Responsive --- */
@media (max-width: 600px) {
    .ril-header { flex-direction: column; align-items: flex-start; }
    .ril-table th, .ril-table td { padding: 6px 6px; font-size: .82rem; }
    .ril-matches-table th:nth-child(2),
    .ril-matches-table td:nth-child(2) { display: none; }
}
