/* RESET */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #0a0a0a;
    color: #e2e8f0;
    line-height: 1.6;
}

.app { min-height: 100vh; display: flex; flex-direction: column; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; width: 100%; }

/* MAIN */
.main { flex: 1; padding: 20px 0; background: #0a0a0a; }

/* DATE NAVIGATION */
.date-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}

.btn-nav {
    background: #e53e3e;
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-nav:hover {
    background: #c53030;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn-nav:active {
    transform: translateY(0);
}

.date-badge {
    background: #1a1a1a;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    color: #f7fafc;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    border: 1px solid #2d2d2d;
    min-width: 160px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
}

.date-badge:hover {
    background: #2d2d2d;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.5);
}

.calendar-icon {
    font-size: 16px;
    opacity: 0.7;
}

/* CALENDRIER PERSONNALISÉ */
.calendar-popup {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a1a;
    border: 1px solid #2d2d2d;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    padding: 20px;
    z-index: 1000;
    display: none;
    min-width: 320px;
}

.calendar-popup.active {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.calendar-title {
    font-weight: 700;
    font-size: 16px;
    color: #f7fafc;
    text-transform: capitalize;
}

.calendar-nav {
    background: #2d2d2d;
    border: none;
    color: #f7fafc;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.calendar-nav:hover {
    background: #e53e3e;
    color: white;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-bottom: 10px;
}

.calendar-day-name {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #a0aec0;
    padding: 8px 0;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.calendar-date {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    color: #f7fafc;
}

.calendar-date:hover {
    background: #2d2d2d;
}

.calendar-date.other-month {
    color: #4a5568;
}

.calendar-date.today {
    background: #e53e3e;
    color: white;
    font-weight: 700;
}

.calendar-date.selected {
    background: #c53030;
    color: white;
    font-weight: 700;
}

.calendar-footer {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #2d2d2d;
    display: flex;
    justify-content: center;
}

.btn-today {
    background: #2d2d2d;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #f7fafc;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-today:hover {
    background: #e53e3e;
    color: white;
}
.section {
    background: #1a1a1a;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
    border: 1px solid #2d2d2d;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.section-title { font-size: 14px; font-weight: 700; color: #f7fafc; }

/* BADGES */
.status-pill {
    background: #48bb78;
    color: white;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
}

.count-badge {
    background: #e53e3e;
    color: white;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
}

/* TEAM LIST */
.team-list { display: flex; flex-direction: column; gap: 8px; }

.team-member {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: #2d2d2d;
    border-radius: 6px;
    border-left: 3px solid #718096;
    transition: all 0.2s;
}

.team-member:hover { background: #3a3a3a; transform: translateX(2px); }

.team-member.chief {
    background: linear-gradient(135deg, #2d1a1a 0%, #3d2020 100%);
    border-left-color: #e53e3e;
    border-left-width: 3px;
}

.member-info { flex: 1; }

.member-role {
    display: inline-block;
    background: #718096;
    color: white;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.team-member.chief .member-role { background: #e53e3e; }

.member-name {
    font-size: 13px;
    font-weight: 700;
    color: #f7fafc;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.member-grade { color: #a0aec0; font-size: 11px; }

.member-badge {
    display: inline-block;
    background: #e53e3e;
    color: white;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.member-fonctions {
    margin-top: 8px;
}

/* WARNING ICON */
.warning-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    transition: transform 0.2s;
}

.warning-icon:hover {
    transform: scale(1.2);
}

.warning-tooltip {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 8px;
    background: #2d3748;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 400;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 100;
}

.warning-tooltip::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: #2d3748;
}

.warning-icon:hover .warning-tooltip,
.warning-icon:active .warning-tooltip {
    opacity: 1;
    pointer-events: auto;
}

.warning-tooltip div {
    padding: 4px 0;
}

.warning-tooltip div:not(:last-child) {
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding-bottom: 6px;
    margin-bottom: 6px;
}

.warning-tooltip strong {
    display: block;
    margin-bottom: 2px;
    color: #ffd700;
}

/* REPLACEMENTS */
.replacements-list { display: flex; flex-direction: column; gap: 8px; }

.replacement-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #2d2520;
    border-left: 3px solid #ed8936;
    border-radius: 5px;
    gap: 10px;
}

.replacement-names { font-weight: 600; color: #f7fafc; flex: 1; font-size: 12px; }
.arrow { color: #ed8936; font-weight: 700; }

.replacement-time {
    background: #1a1a1a;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 600;
    color: #cbd5e0;
    font-size: 11px;
    white-space: nowrap;
}

.empty-message {
    text-align: center;
    color: #a0aec0;
    padding: 20px;
    font-size: 12px;
}

/* FORM */
.form { display: flex; flex-direction: column; gap: 12px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-weight: 600; font-size: 11px; color: #cbd5e0; }

.form-group input,
.form-group select {
    padding: 8px 10px;
    border: 2px solid #2d2d2d;
    border-radius: 5px;
    font-size: 12px;
    transition: all 0.2s;
    font-family: inherit;
    background: #1a1a1a;
    color: #e2e8f0;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #e53e3e;
    box-shadow: 0 0 0 2px rgba(229, 62, 62, 0.1);
}

.btn-submit {
    padding: 9px 20px;
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(229, 62, 62, 0.3);
}

.btn-submit:active { transform: translateY(0); }

/* FOOTER */
.footer {
    background: #000000;
    color: #cbd5e0;
    margin-top: auto;
}

.footer-content {
    border-top: 3px solid #e53e3e;
    padding: 30px 0;
    text-align: center;
}

.footer-contact {
    font-size: 13px;
    color: #cbd5e0;
    margin: 0 0 20px 0;
    line-height: 1.6;
}

.footer-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-footer {
    padding: 10px 24px;
    border: 2px solid #2d2d2d;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    background: #1a1a1a;
    color: #cbd5e0;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-footer:hover {
    background: #2d2d2d;
    border-color: #e53e3e;
    color: #ffffff;
    transform: translateY(-2px);
}

.btn-admin {
    border-color: #e53e3e;
    color: #e53e3e;
}

.btn-admin:hover {
    background: #e53e3e;
    color: #ffffff;
}

.footer-bottom {
    background: #000000;
    padding: 20px 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-bottom .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.footer-bottom p {
    font-size: 12px;
    margin: 0;
    color: #718096;
}

.link-Slayxi {
    color: #e53e3e;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.link-Slayxi:hover {
    color: #fc8181;
    text-decoration: underline;
}

/* LOADING */
.loader { text-align: center; padding: 30px; color: #a0aec0; font-size: 14px; }

/* MODAL */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: #1a1a1a;
    border: 1px solid #2d2d2d;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #2d2d2d;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #f7fafc;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #a0aec0;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #2d2d2d;
    color: #e53e3e;
}

.modal-form {
    padding: 20px;
}

.modal-form textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .header-content { flex-direction: column; text-align: center; }
    .header-left { flex-direction: column; }
    .section { padding: 20px; }
    .section-header { flex-direction: column; align-items: flex-start; gap: 15px; }
    .form-row { grid-template-columns: 1fr; }
    .team-member { flex-direction: column; text-align: center; }
    .replacement-item { flex-direction: column; align-items: flex-start; }

    /* Bannières sur mobile */
    .alert-banner {
        margin: 10px auto;
        padding: 10px 15px;
        font-size: 12px;
        max-width: calc(100% - 30px);
        width: auto;
    }

    .alert-banner-icon {
        font-size: 16px;
    }
    
    /* Centrer le contenu des membres sur mobile */
    .member-info {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .member-name {
        justify-content: center;
    }
    
    /* Badges de fonctions plus compacts sur mobile */
    .fonction-badge {
        padding: 3px 8px;
        font-size: 9px;
        margin: 1px;
    }
    
    .member-fonctions {
        margin-top: 6px;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 2px;
    }
    
    .team-member.chief .member-fonctions {
        justify-content: center;
    }
}

/* ADMIN */
.admin-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.admin-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 450px;
    overflow: hidden;
}

.admin-header {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

.admin-header h1 { font-size: 28px; margin-bottom: 8px; }
.admin-header p { opacity: 0.9; }
.admin-body { padding: 40px; }

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error {
    background: #fed7d7;
    color: #c53030;
    border: 1px solid #fc8181;
}

.gestion-container { background: #f5f7fa; min-height: 100vh; }

.gestion-header {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    padding: 20px 0;
}

.gestion-header h1 { font-size: 28px; color: #1a202c; }

.tabs {
    display: flex;
    gap: 10px;
    background: white;
    padding: 0 20px;
    border-bottom: 2px solid #e2e8f0;
}

.tab-btn {
    padding: 15px 25px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-weight: 600;
    color: #718096;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 15px;
}

.tab-btn.active { color: #e53e3e; border-bottom-color: #e53e3e; }
.tab-content { display: none; padding: 30px 20px; }
.tab-content.active { display: block; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border-left: 4px solid #e53e3e;
}

.stat-card h3 {
    color: #718096;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.stat-value { font-size: 36px; font-weight: 700; color: #1a202c; }

.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    overflow: hidden;
}

.table-container table { width: 100%; border-collapse: collapse; }

.table-container th {
    background: #f7fafc;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #4a5568;
    font-size: 13px;
    text-transform: uppercase;
}

.table-container td { padding: 15px; border-top: 1px solid #e2e8f0; }
.table-container tr:hover { background: #f7fafc; }

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-danger { background: #e53e3e; color: white; }
.btn-danger:hover { background: #c53030; }
.btn-logout { background: #4a5568; color: white; }
.btn-logout:hover { background: #2d3748; }

.form-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

.form-section h3 { font-size: 20px; color: #1a202c; margin-bottom: 20px; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

/* LOGIN PAGE */
.login-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #0a0a0a;
    padding: 20px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 32px;
    color: #f7fafc;
    margin-bottom: 8px;
}

.login-header p {
    color: #a0aec0;
    font-size: 14px;
}

.login-container form {
    background: #1a1a1a;
    border: 1px solid #2d2d2d;
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.error-message {
    background: #2d1a1a;
    border: 2px solid #e53e3e;
    color: #fc8181;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 13px;
    max-width: 420px;
    width: 100%;
}

.btn-login {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(229, 62, 62, 0.4);
}

.back-link {
    text-align: center;
    margin-top: 20px;
}

.back-link a {
    color: #a0aec0;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
}

.back-link a:hover {
    color: #e53e3e;
}

.login-info {
    background: #1a1a1a;
    border: 1px solid #2d2d2d;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    max-width: 420px;
    width: 100%;
    font-size: 12px;
    color: #a0aec0;
    text-align: center;
}

.login-info code {
    background: #2d2d2d;
    padding: 2px 6px;
    border-radius: 3px;
    color: #e53e3e;
    font-family: 'Courier New', monospace;
}

/* BADGES DE FONCTIONS */
.fonction-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    margin: 2px;
    white-space: nowrap;
}

.fonction-suap {
    background: #22c55e;
    color: white;
}

.fonction-ca-vsav {
    background: #3b82f6;
    color: white;
}

.fonction-sr {
    background: #8b5cf6;
    color: white;
}

.fonction-ca-sr {
    background: #a855f7;
    color: white;
}

.fonction-inc {
    background: #ef4444;
    color: white;
}

.fonction-ca-inc {
    background: #dc2626;
    color: white;
}

.fonction-cond {
    background: #f59e0b;
    color: white;
}

.fonction-pl {
    background: #eab308;
    color: #1a1a1a;
}

.fonction-cdg {
    background: #e53e3e;
    color: white;
}

.fonction-prompt-secours {
    background: #10b981;
    color: white;
}

.fonction-cod0 {
    background: #06b6d4;
    color: white;
}

.fonction-default {
    background: #64748b;
    color: white;
}

.membre-fonctions {
    margin-top: 8px;
}

/* BANNIERES D'ALERTE */
.alert-banner {
    padding: 12px 20px;
    border-radius: 8px;
    margin: 15px auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    border: 2px solid;
    text-align: center;
    max-width: fit-content;
}

.alert-banner-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.alert-banner-message {
    flex: 1;
}

/* Banniere Info (developpement) */
.alert-banner.info {
    background: rgba(234, 179, 8, 0.1);
    border-color: rgba(234, 179, 8, 0.5);
    color: #eab308;
}

/* Banniere Warning (maintenance) */
.alert-banner.warning {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.5);
    color: #ef4444;
}

/* Banniere Success */
.alert-banner.success {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.5);
    color: #22c55e;
}
