/* =========================================================
   MASTER-SIP.CSS
   Fichier CSS principal regroupé.
   ========================================================= */


/* ===== master-sip/01-master-sip-global.css ===== */
/* =========================================================
   MASTER SIP - GLOBAL
   ========================================================= */

.sip-page {
    max-width: 1460px;
    margin: 0 auto;
    padding: 1.7rem clamp(0.7rem, 1.4vw, 1.25rem);
}

.sip-section {
    scroll-margin-top: 150px;
    margin-bottom: 2rem;
}

.sip-section-header {
    margin-bottom: 1.5rem;
}

.sip-section-header h2,
.sip-section-header h3 {
    color: tomato;
    margin-bottom: 0.4rem;
}

.sip-section-header h2 {
    font-size: 2rem;
}

.sip-section-header h3 {
    font-size: 1.4rem;
}

.sip-section-header p,
.sip-section-intro {
    color: #555;
}

.sip-section-intro {
    margin: 0 0 1.5rem;
    line-height: 1.6;
}

.sip-small-header {
    margin-top: 2rem;
}

.sip-card,
.sip-partner-card {
    background: rgba(255, 255, 255, 0.93);
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 18px;
    padding: 1.55rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.10);
    backdrop-filter: blur(8px);
}

.sip-button {
    display: inline-block;
    margin-top: 1rem;
    background: tomato;
    color: #fff;
    text-decoration: none;
    padding: 0.7rem 1.1rem;
    border: none;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
}

.sip-button:hover {
    background: #d9432f;
    color: #fff;
}

.sip-mini-button {
    border: none;
    border-radius: 999px;
    padding: 0.45rem 0.75rem;
    background: #111827;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.sip-mini-button:hover {
    background: tomato;
}

.sip-danger-button {
    background: #dc3545;
}

.sip-danger-button:hover {
    background: #b02a37;
}


/* ===== master-sip/02-master-sip-hero-banderolle-supprimee.css ===== */
/* =========================================================
   MASTER SIP - HERO / BANDEROLLE SUPPRIMEE
   ========================================================= */

.sip-hero {
    display: none !important;
}


/* ===== master-sip/03-master-sip-top-logo.css ===== */
/* =========================================================
   MASTER SIP - TOP LOGO
   ========================================================= */

.sip-logo-text {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    text-decoration: none;
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: #111827;
    white-space: nowrap;
}

.sip-logo-text span {
    color: tomato;
}

.sip-logo-text:hover {
    color: #111827;
}

.sip-logo-text:hover span {
    color: #d9432f;
}


/* ===== master-sip/04-master-sip-sub-nav.css ===== */
/* =========================================================
   MASTER SIP - SUB NAV
   ========================================================= */

.sip-subnav {
    position: sticky;
    top: 75px;
    z-index: 50;
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.9rem 1rem;
    background: #fff;
    border-bottom: 1px solid #eee;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
}

.sip-subnav a {
    color: #222;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    transition: background 0.2s ease, color 0.2s ease;
}

.sip-subnav a:hover,
.sip-subnav a.active {
    background: tomato;
    color: #fff;
}


/* ===== master-sip/05-master-sip-dropdown-sections-home.css ===== */
/* =========================================================
   MASTER SIP - DROPDOWN SECTIONS HOME
   ========================================================= */

.sip-dropdown-section {
    display: block;
    width: 100%;
}

.sip-dropdown-summary {
    list-style: none;
    cursor: pointer;
    width: fit-content;
    max-width: 100%;
    margin-bottom: 0.65rem;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.82);
    color: #fff;
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
    transition: background 0.2s ease, transform 0.2s ease, border-radius 0.2s ease;
}

.sip-dropdown-summary::-webkit-details-marker {
    display: none;
}

.sip-dropdown-summary::after {
    content: "⌄";
    display: inline-flex;
    margin-left: 0.55rem;
    font-weight: 900;
    transition: transform 0.2s ease;
}

.sip-dropdown-section[open] > .sip-dropdown-summary::after {
    transform: rotate(180deg);
}

.sip-dropdown-section[open] > .sip-dropdown-summary {
    background: rgba(255, 99, 71, 0.92);
    border-radius: 16px;
}

.sip-dropdown-summary:hover {
    background: rgba(255, 99, 71, 0.92);
    transform: translateY(-2px);
}

.sip-dropdown-summary span {
    font-size: 0.95rem;
    font-weight: 900;
}

.sip-dropdown-summary small {
    display: block;
    margin-top: 0.05rem;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.72rem;
    font-weight: 700;
}

.sip-dropdown-content {
    position: relative;
    animation: sipDropdownOpen 0.22s ease;
}

@keyframes sipDropdownOpen {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ===== master-sip/06-master-sip-editable-content.css ===== */
/* =========================================================
   MASTER SIP - EDITABLE CONTENT
   ========================================================= */

.sip-edit-banner {
    margin: 1rem 0;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    font-weight: 700;
}

.sip-editable-content h3 {
    color: #222;
    margin-top: 1.5rem;
    margin-bottom: 0.7rem;
}

.sip-editable-content h3:first-child {
    margin-top: 0;
}


/* ===== master-sip/07-master-sip-admin-tools.css ===== */
/* =========================================================
   MASTER SIP - ADMIN TOOLS
   ========================================================= */

.sip-admin-tools {
    margin: 1rem 0 1.5rem;
    padding: 1rem;
    border: 1px dashed rgba(255, 99, 71, 0.45);
    border-radius: 16px;
    background: rgba(255, 99, 71, 0.06);
}

.sip-admin-tools h3 {
    margin: 0 0 1rem;
    color: #111827;
}

.sip-admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.sip-admin-full {
    grid-column: 1 / -1;
}


/* ===== master-sip/08-master-sip-home-dashboard.css ===== */
/* =========================================================
   MASTER SIP - HOME DASHBOARD
   ========================================================= */

.sip-home-page {
    max-width: 1540px;
    width: 100%;
    min-height: calc(100vh - 75px);
    padding: 1.4rem clamp(1rem, 3vw, 2rem);
}

.sip-home-dropdown-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
    margin-bottom: 1.5rem;
}

.sip-home-block {
    min-width: 0;
}

.sip-home-block .sip-dropdown-summary {
    width: 100%;
    box-sizing: border-box;
}

.sip-home-block .sip-card,
.sip-home-block .sip-downloads-card {
    margin-top: 0.75rem;
}

.sip-home-block[open] {
    grid-column: span 4;
}

.sip-home-block[open] .sip-dropdown-content {
    width: 100%;
}

.sip-scroll-content {
    max-height: none;
    overflow: visible;
    padding-right: 0;
}

.sip-partners-section {
    margin-bottom: 0;
}

.sip-home-poster-section {
    width: 100%;
    margin-top: 1.5rem;
    border-radius: 24px;
    overflow: hidden;
    background: #f3f4f6;
    border: 1px solid #eee;
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.10);
}

.sip-home-poster-image {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.sip-home-edit-toggle {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: #111827;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 3;
}

.sip-home-edit-toggle:hover,
.sip-home-edit-toggle.active {
    background: tomato;
    transform: translateY(-2px);
}

.sip-home-edit-panel {
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px dashed rgba(255, 99, 71, 0.35);
}

.sip-home-edit-panel[hidden] {
    display: none;
}

.sip-inline-edit-form {
    display: grid;
    gap: 0.8rem;
}

.sip-inline-edit-form label,
.sip-partners-edit-form label {
    display: grid;
    gap: 0.4rem;
    font-weight: 700;
    color: #111827;
}

.sip-inline-edit-form textarea,
.sip-partners-edit-form input,
.sip-partners-edit-form textarea {
    width: 100%;
    padding: 0.75rem 0.85rem;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #222;
    font: inherit;
}

.sip-inline-edit-form textarea {
    min-height: 260px;
    resize: vertical;
}

.sip-partners-edit-form textarea {
    resize: vertical;
}


/* ===== master-sip/09-master-sip-downloads.css ===== */
/* =========================================================
   MASTER SIP - DOWNLOADS
   ========================================================= */

.sip-downloads-card {
    padding: 1rem;
    border-radius: 18px;
    background: rgba(17, 24, 39, 0.9);
    color: #fff;
    backdrop-filter: blur(8px);
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.18);
}

.sip-downloads-card p {
    margin: 0 0 1rem;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.9rem;
    line-height: 1.45;
}

.sip-download-link {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 0.7rem;
    align-items: center;
    padding: 0.75rem;
    margin-top: 0.65rem;
    border-radius: 14px;
    text-decoration: none;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: background 0.2s ease, transform 0.2s ease;
}

.sip-download-link:hover {
    background: tomato;
    color: #fff;
    transform: translateY(-2px);
}

.sip-download-link span {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: tomato;
    color: #fff;
    font-weight: 800;
    font-size: 0.78rem;
}

.sip-download-link:hover span {
    background: #fff;
    color: tomato;
}

.sip-download-link strong {
    font-size: 0.86rem;
    line-height: 1.25;
}

.sip-download-link small {
    font-weight: 800;
    opacity: 0.75;
    font-size: 0.72rem;
}


/* ===== master-sip/10-master-sip-partners.css ===== */
/* =========================================================
   MASTER SIP - PARTNERS
   ========================================================= */

.sip-partners-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
}

.sip-partner-card h4,
.sip-partner-card h3 {
    margin: 0;
    color: #222;
}

.sip-partner-card p {
    margin-bottom: 0;
    color: #444;
    line-height: 1.55;
}

.sip-partner-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 0.8rem;
}

.sip-partner-logo,
.sip-partner-logo-placeholder {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    border-radius: 15px;
}

.sip-partner-logo {
    display: block;
    object-fit: contain;
    object-position: center;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    padding: 0.35rem;
}

.sip-partner-logo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 99, 71, 0.1);
    color: tomato;
    font-weight: 900;
    text-transform: uppercase;
    border: 1px solid rgba(255, 99, 71, 0.2);
}

.sip-current-partner-image {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem;
    border-radius: 14px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

.sip-current-partner-image img {
    width: 54px;
    height: 54px;
    object-fit: contain;
    border-radius: 12px;
    background: #fff;
}

.sip-current-partner-image span {
    color: #555;
    font-weight: 700;
    font-size: 0.9rem;
}


/* ===== master-sip/11-master-sip-docx-content.css ===== */
/* =========================================================
   MASTER SIP - DOCX CONTENT
   ========================================================= */

.sip-docx-content {
    line-height: 1.75;
    color: #2b2b2b;
}

.sip-docx-content h2 {
    margin: 2.2rem 0 1rem;
    padding-bottom: 0.6rem;
    color: tomato;
    font-size: 1.7rem;
    border-bottom: 2px solid rgba(255, 99, 71, 0.18);
}

.sip-docx-content h2:first-child {
    margin-top: 0;
}

.sip-docx-content h3 {
    margin: 1.7rem 0 0.8rem;
    color: #111827;
    font-size: 1.25rem;
    font-weight: 700;
}

.sip-docx-content h4 {
    margin: 1.2rem 0 0.5rem;
    color: tomato;
    font-size: 1.05rem;
    font-weight: 700;
}

.sip-docx-content p {
    margin: 0 0 0.9rem;
    color: #444;
}

.sip-docx-content ul {
    margin: 0.7rem 0 1.2rem;
    padding-left: 1.4rem;
}

.sip-docx-content li {
    margin-bottom: 0.45rem;
    color: #444;
}

.sip-docx-content li::marker {
    color: tomato;
}

.sip-docx-content strong,
.sip-docx-content b {
    color: #111827;
}

.sip-docx-content a {
    color: tomato;
    font-weight: 600;
    text-decoration: none;
}

.sip-docx-content a:hover {
    text-decoration: underline;
}


/* ===== master-sip/12-master-sip-semester-tabs.css ===== */
/* =========================================================
   MASTER SIP - SEMESTER TABS
   ========================================================= */

.sip-semester-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.sip-semester-tab {
    border: none;
    border-radius: 999px;
    padding: 0.75rem 1.1rem;
    background: #111827;
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    transition: background 0.2s ease, transform 0.2s ease;
}

.sip-semester-tab:hover,
.sip-semester-tab.active {
    background: tomato;
    transform: translateY(-2px);
}

.sip-semester-panel {
    animation: sipDropdownOpen 0.22s ease;
}

.sip-semester-panel[hidden] {
    display: none;
}


/* ===== master-sip/13-master-sip-matieres.css ===== */
/* =========================================================
   MASTER SIP - MATIERES
   ========================================================= */

.sip-matieres-wrapper {
    position: relative;
}

.sip-master-block {
    margin-bottom: 3rem;
}

.sip-master-title {
    margin: 0 0 0.8rem;
    color: #111827;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.sip-master-title::after {
    content: "";
    display: block;
    width: 70px;
    height: 4px;
    margin-top: 0.5rem;
    border-radius: 999px;
    background: tomato;
}

.sip-semester-block {
    margin-bottom: 2.2rem;
}

.sip-semester-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.sip-semester-title {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    background: #111827;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 800;
}

.sip-add-subject-toggle {
    border: none;
    border-radius: 999px;
    padding: 0.55rem 0.9rem;
    background: tomato;
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.sip-add-subject-toggle:hover,
.sip-add-subject-toggle.active {
    background: #d9432f;
    transform: translateY(-2px);
}

.sip-subject-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.2rem;
    align-items: stretch;
}

.sip-subject-card {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 1.2rem;
    border-radius: 18px;
    background: #fff;
    border: 1px solid #eee;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.06);
    align-self: stretch;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sip-subject-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.1);
}

.sip-subject-card-content {
    flex: 1;
}

.sip-subject-card h4 {
    margin: 0 2.3rem 0.6rem 0;
    color: tomato;
    font-size: 1.05rem;
    font-weight: 800;
}

.sip-subject-card p {
    margin: 0;
    color: #444;
    font-size: 0.92rem;
    line-height: 1.55;
}

.sip-subject-top-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0.15rem 0 0.9rem;
}

.sip-subject-top-meta span {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.08);
    color: #111827;
    font-size: 0.78rem;
    font-weight: 800;
}

.sip-subject-description {
    margin-top: 0.7rem;
}

.sip-subject-description h2,
.sip-subject-description h3 {
    font-size: 1.05rem;
    margin-top: 1rem;
}

.sip-subject-description p {
    font-size: 0.92rem;
}

.sip-subject-intervenants {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(17, 24, 39, 0.08);
}

.sip-subject-intervenants span {
    display: block;
    margin-bottom: 0.35rem;
    color: #6b7280;
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sip-subject-intervenants strong {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    max-width: 100%;
    color: #c2412d;
    font-size: 0.82rem;
    line-height: 1.4;
    font-weight: 800;
}

.sip-subject-intervenant-link {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 99, 71, 0.12);
    color: #c2412d;
    text-decoration: none;
    font-weight: 900;
}

.sip-subject-intervenant-link:hover {
    background: tomato;
    color: #fff;
}

.sip-subject-empty {
    padding: 1rem;
    border-radius: 16px;
    background: #f9fafb;
    border: 1px dashed #d1d5db;
    color: #666;
    font-weight: 600;
}


/* ===== master-sip/14-master-sip-matieres-edit.css ===== */
/* =========================================================
   MASTER SIP - MATIERES EDIT
   ========================================================= */

.sip-subject-edit-toggle {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: #111827;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 3;
}

.sip-subject-edit-toggle:hover,
.sip-subject-edit-toggle.active {
    background: tomato;
    transform: translateY(-2px);
}

.sip-subject-admin-panel,
.sip-add-subject-panel {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed rgba(255, 99, 71, 0.35);
}

.sip-subject-admin-panel[hidden],
.sip-add-subject-panel[hidden] {
    display: none;
}

.sip-add-subject-panel {
    margin-bottom: 1.2rem;
    padding: 1rem;
    border: 1px dashed rgba(255, 99, 71, 0.45);
    border-radius: 16px;
    background: rgba(255, 99, 71, 0.06);
}

.sip-subject-admin-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.8rem;
}

.sip-subject-admin-form label {
    display: grid;
    gap: 0.35rem;
    font-weight: 700;
    color: #111827;
    font-size: 0.9rem;
}

.sip-subject-admin-form input,
.sip-subject-admin-form textarea,
.sip-subject-admin-form select {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #222;
    font: inherit;
}

.sip-subject-admin-form textarea {
    resize: vertical;
}

.sip-subject-admin-form button[type="submit"] {
    grid-column: 1 / -1;
    justify-self: start;
    width: fit-content;
}

.sip-matieres-edit-form {
    display: grid;
    gap: 1.2rem;
}

.sip-matieres-edit-form label {
    display: grid;
    gap: 0.4rem;
    font-weight: 700;
    color: #111827;
}

.sip-matieres-edit-form input,
.sip-matieres-edit-form textarea {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #222;
    font: inherit;
}

.sip-semester-edit-block {
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px dashed rgba(255, 99, 71, 0.35);
}

.sip-semester-edit-block h4 {
    margin: 0 0 0.8rem;
    color: tomato;
}

.sip-subject-edit-row {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) 110px 110px;
    gap: 0.7rem;
    margin-bottom: 0.9rem;
    padding: 0.9rem;
    border-radius: 14px;
    background: rgba(17, 24, 39, 0.035);
}

.sip-subject-edit-row textarea {
    grid-column: 1 / -1;
    resize: vertical;
}


/* ===== master-sip/15-master-sip-teachers-categories.css ===== */
/* =========================================================
   MASTER SIP - TEACHERS CATEGORIES
   ========================================================= */

.sip-teacher-category {
    margin-bottom: 2.4rem;
}

.sip-teacher-category-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 1.8rem 0 1rem;
}

.sip-teacher-category-title {
    margin: 0;
    color: #111827;
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.sip-teacher-category-title::before {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 0.55rem;
    border-radius: 50%;
    background: tomato;
}

.sip-teacher-category-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.08);
    color: #111827;
    font-size: 0.78rem;
    font-weight: 900;
}

.sip-teacher-category-select {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #222;
    font: inherit;
}


/* ===== master-sip/16-master-sip-teachers.css ===== */
/* =========================================================
   MASTER SIP - TEACHERS
   ========================================================= */

.sip-teacher-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.25rem;
    align-items: start;
}

.sip-teacher-card {
    position: relative;
    display: grid;
    grid-template-columns: 145px minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 0.95rem;
    padding: 0.85rem 0.85rem 2.85rem;
    border-radius: 22px;
    background: #fff;
    border: 1px solid #eee;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.07);
    align-self: start;
    min-height: 185px;
    height: auto;
}

.sip-teacher-photo-wrap,
.sip-teacher-photo {
    width: 145px;
    height: 145px;
}

.sip-teacher-photo-wrap {
    grid-column: 1;
    grid-row: 1;
}

.sip-teacher-photo {
    display: block;
    border-radius: 18px;
    object-fit: cover;
    object-position: center;
    background: #f3f4f6;
    filter: grayscale(100%);
    transition: filter 0.25s ease, transform 0.25s ease;
}

.sip-teacher-card:hover .sip-teacher-photo {
    filter: grayscale(0%);
    transform: scale(1.015);
}

.sip-teacher-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #777;
    font-weight: 800;
    font-size: 1.7rem;
}

.sip-teacher-main {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sip-teacher-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    gap: 0.8rem;
    align-items: start;
}

.sip-teacher-identity {
    min-width: 0;
}

.sip-teacher-name-btn {
    display: inline;
    padding: 0;
    border: none;
    background: transparent;
    color: #111827;
    font: inherit;
    font-weight: 800;
    font-size: 1.04rem;
    text-align: left;
    cursor: pointer;
    line-height: 1.25;
}

.sip-teacher-name-btn:hover,
.sip-teacher-name-btn.active {
    color: tomato;
    text-decoration: underline;
}

.sip-teacher-subject {
    margin: 0.35rem 0 0;
    color: #666;
    font-size: 0.88rem;
    line-height: 1.35;
}

.sip-teacher-subject-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.35rem;
    margin-top: 0.4rem;
}

.sip-teacher-subject-link {
    color: #666;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
    line-height: 1.3;
    transition: color 0.2s ease, background 0.2s ease;
}

.sip-teacher-subject-link:hover {
    color: tomato;
    text-decoration: underline;
}

.sip-teacher-subject-separator {
    color: #aaa;
    margin: 0 0.25rem;
}

.sip-teacher-logo-box {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.sip-teacher-logo-box img {
    max-width: 82%;
    max-height: 82%;
    object-fit: contain;
}

.sip-teacher-details {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    margin-top: 0.95rem;
    padding-top: 0.95rem;
    border-top: 1px solid #eee;
}

.sip-teacher-details[hidden] {
    display: none;
}

.sip-teacher-email {
    margin: 0 0 0.55rem;
    font-size: 0.85rem;
    color: #444;
}

.sip-teacher-email a {
    color: tomato;
    font-weight: 700;
    text-decoration: none;
}

.sip-teacher-email a:hover {
    text-decoration: underline;
}

.sip-teacher-bio {
    margin: 0;
    color: #444;
    font-size: 0.9rem;
    line-height: 1.6;
    width: 100%;
}

.sip-teacher-arrow-toggle {
    position: absolute;
    right: 0.85rem;
    bottom: 0.75rem;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: #111827;
    color: #fff;
    font-size: 1rem;
    font-weight: 900;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

.sip-teacher-arrow-toggle:hover,
.sip-teacher-arrow-toggle.active {
    background: tomato;
}

.sip-teacher-arrow-toggle.active {
    transform: rotate(180deg);
}

.sip-teacher-card:target {
    outline: 3px solid rgba(255, 99, 71, 0.45);
    outline-offset: 4px;
}


/* ===== master-sip/17-master-sip-teacher-edit.css ===== */
/* =========================================================
   MASTER SIP - TEACHER EDIT
   ========================================================= */

.sip-add-teacher-zone {
    margin-bottom: 1.5rem;
}

.sip-add-teacher-toggle {
    border: none;
    border-radius: 999px;
    padding: 0.75rem 1.1rem;
    background: #111827;
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
    transition: background 0.2s ease, transform 0.2s ease;
}

.sip-add-teacher-toggle:hover,
.sip-add-teacher-toggle.active {
    background: tomato;
    transform: translateY(-2px);
}

#sip-add-teacher-panel[hidden] {
    display: none;
}

#sip-add-teacher-panel {
    margin-top: 1rem;
}

.sip-teacher-edit-toggle {
    position: absolute;
    top: 0.7rem;
    right: 0.7rem;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: #111827;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 3;
}

.sip-teacher-edit-toggle:hover,
.sip-teacher-edit-toggle.active {
    background: tomato;
    transform: translateY(-2px);
}

.sip-teacher-admin-form {
    display: grid;
    gap: 0.8rem;
}

.sip-teacher-admin-form label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-weight: 700;
    color: #111827;
    font-size: 0.9rem;
}

.sip-teacher-admin-form input,
.sip-teacher-admin-form textarea,
.sip-teacher-admin-form select {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #222;
    font: inherit;
}

.sip-teacher-admin-form select,
.sip-subject-admin-form select {
    cursor: pointer;
}

.sip-teacher-admin-form input[type="file"] {
    padding: 0.5rem;
}

.sip-teacher-admin-form textarea {
    resize: vertical;
}

.sip-teacher-admin-form .sip-button {
    justify-self: start;
    width: fit-content;
    margin-left: 0;
}

.sip-teacher-admin-panel {
    grid-column: 1 / -1;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed rgba(255, 99, 71, 0.35);
}

.sip-teacher-admin-panel[hidden] {
    display: none;
}

.sip-teacher-admin-actions,
.sip-matiere-admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.8rem;
}


/* ===== master-sip/18-master-sip-evaluation-table.css ===== */
/* =========================================================
   MASTER SIP - EVALUATION TABLE
   ========================================================= */

.sip-table-wrapper {
    overflow-x: auto;
    background: #fff;
    border-radius: 18px;
    border: 1px solid #eee;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

.sip-evaluation-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

.sip-evaluation-table th,
.sip-evaluation-table td {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.sip-evaluation-table th {
    background: #111827;
    color: #fff;
    font-weight: 600;
}

.sip-evaluation-table tr:last-child td {
    border-bottom: none;
}


/* ===== master-sip/19-master-sip-excel-viewer.css ===== */
/* =========================================================
   MASTER SIP - EXCEL VIEWER
   ========================================================= */

.sip-excel-page {
    max-width: none;
    width: 100%;
    padding-left: clamp(0.5rem, 1vw, 1rem);
    padding-right: clamp(0.5rem, 1vw, 1rem);
}

.sip-excel-page .sip-section {
    width: 100%;
}

.sip-excel-viewer {
    width: 100%;
}

.sip-excel-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.sip-excel-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.sip-excel-tab {
    border: none;
    background: #f3f4f6;
    color: #222;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 700;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.sip-excel-tab:hover,
.sip-excel-tab.active {
    background: tomato;
    color: #fff;
    transform: translateY(-1px);
}

.sip-excel-status {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 14px;
    background: rgba(17, 24, 39, 0.05);
    color: #444;
    font-weight: 700;
}

.sip-excel-table-container {
    width: 100%;
    overflow: visible;
    max-height: none;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

.sip-excel-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    border-collapse: collapse;
    background: white;
    font-size: clamp(0.58rem, 0.72vw, 0.88rem);
}

.sip-excel-table tr {
    position: relative;
}

.sip-excel-table td,
.sip-excel-table th {
    position: relative;
    min-width: 0 !important;
    width: auto !important;
    padding: clamp(0.25rem, 0.45vw, 0.55rem);
    border: 1px solid #d1d5db;
    color: #222;
    vertical-align: middle;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.sip-excel-table td[contenteditable="true"] {
    cursor: text;
}

.sip-excel-table td[contenteditable="true"]:hover {
    outline: 2px solid rgba(255, 99, 71, 0.25);
    outline-offset: -2px;
}

.sip-excel-cell-active {
    outline: 3px solid tomato !important;
    outline-offset: -3px;
    position: relative;
    z-index: 2;
}

.sip-excel-save-btn {
    margin-top: 0;
    white-space: nowrap;
}

.sip-excel-save-btn:disabled {
    opacity: 0.65;
    cursor: wait;
}

.sip-loading-text,
.sip-error-text {
    margin: 0;
    color: #555;
    font-weight: 700;
}

.sip-error-text {
    color: #dc3545;
}

.sip-excel-col-resizer {
    position: absolute;
    top: 0;
    right: -3px;
    width: 7px;
    height: 100%;
    cursor: col-resize;
    z-index: 5;
    user-select: none;
}

.sip-excel-col-resizer:hover {
    background: rgba(255, 99, 71, 0.35);
}

.sip-excel-row-resizer {
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 100%;
    height: 7px;
    cursor: row-resize;
    z-index: 6;
    user-select: none;
}

.sip-excel-row-resizer:hover {
    background: rgba(255, 99, 71, 0.35);
}

body.sip-resizing-excel {
    user-select: none;
    cursor: col-resize;
}

body.sip-resizing-excel-row {
    user-select: none;
    cursor: row-resize;
}


/* ===== master-sip/20-master-sip-projects.css ===== */
/* =========================================================
   MASTER SIP - PROJECTS
   ========================================================= */

.sip-projects-page {
    max-width: 1280px;
}

.sip-projects-controls {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-radius: 18px;
    background: rgba(17, 24, 39, 0.04);
    border: 1px solid rgba(17, 24, 39, 0.08);
}

.sip-projects-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.sip-project-filter {
    border: none;
    border-radius: 999px;
    padding: 0.55rem 0.9rem;
    background: #111827;
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.sip-project-filter:hover,
.sip-project-filter.active {
    background: tomato;
    transform: translateY(-2px);
}

.sip-projects-search-zone {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.sip-project-search-input {
    min-width: 230px;
    padding: 0.7rem 0.9rem;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #222;
    font: inherit;
}

.sip-projects-count {
    color: #555;
    font-weight: 800;
    white-space: nowrap;
}

.sip-projects-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.4rem;
}

.sip-project-card {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    background: #fff;
    border: 1px solid #eee;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.07);
    animation: sipProjectAppear 0.35s ease both;
}

.sip-project-open-area {
    display: block;
    color: inherit;
    text-decoration: none;
}

@keyframes sipProjectAppear {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sip-project-image {
    position: relative;
    height: 230px;
    background: #f3f4f6;
    overflow: hidden;
}

.sip-project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.sip-project-card:hover .sip-project-image img {
    transform: scale(1.06);
}

.sip-project-featured,
.sip-project-year {
    position: absolute;
    top: 0.8rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 900;
    backdrop-filter: blur(8px);
}

.sip-project-featured {
    left: 0.8rem;
    background: rgba(255, 255, 255, 0.9);
    color: tomato;
}

.sip-project-year {
    right: 0.8rem;
    background: rgba(17, 24, 39, 0.82);
    color: #fff;
}

.sip-project-content {
    padding: 1rem;
}

.sip-project-content h3 {
    margin: 0;
    color: #111827;
    font-size: 1.05rem;
    font-weight: 900;
    line-height: 1.35;
}

.sip-project-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 1rem;
    background: linear-gradient(
        to top,
        rgba(17, 24, 39, 0.92),
        rgba(17, 24, 39, 0.25),
        transparent
    );
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.sip-project-card:hover .sip-project-overlay {
    opacity: 1;
    pointer-events: auto;
}

.sip-project-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.55rem;
    transform: translateY(10px);
    transition: transform 0.25s ease;
}

.sip-project-card:hover .sip-project-actions {
    transform: translateY(0);
}

.sip-project-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 82px;
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    background: tomato;
    color: #fff;
    text-decoration: none;
    font-weight: 900;
    font-size: 0.85rem;
}

.sip-project-btn:hover {
    background: #fff;
    color: tomato;
}

.sip-project-empty-state,
.sip-project-loading {
    text-align: center;
}

.sip-project-empty-state h3 {
    margin-top: 0;
    color: #111827;
}

.sip-project-empty-state p,
.sip-project-loading p {
    margin-bottom: 0;
    color: #555;
}


/* ===== master-sip/21-master-sip-highlights.css ===== */
/* =========================================================
   MASTER SIP - HIGHLIGHTS
   ========================================================= */

.sip-subject-card-highlight {
    outline: 3px solid tomato;
    outline-offset: 4px;
    animation: sipSubjectHighlight 1.8s ease;
}

@keyframes sipSubjectHighlight {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(255, 99, 71, 0);
    }

    35% {
        transform: scale(1.025);
        box-shadow: 0 0 0 8px rgba(255, 99, 71, 0.16);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.06);
    }
}


/* ===== master-sip/22-master-sip-responsive.css ===== */
/* =========================================================
   MASTER SIP - RESPONSIVE
   ========================================================= */

@media (min-width: 1500px) {
    .sip-page {
        max-width: 1540px;
    }

    .sip-teacher-grid {
        gap: 1.25rem;
    }

    .sip-teacher-card {
        grid-template-columns: 150px minmax(0, 1fr);
        min-height: 174px;
    }

    .sip-teacher-photo-wrap,
    .sip-teacher-photo {
        width: 150px;
        height: 150px;
    }
}

@media (max-width: 1320px) {
    .sip-teacher-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1150px) {
    .sip-teacher-card {
        grid-template-columns: 130px minmax(0, 1fr);
    }

    .sip-teacher-photo-wrap,
    .sip-teacher-photo {
        width: 130px;
        height: 130px;
    }
}

@media (max-width: 1050px) {
    .sip-home-dropdown-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sip-home-block[open] {
        grid-column: span 2;
    }

    .sip-projects-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sip-projects-controls {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 1000px) {
    .sip-teacher-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 950px) {
    .sip-subject-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sip-subject-admin-form {
        grid-template-columns: 1fr;
    }

    .sip-subject-edit-row {
        grid-template-columns: 1fr;
    }

    .sip-subject-edit-row textarea {
        grid-column: auto;
    }
}

@media (max-width: 900px) {
    .sip-partners-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sip-subnav {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .sip-subnav a {
        white-space: nowrap;
    }
}

@media (max-width: 700px) {
    .sip-admin-grid {
        grid-template-columns: 1fr;
    }

    .sip-semester-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .sip-semester-tabs {
        flex-direction: column;
    }

    .sip-semester-tab {
        width: 100%;
        text-align: left;
    }
}

@media (max-width: 650px) {
    .sip-teacher-grid {
        grid-template-columns: 1fr;
    }

    .sip-teacher-card {
        grid-template-columns: 110px minmax(0, 1fr);
    }

    .sip-teacher-photo-wrap,
    .sip-teacher-photo {
        width: 110px;
        height: 110px;
    }

    .sip-projects-grid {
        grid-template-columns: 1fr;
    }

    .sip-project-search-input {
        min-width: 0;
        width: 100%;
    }

    .sip-projects-search-zone {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .sip-home-dropdown-row {
        grid-template-columns: 1fr;
    }

    .sip-home-block[open] {
        grid-column: span 1;
    }

    .sip-partners-grid,
    .sip-subject-grid {
        grid-template-columns: 1fr;
    }

    .sip-home-page {
        padding: 1.2rem 1rem;
    }

    .sip-page {
        padding: 2rem 1rem;
    }

    .sip-section-header h2 {
        font-size: 1.6rem;
    }

    .sip-master-title {
        font-size: 1.6rem;
    }

    .sip-scroll-content {
        max-height: none;
    }

    .sip-dropdown-summary {
        width: 100%;
        box-sizing: border-box;
    }

    .sip-home-poster-section {
        border-radius: 18px;
    }
}


/* ===== master-sip/23-promotion-sip.css ===== */
/* =========================================================
   PROMOTION SIP
   ========================================================= */

.sip-promotion-page .sip-add-teacher-zone {
    margin-top: 1rem;
}

.sip-promotion-year {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin: 0.3rem 0 0.8rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 99, 71, 0.12);
    color: #c43d28;
    font-weight: 700;
}

.sip-promotion-student-card {
    padding-bottom: 0.85rem;
}

.sip-promotion-student-card .sip-teacher-main {
    justify-content: flex-start;
}

.sip-promotion-student-name {
    margin: 0;
    color: #111827;
    font-size: 1.04rem;
    font-weight: 800;
    line-height: 1.25;
}

.sip-promotion-small-info {
    margin: 0.45rem 0 0;
    color: #666;
    font-size: 0.92rem;
    line-height: 1.35;
}

.sip-promotion-company-logo-zone {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 48px;
    margin-top: 0.65rem;
    margin-bottom: 0.45rem;
}

.sip-promotion-company-logo-zone img {
    display: block;
    max-width: 110px;
    max-height: 46px;
    object-fit: contain;
    object-position: left center;
}

.sip-promotion-company-logo-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 110px;
    min-height: 42px;
    padding: 0.4rem 0.65rem;
    border-radius: 12px;
    background: #f3f4f6;
    border: 1px dashed #d1d5db;
    color: #777;
    font-size: 0.78rem;
    font-weight: 800;
}

/* Footer sous toute la carte : entreprise + mail */
.sip-promotion-student-footer {
    grid-column: 1 / -1;
    width: 100%;
    margin-top: 0.2rem;
    padding-top: 0.85rem;
    border-top: 1px solid #eee;
}

.sip-promotion-student-footer .sip-promotion-small-info,
.sip-promotion-student-footer .sip-teacher-email {
    margin: 0 0 0.45rem;
}

.sip-promotion-student-footer .sip-teacher-email:last-child,
.sip-promotion-student-footer .sip-promotion-small-info:last-child {
    margin-bottom: 0;
}

.sip-promotion-student-footer .sip-teacher-email {
    color: #444;
    font-size: 0.85rem;
}

.sip-promotion-student-footer .sip-teacher-email a {
    color: tomato;
    font-weight: 700;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.sip-promotion-student-footer .sip-teacher-email a:hover {
    text-decoration: underline;
}

/* Les cartes étudiants ne sont plus déroulables */
.sip-promotion-student-card .sip-teacher-arrow-toggle,
.sip-promotion-student-card .sip-teacher-details {
    display: none !important;
}

/* Logo entreprise non grisé au hover */
.sip-promotion-student-card .sip-promotion-company-logo-zone img {
    filter: none;
    transform: none;
}

.sip-promotion-student-card:hover .sip-promotion-company-logo-zone img {
    filter: none;
    transform: none;
}

@media (max-width: 650px) {
    .sip-promotion-company-logo-zone {
        min-height: 42px;
    }

    .sip-promotion-company-logo-zone img {
        max-width: 100px;
        max-height: 42px;
    }

    .sip-promotion-company-logo-placeholder {
        min-width: 100px;
        min-height: 38px;
    }
}

/* =========================================================
   PROMOTION SIP - HAUTEURS UNIFORMES
   =========================================================
   Sur la page Promotion uniquement, les cartes étudiants doivent
   s'étirer à la même hauteur dans chaque ligne de la grille.
   Les cartes enseignants classiques ne sont pas modifiées.
*/

.sip-promotion-page .sip-teacher-grid {
    align-items: stretch;
}

.sip-promotion-page .sip-promotion-student-card {
    align-self: stretch;
    height: 100%;
    grid-template-rows: auto 1fr;
}

.sip-promotion-page .sip-promotion-student-footer {
    align-self: end;
}

/* Indication discrète dans les panneaux d'administration SIP. */
.sip-admin-hint {
    width: 100%;
    margin: 0;
    font-size: 0.82rem;
    color: #667085;
}

/* =========================================================
   AJOUTS SIP - ENSEIGNANTS / CALENDRIERS
   ========================================================= */

.sip-teacher-secondary-logo-zone {
    margin-top: 0.55rem;
    width: 100%;
    min-height: 54px;
    border-radius: 14px;
    background: #f8f9fa;
    border: 1px dashed #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem;
    color: #999;
    font-size: 0.78rem;
    font-weight: 800;
}

.sip-teacher-secondary-logo-zone img {
    max-width: 100%;
    max-height: 48px;
    object-fit: contain;
}

.sip-teacher-subject-link {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.12rem 0.45rem;
    background: rgba(255, 99, 71, 0.08);
}

.sip-subject-highlight,
.sip-subject-card-highlight {
    animation: sipSubjectGlow 2s ease;
}

@keyframes sipSubjectGlow {
    0% {
        box-shadow: 0 0 0 rgba(255, 99, 71, 0);
        transform: scale(1);
    }

    20% {
        box-shadow: 0 0 0 8px rgba(255, 99, 71, 0.24);
        transform: scale(1.015);
    }

    100% {
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.07);
        transform: scale(1);
    }
}

.sip-calendar-accordion-list {
    display: grid;
    gap: 1rem;
}

.sip-calendar-accordion {
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.sip-calendar-accordion summary {
    cursor: pointer;
    padding: 1rem 1.2rem;
    font-weight: 900;
    font-size: 1.08rem;
    color: #111827;
    background: #f8f9fa;
}

.sip-calendar-accordion[open] summary {
    color: tomato;
    border-bottom: 1px solid #eee;
}

.sip-calendar-accordion .sip-excel-viewer {
    padding: 1rem;
}

.sip-calendar-download-zone {
    padding: 0 1rem 1rem;
}

.sip-calendar-page .sip-excel-table-container {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    max-height: none;
}

.sip-calendar-page .sip-excel-table {
    width: max-content;
    min-width: 100%;
    table-layout: auto;
    font-size: clamp(0.82rem, 0.92vw, 1rem);
}

.sip-calendar-page .sip-excel-table td,
.sip-calendar-page .sip-excel-table th {
    min-width: 30px !important;
    width: auto !important;
    padding: 0.16rem 0.28rem;
    line-height: 1.12;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
    font-size: clamp(0.82rem, 0.92vw, 1rem) !important;
}

/* =========================================================
   CALENDRIERS SIP - GESTION DYNAMIQUE
   ========================================================= */

.sip-calendar-admin-box {
    margin-bottom: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.sip-calendar-admin-box summary {
    cursor: pointer;
    padding: 1rem 1.2rem;
    font-weight: 800;
    background: #f8f9fa;
}

.sip-calendar-admin-form,
.sip-calendar-admin-actions {
    display: grid;
    gap: 0.8rem;
    padding: 1rem;
}

.sip-calendar-admin-form label,
.sip-calendar-admin-actions label {
    display: grid;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #374151;
}

.sip-calendar-admin-form input,
.sip-calendar-admin-actions input {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 0.55rem 0.7rem;
    font: inherit;
    background: #fff;
}

.sip-calendar-admin-actions {
    grid-template-columns: minmax(180px, 1fr) minmax(220px, 1fr) auto;
    align-items: end;
    border-bottom: 1px solid #f0f0f0;
}

.sip-calendar-title-form,
.sip-calendar-upload-form,
.sip-calendar-delete-form {
    display: flex;
    gap: 0.6rem;
    align-items: end;
    flex-wrap: wrap;
}

.sip-calendar-title-form label,
.sip-calendar-upload-form label {
    flex: 1 1 180px;
}

.sip-excel-toolbar-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.sip-button-small {
    padding: 0.45rem 0.75rem;
    font-size: 0.82rem;
}

.sip-button-danger {
    background: #b91c1c !important;
    border-color: #b91c1c !important;
    color: #fff !important;
}

.sip-button-danger:hover {
    background: #991b1b !important;
    border-color: #991b1b !important;
}

.sip-empty-state {
    padding: 1.2rem;
    border: 1px dashed #d1d5db;
    border-radius: 18px;
    background: #f9fafb;
    color: #6b7280;
    font-weight: 700;
    text-align: center;
}

@media (max-width: 900px) {
    .sip-calendar-admin-actions {
        grid-template-columns: 1fr;
    }

    .sip-excel-toolbar-actions {
        justify-content: flex-start;
    }
}

/* =========================================================
   PATCH - NAVIGATION MATIERES / INTERVENANTS + ACCORDEONS HORIZONTAUX
   ========================================================= */

.sip-teacher-highlight,
.sip-target-highlight {
    animation: sipTeacherGlow 3s ease;
}

@keyframes sipTeacherGlow {
    0% {
        box-shadow: 0 0 0 rgba(255, 99, 71, 0);
        transform: scale(1);
    }

    20% {
        box-shadow: 0 0 0 8px rgba(255, 99, 71, 0.24);
        transform: scale(1.015);
    }

    100% {
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.07);
        transform: scale(1);
    }
}

.sip-horizontal-accordion-list {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.75rem;
}

.sip-horizontal-accordion-list .sip-horizontal-accordion {
    display: contents;
}

.sip-horizontal-accordion-summary {
    list-style: none;
    cursor: pointer;
    width: fit-content;
    max-width: 100%;
    margin: 0;
    padding: 0.7rem 1.05rem;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.86);
    color: #fff;
    font-weight: 900;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
    transition: background 0.2s ease, transform 0.2s ease, border-radius 0.2s ease;
}

.sip-horizontal-accordion-summary::-webkit-details-marker {
    display: none;
}

.sip-horizontal-accordion-summary::after {
    content: "⌄";
    display: inline-flex;
    margin-left: 0.55rem;
    font-weight: 900;
    transition: transform 0.2s ease;
}

.sip-horizontal-accordion[open] > .sip-horizontal-accordion-summary,
.sip-horizontal-accordion-summary:hover {
    background: tomato;
    transform: translateY(-2px);
}

.sip-horizontal-accordion[open] > .sip-horizontal-accordion-summary::after {
    transform: rotate(180deg);
}

.sip-horizontal-accordion-content {
    display: none;
}

.sip-horizontal-accordion[open] > .sip-horizontal-accordion-content {
    display: block;
    flex: 1 0 100%;
    width: 100%;
    margin-top: 0.25rem;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.07);
    animation: sipDropdownOpen 0.22s ease;
}

.sip-calendar-admin-box.sip-horizontal-accordion {
    display: block;
    width: fit-content;
    max-width: 100%;
    margin-bottom: 1rem;
    border: 0;
    box-shadow: none;
    overflow: visible;
    background: transparent;
}

.sip-calendar-admin-box.sip-horizontal-accordion[open] {
    width: 100%;
}

.sip-calendar-admin-box.sip-horizontal-accordion .sip-horizontal-accordion-content {
    margin-top: 0.75rem;
}

.sip-calendar-page .sip-calendar-accordion {
    border: 0;
    box-shadow: none;
    background: transparent;
    overflow: visible;
}

.sip-calendar-page .sip-calendar-accordion summary {
    border: 0;
}

@media (max-width: 760px) {
    .sip-horizontal-accordion-list {
        gap: 0.55rem;
    }

    .sip-horizontal-accordion-summary {
        width: 100%;
        justify-content: space-between;
        padding: 0.75rem 0.95rem;
    }
}

.sip-calendar-page .sip-calendar-accordion > .sip-horizontal-accordion-summary,
.sip-calendar-page .sip-calendar-admin-box > .sip-horizontal-accordion-summary {
    padding: 0.7rem 1.05rem;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.86);
    color: #fff;
    border-bottom: 0;
}

.sip-calendar-page .sip-calendar-accordion[open] > .sip-horizontal-accordion-summary,
.sip-calendar-page .sip-calendar-admin-box[open] > .sip-horizontal-accordion-summary,
.sip-calendar-page .sip-calendar-accordion > .sip-horizontal-accordion-summary:hover,
.sip-calendar-page .sip-calendar-admin-box > .sip-horizontal-accordion-summary:hover {
    background: tomato;
    color: #fff;
}


/* =========================================================
   PATCH ENSEIGNANTS - LOGO SOUS MATIÈRES ET CARTES STABLES
   ========================================================= */

.sip-teacher-grid {
    align-items: stretch;
}

.sip-teacher-card {
    align-self: stretch;
    height: 100%;
    min-height: 225px;
}

.sip-teacher-top {
    grid-template-columns: minmax(0, 1fr);
}

.sip-teacher-logo-box {
    display: none;
}

.sip-teacher-subject-links {
    gap: 0.35rem 0.45rem;
}

.sip-teacher-subject-link {
    max-width: 100%;
    padding: 0.16rem 0.6rem;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: anywhere;
}

.sip-teacher-secondary-logo-zone {
    min-height: 68px;
    margin-top: 0.7rem;
}

.sip-teacher-secondary-logo-zone img {
    max-height: 60px;
}


/* =========================================================
   PATCH ENSEIGNANTS - CARTES FERMÉES UNIFORMES / OUVERTES INDÉPENDANTES
   ========================================================= */

/* La grille ne force plus toute la ligne à suivre la carte ouverte. */
.sip-teacher-grid {
    align-items: start;
}

/* Carte fermée : hauteur minimale stable pour garder une ligne propre. */
.sip-teacher-card {
    align-self: start;
    height: auto;
    min-height: 235px;
}

/* Carte ouverte : elle grandit seule, sans agrandir les autres cartes de la ligne. */
.sip-teacher-card.sip-teacher-card--open {
    min-height: 0;
    height: auto;
}

/* Logo enseignant sous les matières : plus discret. */
.sip-teacher-secondary-logo-zone {
    min-height: 52px;
    margin-top: 0.55rem;
    padding: 0.35rem 0.5rem;
}

.sip-teacher-secondary-logo-zone img {
    max-height: 42px;
    max-width: 78%;
    object-fit: contain;
}

/* Matières : un peu plus d'espace horizontal pour éviter d'empiler les mots trop vite. */
.sip-teacher-subject-links {
    gap: 0.35rem 0.45rem;
}

.sip-teacher-subject-link {
    max-width: 190px;
    padding: 0.16rem 0.62rem;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
}

/* =========================================================
   MASTER SIP - PROJECTS DATED SECTIONS / ADMIN
   ========================================================= */

.sip-project-admin-section-box {
    margin-bottom: 1.25rem;
}

.sip-project-admin-section-box > summary,
.sip-project-add-project-box > summary {
    cursor: pointer;
    color: #111827;
    font-weight: 900;
}

.sip-project-section-create-form,
.sip-project-section-editor,
.sip-project-add-project-form,
.sip-project-delete-section-form {
    margin-top: 1rem;
}

.sip-project-section-create-grid,
.sip-project-upload-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.sip-project-admin-full {
    grid-column: 1 / -1;
}

.sip-project-section-create-form label,
.sip-project-section-editor label,
.sip-project-add-project-form label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    color: #333;
    font-weight: 800;
}

.sip-project-section-create-form input,
.sip-project-section-create-form textarea,
.sip-project-section-editor input,
.sip-project-section-editor textarea,
.sip-project-add-project-form input,
.sip-project-add-project-form textarea {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.72rem 0.85rem;
    background: #fff;
    color: #222;
    font: inherit;
    font-weight: 500;
}

.sip-project-section-create-form textarea,
.sip-project-section-editor textarea {
    resize: vertical;
    min-height: 120px;
}

.sip-project-create-instructions,
.sip-project-instructions-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-top: 1rem;
}

.sip-project-instruction-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.55rem;
    align-items: center;
}

.sip-project-instruction-row .sip-mini-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.sip-project-create-actions,
.sip-project-section-editor-actions,
.sip-project-section-projects-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.sip-project-date-filter span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.sip-project-section-header {
    margin-bottom: 1.25rem;
}

.sip-project-section-header h3 {
    margin: 0.25rem 0;
    color: #111827;
    font-size: 1.45rem;
}

.sip-project-section-header p {
    margin: 0;
    color: #555;
    font-weight: 700;
}

.sip-project-section-kicker {
    margin: 0;
    color: tomato !important;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
    font-weight: 900;
}

.sip-project-section-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    gap: 1.2rem;
    align-items: start;
}

.sip-project-section-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
}

.sip-project-section-editor,
.sip-project-delete-section-form {
    grid-column: 1 / -1;
}

.sip-project-section-editor {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.sip-project-section-details > .sip-project-section-editor {
    margin-top: 0;
}

.sip-project-section-editor-actions {
    grid-column: 1 / -1;
    margin-top: 0;
}

.sip-project-section-card {
    min-height: 100%;
}

.sip-project-section-card h4,
.sip-project-section-projects h4 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    color: tomato;
    font-size: 1.05rem;
}

.sip-project-section-card ol {
    margin: 0;
    padding-left: 1.25rem;
}

.sip-project-section-card li {
    margin-bottom: 0.65rem;
}

.sip-project-section-projects {
    min-width: 0;
    margin-top: 0;
}

.sip-project-section-projects-header h4,
.sip-project-section-projects-header p {
    margin-top: 0;
}

.sip-project-section-projects-header p {
    margin-bottom: 0;
    color: #555;
    font-weight: 700;
}

.sip-project-add-project-box {
    margin: 1rem 0;
    padding: 1rem;
    border: 1px dashed rgba(255, 99, 71, 0.45);
    border-radius: 16px;
    background: rgba(255, 99, 71, 0.05);
}

.sip-project-add-project-form {
    display: grid;
    gap: 1rem;
}

.sip-project-inline-check,
.sip-project-danger-check {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center;
    justify-content: flex-start;
    gap: 0.55rem !important;
}

.sip-project-inline-check input,
.sip-project-danger-check input {
    width: auto !important;
}

.sip-project-danger-check {
    margin-bottom: 0.75rem;
    color: #b02a37;
    font-weight: 800;
}

.sip-projects-grid-section {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sip-project-actions form {
    margin: 0;
}

.sip-project-btn-danger {
    border: none;
    cursor: pointer;
    background: #dc3545;
}

.sip-project-btn-danger:hover {
    background: #fff;
    color: #dc3545;
}

.sip-project-btn-secondary {
    background: #111827;
}

.sip-project-btn-secondary:hover {
    background: #fff;
    color: #111827;
}

.sip-project-detail-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    color: #555;
    font-weight: 800;
}

.sip-project-detail-breadcrumb a {
    color: tomato;
    text-decoration: none;
}

.sip-project-detail-breadcrumb a:hover {
    text-decoration: underline;
}

.sip-project-detail-layout {
    display: grid;
    grid-template-columns: minmax(280px, 2fr) minmax(0, 3fr);
    gap: 1.2rem;
    align-items: start;
}

.sip-project-detail-media,
.sip-project-detail-content {
    min-width: 0;
}

.sip-project-detail-image {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    background: #f3f4f6;
}

.sip-project-detail-image img {
    display: block;
    width: 100%;
    max-height: 460px;
    object-fit: cover;
}

.sip-project-detail-content h2 {
    margin: 0.25rem 0 0.4rem;
    color: #111827;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    line-height: 1.1;
}

.sip-project-detail-section-name {
    margin: 0 0 1rem;
    color: #555;
    font-weight: 800;
}

.sip-project-detail-description {
    color: #333;
    line-height: 1.7;
}

.sip-project-detail-description.muted {
    color: #777;
    font-style: italic;
}

.sip-project-detail-actions {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
    margin-top: 1.25rem;
}

.sip-project-detail-admin {
    margin-top: 1.25rem;
}

.sip-project-detail-admin > summary {
    cursor: pointer;
    color: #111827;
    font-weight: 900;
}

.sip-project-edit-form,
.sip-project-detail-delete-form {
    margin-top: 1rem;
}

.sip-project-edit-grid,
.sip-project-remove-media-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.sip-project-edit-form label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    color: #333;
    font-weight: 800;
}

.sip-project-edit-form input,
.sip-project-edit-form textarea {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.72rem 0.85rem;
    background: #fff;
    color: #222;
    font: inherit;
    font-weight: 500;
}

.sip-project-edit-form textarea {
    resize: vertical;
    min-height: 120px;
}

.sip-project-edit-feature-check {
    align-self: end;
    min-height: 48px;
}

.sip-project-remove-media-grid {
    margin-top: 1rem;
    padding: 0.9rem;
    border-radius: 14px;
    background: rgba(17, 24, 39, 0.04);
    border: 1px solid rgba(17, 24, 39, 0.08);
}

.sip-project-detail-delete-form {
    padding-top: 1rem;
    border-top: 1px solid rgba(17, 24, 39, 0.08);
}

@media (max-width: 1180px) {
    .sip-project-section-layout {
        grid-template-columns: 1fr;
    }

    .sip-project-detail-layout {
        grid-template-columns: 1fr;
    }

    .sip-projects-grid-section {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .sip-project-section-create-grid,
    .sip-project-upload-grid,
    .sip-project-section-details,
    .sip-project-section-editor,
    .sip-project-edit-grid,
    .sip-project-remove-media-grid,
    .sip-project-instruction-row {
        grid-template-columns: 1fr;
    }

    .sip-projects-grid-section {
        grid-template-columns: 1fr;
    }
}
