/* ==========================================================================
   GRC Module - Feuille de styles
   Version 1.0
   ========================================================================== */

/* --- KPI Dashboard Cards ------------------------------------------------- */
.grc-kpi-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 16px 0 24px;
}
.grc-kpi-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    border-radius: 10px;
    padding: 18px 24px;
    min-width: 180px;
    flex: 1;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
    text-decoration: none;
    color: inherit;
    transition: transform .15s, box-shadow .15s;
    border-left: 4px solid #4c86e0;
}
.grc-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    text-decoration: none;
    color: inherit;
}
.grc-kpi-small .grc-kpi-card {
    min-width: 120px;
    padding: 12px 16px;
}
.grc-kpi-icon { font-size: 2rem; min-width: 40px; text-align: center; }
.grc-kpi-small .grc-kpi-icon { font-size: 1.5rem; }
.grc-kpi-value { font-size: 2rem; font-weight: 700; line-height: 1; color: #1a202c; }
.grc-kpi-small .grc-kpi-value { font-size: 1.5rem; }
.grc-kpi-value small { font-size: .9rem; font-weight: 400; color: #888; }
.grc-kpi-label { font-size: .8rem; color: #718096; margin-top: 4px; text-transform: uppercase; letter-spacing: .04em; }

/* --- Actions Bar --------------------------------------------------------- */
.grc-actions-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }

/* --- Section Blocks ------------------------------------------------------ */
.grc-section {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    margin: 16px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
}
.grc-section h3 { font-size: 1.05rem; margin-bottom: 14px; color: #2d3748; }
.grc-section h4 { font-size: .95rem; margin-bottom: 10px; color: #4a5568; }
.grc-panel { border: 2px solid #e2e8f0; }

/* --- Timeline (fiche tiers) ---------------------------------------------- */
.grc-tiers-block {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    margin-top: 14px;
}
.grc-tiers-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.grc-tiers-header h3 { margin: 0; font-size: 1rem; flex: 1; }
.grc-see-all { font-size: .8rem; color: #4c86e0; text-decoration: none; }
.grc-see-all:hover { text-decoration: underline; }
.grc-btn-add {
    background: #4c86e0;
    color: #fff !important;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: .8rem;
    text-decoration: none !important;
    transition: background .15s;
}
.grc-btn-add:hover { background: #2563eb; }

.grc-timeline { list-style: none; padding: 0; margin: 0; }
.grc-timeline-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}
.grc-timeline-item:last-child { border-bottom: none; }
.grc-tl-icon {
    width: 32px; height: 32px;
    background: #4c86e0;
    color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .85rem;
    flex-shrink: 0;
}
.grc-tl-content { flex: 1; min-width: 0; }
.grc-tl-date { font-size: .8rem; color: #888; margin-left: 6px; }
.grc-tl-desc { font-size: .85rem; color: #666; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grc-no-exchange { padding: 10px 0; }

/* --- Filters Bar --------------------------------------------------------- */
.grc-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 0;
    margin-bottom: 8px;
}

/* --- Progress Bar -------------------------------------------------------- */
.grc-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 80px;
}
.grc-progress-bar-wrap {
    flex: 1;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}
.grc-progress-bar {
    height: 6px;
    background: #4cc48e;
    border-radius: 3px;
    transition: width .3s;
}
.grc-progress span { font-size: .8rem; color: #666; min-width: 30px; }

/* --- Question Builder ---------------------------------------------------- */
.grc-questions-list { padding-left: 0; list-style: none; }
.grc-question-item {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}
.grc-question-item:last-child { border-bottom: none; }
.grc-question-label { font-weight: 500; }
.grc-question-type { font-size: .75rem; background: #eef2ff; color: #4c86e0; padding: 2px 8px; border-radius: 10px; }
.grc-required { color: #e04c4c; font-weight: bold; }
.grc-question-opts { font-size: .85rem; color: #666; margin-top: 6px; padding-left: 20px; }
.grc-q-stat { font-size: .85rem; color: #4cc48e; margin-top: 6px; }

.grc-question-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 8px;
}
.grc-q-num { font-weight: 700; color: #4c86e0; min-width: 24px; }
.grc-q-label { flex: 1; min-width: 200px; }
.grc-q-type { min-width: 150px; }
.grc-q-options-wrap { flex-basis: 100%; padding-left: 34px; }

/* --- Description Block --------------------------------------------------- */
.grc-description-block {
    background: #f8fafc;
    border-left: 4px solid #4c86e0;
    border-radius: 0 8px 8px 0;
    padding: 16px 20px;
    margin-top: 16px;
}
.grc-description-block h4 { margin-bottom: 10px; color: #2d3748; }
.grc-description-content { line-height: 1.6; color: #4a5568; }

/* --- Collaboration Badge ------------------------------------------------- */
.grc-collab-badge {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 8px 14px;
    margin-bottom: 12px;
    font-size: .85rem;
}
.grc-collab-label { color: #92400e; font-weight: 500; }
.grc-collab-user {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #fff;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .8rem;
    font-weight: 500;
}
.grc-collab-me { outline: 2px solid #1a202c; }
.grc-collab-editing-warn { color: #fef9c3; font-size: .75rem; }

/* --- Stars --------------------------------------------------------------- */
.grc-stars { display: inline-flex; align-items: center; gap: 2px; }
.grc-star-full  { color: #f59e0b; }
.grc-star-half  { color: #f59e0b; }
.grc-star-empty { color: #d1d5db; }

/* --- Reviews ------------------------------------------------------------- */
.grc-tiers-reviews { margin-top: 14px; padding-top: 14px; border-top: 1px solid #e2e8f0; }
.grc-tiers-contracts { margin-top: 14px; padding-top: 14px; border-top: 1px solid #e2e8f0; }

/* --- Send Form ----------------------------------------------------------- */
.grc-send-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* --- Empty State --------------------------------------------------------- */
.grc-empty {
    text-align: center;
    padding: 30px;
    color: #a0aec0;
}
.grc-empty i { display: block; margin-bottom: 10px; }

/* --- Form section -------------------------------------------------------- */
.grc-form-section { margin-top: 16px; }
.grc-form-section label { display: block; margin-bottom: 6px; color: #4a5568; }

/* --- Badge statut -------------------------------------------------------- */
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: .8rem; font-weight: 500; }
.status4 { background: #fef3c7; color: #92400e; }
.status6 { background: #d1fae5; color: #065f46; }
.status9 { background: #fee2e2; color: #991b1b; }
.status1 { background: #dbeafe; color: #1e40af; }

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 768px) {
    .grc-kpi-card { min-width: calc(50% - 8px); }
    .grc-filters { flex-direction: column; align-items: flex-start; }
    .grc-question-row { flex-direction: column; align-items: flex-start; }
    .grc-q-label { min-width: unset; width: 100%; }
}
@media (max-width: 480px) {
    .grc-kpi-card { min-width: 100%; }
}
