/* ==========================================================================
   1. GLOBAL LAYOUT & CONTAINERS
   ========================================================================== */
section#wrapper > div.container:first-child:has(div.box-learner-content) {
    width: 90%;
}

.wrapper_a_pmi_learner_formation,
.wrapper_a_pmi_learner {
    display: flex;
    gap: 30px;
    width: 100%;
    align-items: flex-start;
}

.wrapper_a_pmi_learner_formation_apprenant {
    display: flex;
    flex-direction: column;
}

.dashboard-render-area,
.box-learner-content-formation {
    flex: 1;
    min-width: 0;
}

.box-learner-content {
    margin-top: 40px;
    width: 100% !important;
    max-width: none !important;
    padding: 25px !important;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    box-sizing: border-box;
}

.box-learner-content.box-learner-content-formation {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 0 !important;
}

/* ==========================================================================
   2. DASHBOARD HEADER (SUMMARY & STATISTICS)
   ========================================================================== */
#header-customer-dashboard {
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 6px 20px rgba(0, 0, 0, .06);
    border: 1px solid #e6e8eb;
    margin-bottom: 28px;
    position: relative;
}

#header-customer-dashboard::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, #17a2b8 0%, #28a745 50%, #ffc107 100%);
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
}

#header-customer-dashboard + * {
    border-top: 1px solid #eceff2;
    padding-top: 24px;
}

.dashboard-global {
    flex: 0 0 30%;
    padding: 25px;
    background: #f8f9fa;
    border-right: 1px solid #e1e1e1;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.global-score {
    font-size: 36px;
    font-weight: 800;
    color: #2c3e50;
    line-height: 1.2;
    margin: 15px 0;
}

.score-separator { color: #ccc; font-weight: 300; }
.score-target { color: #7f8c8d; font-size: 24px; }
.score-unit {
    display: inline-block;
    margin-left: 6px;
    font-size: 12px;
    color: #777;
}

.dashboard-breakdown {
    flex: 1;
    padding: 25px;
}

.dashboard-breakdown h3 {
    font-size: 13px;
    letter-spacing: .04em;
    color: #6c757d;
    margin-bottom: 12px;
}

.breakdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.breakdown-header {
    margin-bottom: 6px;
}

.breakdown-item {
    background: #ffffff;
    border-radius: 8px;
    padding: 10px 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .03);
    transition: transform .15s ease, box-shadow .15s ease;
}

.breakdown-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border-color: #ddd;
}

.cat-name { font-weight: 700; color: #34495e; }
.cat-score { color: #7f8c8d; font-size: 13px; }
.cat-score b { color: #2c3e50; }

.dashboard-badge img { height: 48px; }

/* Legacy Header Elements */
#customer-name {
    font-weight: 800;
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

.header-periode label { margin: 0; }

.hours-informations {
    border: solid 1px #bbb;
    border-left: solid 8px green;
    padding: 5px;
    background-color: #ededed;
    width: fit-content;
}

.prolongation-informations {
    border: solid 1px #bbb;
    border-left: solid 8px #ff8400;
    background-color: #ededed;
    width: fit-content;
    margin-top: 10px;
}

.prolongation-child {
    border-left: solid 8px #ff8400;
    padding: 5px;
    margin-left: 5px;
}

/* ==========================================================================
   3. NAVIGATION BAR & CONTROL CENTER
   ========================================================================== */
.horizontal-dashboard-nav {
    width: 100% !important;
    background-color: #2e353d;
    border-radius: 10px;
    display: flex !important;
    justify-content: space-between;
    align-items: stretch !important;
    padding: 0 10px !important;
    height: 60px;
    margin-bottom: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nav-links {
    display: flex !important;
    flex-direction: row !important;
    height: 100%;
    margin: 0; padding: 0;
    list-style: none;
}

.nav-links a {
    text-decoration: none !important;
    height: 100%;
}

.nav-links li {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 15px !important;
    color: #ffffff !important;
    font-size: 12px;
    font-weight: 500;
    border-bottom: none !important;
    transition: all 0.2s ease;
}

.nav-links li i {
    margin-right: 6px;
    font-size: 18px;
    color: #ffffff !important;
}

.nav-links li.active {
    background-color: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 -3px 0 0 #d19b3d;
}

.nav-links li:hover {
    background-color: #3d464f;
}

/* Period & View Controls */
.nav-controls {
    display: flex;
    align-items: center;
    height: 100%;
}

.input-group-nav {
    display: flex;
    align-items: center;
    background: #23282e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0 10px;
    height: 38px;
    transition: all 0.3s ease;
}

.input-group-nav:hover { border-color: #d19b3d; }
.input-group-nav i { color: #9da6af; font-size: 16px; margin-right: 8px; }

.input-group-nav select {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    padding-right: 20px;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right center;
    background-size: 18px;
}

.nav-toggle-form {
    height: 100%;
    display: flex;
    align-items: center;
}

.btn-group-nav {
    display: flex;
    background: #1e2227;
    padding: 3px;
    border-radius: 8px;
    margin-right: 5px;
}

.nav-toggle-btn {
    display: flex !important;
    flex-direction: column !important;
    align-items: center;
    justify-content: center;
    line-height: 1;
    min-width: 65px;
    height: 100%;
    padding: 2px 8px !important;
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-toggle-btn i { font-size: 18px !important; margin-bottom: 2px; }
.nav-toggle-btn span { font-size: 9px !important; text-transform: uppercase; white-space: nowrap; }

.nav-toggle-btn.active {
    background: #4a5568;
    color: #fff !important;
}

/* View Mode Toggles */
.dashboard-view-toggle-bar {
    margin-bottom: 0 !important;
    align-self: center;
}

.dashboard-view-toggle-bar form {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.dashboard-view-toggle-bar .toggle-btn {
    background-color: #434d58 !important;
    color: #cbd5e0 !important;
    border: 1px solid #4a5568 !important;
    transition: all 0.2s ease;
}

.dashboard-view-toggle-bar .toggle-btn:hover { background-color: #f0f0f0 !important; }

.dashboard-view-toggle-bar .toggle-btn.active {
    background-color: #2e353d !important;
    color: #fff !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    border-color: #d19b3d !important;
}

/* ==========================================================================
   4. TABLES (GENERIC & COMPACT)
   ========================================================================== */
.table-container {
    width: 100%;
    overflow-x: auto;
}

#table-formation {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

#table-formation th,
#table-formation td {
    padding: 10px;
    text-align: center;
    border: 1px solid #ddd;
}

#table-formation td { min-width: 110px; }

#table-formation th {
    background-color: #f9f9f9;
    border: solid 3px #ddd;
    color: #7a7a7a;
    white-space: nowrap;
    vertical-align: middle;
}

.cellules-table td:nth-child(3) {
    word-break: normal;
    overflow-wrap: break-word;
    min-width: 250px;
}

.category-header-title {
    color: #2c3e50;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.category-group-wrapper .table-formation {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* Category View Specifics */
.lms-compact-grid th {
    background-color: #f1f3f5 !important;
    border-bottom: 2px solid #dee2e6 !important;
    color: #495057 !important;
    text-transform: uppercase;
    font-size: 11px;
}

.lms-compact-grid .cellules-table:hover td {
    background-color: #f8f9fa !important;
}

/* ==========================================================================
   5. UI COMPONENTS (BADGES, PROGRESS BARS, TOOLTIPS)
   ========================================================================== */
/* Progress Bars */
.progress {
    height: 14px;
    background-color: #e9ecef;
    border-radius: 5px;
    margin-bottom: 0;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    transition: width 0.6s ease;
    line-height: 14px;
    font-size: 11px;
}

.bg-success { background-color: #28a745; }
.bg-info    { background-color: #17a2b8; }
.bg-warning { background-color: #ffc107; }
.bg-danger  { background-color: #dc3545; }

.lms-bar-container {
    height: 6px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 4px;
    border: 1px solid #dee2e6;
}

.lms-bar-fill {
    height: 100%;
    transition: width 0.4s ease;
}

/* Badges */
.lms-badge {
    display: block;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 800;
    color: #fff;
    text-align: center;
}

.lms-badge-non-live { background-color: #5d6d7e; }
.lms-badge-live     { background-color: #17a2b8; }
.lms-badge-external { background-color: #f39c12; }
.lms-badge-dispense { background-color: #8e44ad; }

/* UDF Tooltips */
.udf-cell { cursor: help; }
.udf-tooltip-data { display: none; }

/* ==========================================================================
   6. FORMS & MODALS
   ========================================================================== */
#form-ajout {
    margin-left: 5%;
}

#form-ajout .form-line {
    padding-bottom: 4%;
}

#form-ajout .form-line label {
    width: 30%;
    text-align: left;
    font-size: 16px;
}

#form-ajout .form-line label span { color: red; }

#form-ajout .form-line input,
#form-ajout .form-line textarea {
    background-color: #ececec;
    border: solid 1px gray;
    box-shadow: 4px 4px 5px #C7C7C7;
    border-radius: 10px;
    padding: 5px 10px;
    width: 50%;
}

#form-ajout #duree_heures,
#form-ajout #duree_minutes {
    width: 50px;
    text-align: center;
}

#form-ajout #date { width: 160px; }

#form-ajout .ajout-numero-attestation {
    display: flex;
    align-items: center;
}

#form-ajout .ajout-numero-attestation textarea { height: 200px; }

#form-ajout .ajout-pieces-jointes {
    display: flex;
}

#form-ajout .ajout-pieces-jointes .input_piece_jointe {
    display: flex;
    flex-direction: column;
    padding-left: 5px;
    width: 70%;
}

#form-ajout .ajout-pieces-jointes #piece_jointe {
    background-color: unset;
    border: unset;
    box-shadow: unset;
    border-radius: unset;
    padding: unset;
    width: 100%;
}

#form-ajout .ajout-pieces-jointes span {
    opacity: 0.5;
    font-size: 14px;
    margin-top: 5px;
}

#form-ajout .ajout-button {
    text-align: end;
}

#form-ajout .ajout-button button {
    border: 0;
    color: white;
    padding: 2%;
    font-size: 20px;
    border-radius: 15px;
    width: 150px;
    cursor: pointer;
    transition: all ease 0.3s;
    background: #53c953;
}

#form-ajout .ajout-button button:hover { background-color: #329c32; }
#form-ajout .ajout-button button[disabled] { background-color: #789d73; cursor: not-allowed; }

/* Profil Page */
.profil-learner {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 800px;
}

.profil-learner-info {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #f8f9fa;
    padding-bottom: 10px;
}

.profil-learner-info label {
    width: 250px;
    margin: 0;
    font-weight: 600;
    color: #4a5568;
}

.profil-learner-info .info-value { flex: 1; }

.learner-profil-form-input {
    width: 100%;
    max-width: 400px;
    display: block;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 14px;
}

.disabled-field {
    background-color: #f1f3f5;
    color: #6c757d;
    border: 1px solid #dee2e6;
    cursor: not-allowed;
}

.editable-field {
    background-color: #ffffff;
    border: 2px solid #2e353d;
    color: #2e353d;
}

.editable-label { color: #2e353d !important; }

/* Error Handling */
.udf-field-error {
    color: #d9534f;
    font-size: 11px;
    display: none;
    margin-top: 2px;
    font-weight: 500;
}

.udf-input-calc.invalid {
    border-color: #d9534f !important;
    background-color: #fff8f8;
}

/* ==========================================================================
   7. ATTACHMENT DISPLAY & MANAGEMENT
   ========================================================================== */
.attachments {
    display: flex;
    align-items: center;
    text-align: left;
}

.attachments a {
    text-align: left;
    display: flex;
    align-items: center;
}

td.attachment-wrapper {
    border-bottom: 0 !important;
    display: flex;
    justify-content: space-between;
    border-left: 0 !important;
    border-right: 0 !important;
    margin-top: -1.5px;
    margin-bottom: -2px;
}

td.attachment-wrapper .attachment-list { min-width: 600px; }

.without-attachment-wrapper {
    border-bottom: 0 !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-left: 0 !important;
    border-right: 0 !important;
    margin-top: -1.5px;
    margin-bottom: -2px;
}

.without-attachment-wrapper p {
    text-align: center;
    width: 100%;
    font-size: 16px;
    color: black;
    font-weight: 500;
    margin: 0;
    min-width: 100px;
}

.without-attachment-no-waiting-wrapper {
    border-bottom: 0 !important;
}

.without-attachment-no-waiting-wrapper p {
    text-align: center;
    width: 100%;
    font-size: 16px;
    color: black;
    font-weight: 500;
    margin: 0;
    min-width: 100px;
}

/* ==========================================================================
   8. RESPONSIVE & MISC
   ========================================================================== */
@media (max-width: 768px) {
    #header-customer-dashboard { flex-direction: column; }
    .dashboard-global { border-right: none; border-bottom: 1px solid #e1e1e1; }
    #header-customer-automatique { gap: 50px; }
    .info-heures { width: 120px; }
    .info-heures .nombre-dheure { font-size: 15px; }
    .wrapper_a_pmi_learner_formation, .wrapper_a_pmi_learner { flex-direction: column; }
}

.summary-info {
    position: relative;
    margin-left: 6px;
    cursor: pointer;
}

.summary-tooltip {
    display: none;
    position: absolute;
    top: 120%;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    padding: 10px 12px;
    font-size: 11px;
    width: 200px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
    z-index: 10;
}

.summary-info:hover .summary-tooltip,
.summary-info:focus .summary-tooltip {
    display: block;
}

.dashboard-content-area {
    width: 75vw;
    padding: 20px;
}