/* --- RESET ET BASE --- */
body, html {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    background-color: rgb(30, 0, 70) !important;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 600;
    overflow-x: hidden;
}

/* NAVBAR - hauteur 70px partout */
header.main-header {
    background: rgb(30, 0, 70) !important;
    border-bottom: 1px solid rgb(21, 0, 49) !important;
    width: 100%;
    height: 70px;
    min-height: 70px;
    max-height: 70px;
    display: flex;
    align-items: center;
    position: relative;
    top: 0;
    left: 0;
    z-index: 100;
    overflow: visible;
}

/* Corrige la hauteur du nav Bootstrap */
.navbar, .main-nav {
    min-height: 70px !important;
    height: 70px !important;
    max-height: 70px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    align-items: center !important;
}

/* Logo bien centré et taille adaptée */
.navbar-brand img {
    height: 56px;
    width: 56px;
    object-fit: cover;
    margin: 0;
    padding: 0;
    display: block;
}

/* Décale le contenu sous la navbar */
body {
    background: linear-gradient(135deg, #1e0046 0%, #22003a 100%) !important;
    color: #fff;
    padding-top: 10px;
    height: 100vh;      /* Fixe la hauteur à la taille de la fenêtre */
    min-height: unset;  /* Désactive le min-height */
    overflow-x: hidden;
    overflow-y: hidden; /* Empêche le scroll vertical inutile */
}

/* SUPPRIME les positions fixed/sticky inutiles */
.main-header {
    position: relative !important;
    top: 0 !important;
    width: 100%;
    z-index: 99;
    background: rgb(30, 0, 70) !important;
}

/* SUPPRIME le media query qui met .main-header en fixed ! */
@media (min-width: 992px) {
  .main-header {
    position: relative !important;
    top: 0 !important;
    background: rgb(30, 0, 70) !important;
  }
}

main {
  margin: 0px;
  padding: 0px;
}

h1 {
    color: rgb(0, 144, 180);
    user-select: none;
    cursor: default;
}

h2, h3, h4, h5, h6 {
    user-select: none;
    cursor: default;
}

p {
    color: rgb(0, 144, 180);
    user-select: none;
    cursor: default;
}

button {
    margin: 30px;
    text-decoration: none;
    background-color: rgb(16, 0, 31);
    size: 8px;
    padding: 10px 40px;
    border-radius: 20px;
    border: none;
    user-select: none;
    cursor: default;
}

a {
    text-decoration: none;
    color: rgb(0, 144, 180);
}

/* main-header start */
[data-target="#mainMenu"] {
  position: relative;
  z-index: 999;
}

#mainMenu li > a {
  font-size: 12px;
  letter-spacing: 1px;
  color: #fff;
  font-weight: 400;
  position: relative;
  z-index: 1;
  text-decoration: none;
}

.main-header.fixed-nav #mainMenu li > a {
  color: #fff;
  text-decoration: none;
}

#mainMenu li:not(:last-of-type) {
  margin-right: 30px;
}

#mainMenu li:last-child {
  margin-right: 0;
}

#mainMenu li > a::before {
  position: absolute;
  content: "";
  width: calc(100% - 1px);
  height: 1px;
  background: #fff;
  bottom: -6px;
  left: 0;

  -webkit-transform: scale(0, 1);
  -ms-transform: scale(0, 1);
  transform: scale(0, 1);
  -webkit-transform-origin: right center;
  -ms-transform-origin: right center;
  transform-origin: right center;
  z-index: -1;

  -webkit-transition: transform 0.5s ease;
  transition: transform 0.5s ease;
}

#mainMenu li > a:hover::before,
#mainMenu li > a.active::before {
  -webkit-transform: scale(1, 1);
  -ms-transform: scale(1, 1);
  transform: scale(1, 1);
  -webkit-transform-origin: left center;
  -ms-transform-origin: left center;
  transform-origin: left center;
}

.main-header.fixed-nav #mainMenu li > a::before {
  background: #000;
}

/* --- LAYOUT PROFIL --- */
.profile-bg {
    background: none;
    min-height: unset;
    width: 100vw;
    padding-top: 0;
}

.profile-layout {
    display: flex;
    width: 100%;
    min-height: calc(100vh - 70px);
    background: none;
}

/* --- SIDEBAR --- */
.profile-sidebar {
    background: #1a1333;
    color: #fff;
    min-width: 220px;
    max-width: 260px;
    padding: 2rem 1rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-right: 1px solid #2a0a4d;
}

/* Barre verticale de séparation */
.profile-separator {
    width: 1px;
    height: 100%;
    background: rgb(21, 0, 49);
}

/* --- CONTENU PROFIL --- */
.profile-main {
    flex: 1;
    padding: 2.5rem 3rem;
    background: none;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 3rem 2rem 2rem 2rem;
    overflow-y: auto;
}

/* --- AUTRES STYLES (inchangés) --- */
/* Cartes personnalisées pour l'accueil */
.custom-card {
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #22003a;
  border: 2px solid #5e3a7c;
  border-radius: 18px;
  color: #fff;
  padding: 32px 24px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
  transition: box-shadow 0.3s;
}
.custom-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}

/* Boutons personnalisés */
.custom-btn {
  background: #18002a;
  border: 2px solid #7e5bb7;
  color: #fff;
  border-radius: 14px;
  padding: 10px 32px;
  font-weight: 600;
  font-size: 1rem;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.custom-btn:hover, .custom-btn:focus {
  background: #2d0050;
  border-color: #b49ddb;
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
  color: #fff;
}

/* Pour que les boutons liens ne collent pas au bord de la carte */
.custom-card .custom-btn {
  margin-top: auto;
  margin-bottom: 24px;
  margin-left: 24px;
  width: max-content;
  align-self: flex-start;
}

/* Colonnes de même largeur et même hauteur */
.row.align-items-stretch > [class^="col-"] {
  display: flex;
}

.row.align-items-stretch {
  min-height: 350px; /* ajuste la valeur selon ton besoin */
}

.intro-section .mb-3[aria-hidden="true"] {
  user-select: none;
  cursor: default;
}

.navbar-nav .nav-profile-pic {
  display: flex;
  align-items: center;
  margin-left: 24px; /* espace à droite du menu */
}
.navbar-nav .nav-profile-pic img {
  display: block;
  margin: 0;
}

.navbar-toggler {
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
}
.navbar-toggler:focus {
  outline: none !important;
  box-shadow: none !important;
}
.navbar-toggler {
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

/* Ajoute à la fin du fichier */

.sidebar-custom {
    min-width: 220px;
    max-width: 260px;
    min-height: 100vh;
    background: #1a1333;
    border-right: 2px solid #2a0a4d;
    color: #fff;
    position: relative;
    z-index: 10;
}
.sidebar-custom .nav-link {
    color: #b9eaff;
    font-weight: 500;
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 4px;
    transition: background 0.2s, color 0.2s;
}
.sidebar-custom .nav-link.active,
.sidebar-custom .nav-link:focus,
.sidebar-custom .nav-link:hover {
    background: #2a0a4d;
    color: #00eaff !important;
}
.sidebar-custom .nav-link.text-danger {
    color: #ff4d4d !important;
}
.sidebar-custom .nav-link.text-danger:hover {
    background: #2a0a4d;
    color: #ffb3b3 !important;
}
.main-content-custom {
    margin-left: 220px;
    min-height: 100vh;
    background: transparent;
}

.profile-card {
    background: #22003a;
    border: 2px solid #5e3a7c;
    border-radius: 18px;
    color: #fff;
    padding: 32px 24px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.profile-card .profile-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.profile-card .profile-label {
    color: #b9eaff;
    font-weight: 600;
    font-size: 1.1rem;
    min-width: 120px;
}

.profile-card .profile-value {
    color: #fff;
    font-size: 1.1rem;
    flex: 1;
    margin-left: 1rem;
}

.profile-card .profile-edit-btn {
    background: #18002a;
    border: 2px solid #7e5bb7;
    color: #fff;
    border-radius: 10px;
    padding: 6px 18px;
    font-weight: 600;
    font-size: 1rem;
    margin-left: 1rem;
    transition: background 0.2s, border 0.2s;
}

.profile-card .profile-edit-btn:hover {
    background: #2d0050;
    border-color: #b49ddb;
    color: #fff;
}

.profile-card .profile-avatar {
    display: block;
    margin: 0 auto 1.5rem auto;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #00b4d8;
    background: #1a2332;
}

.profile-card input[type="text"],
.profile-card input[type="email"],
.profile-card input[type="file"] {
    background: #2a0a4d;
    color: #fff;
    border: 1px solid #7e5bb7;
    border-radius: 8px;
    padding: 8px 12px;
    width: 100%;
    margin-left: 1rem;
}

.profile-card input[type="text"]:focus,
.profile-card input[type="email"]:focus {
    outline: none;
    border-color: #00b4d8;
}

.profile-card .profile-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1rem;
}

.profile-card .profile-save-btn {
    background: #1677ff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 8px 28px;
    color: #fff;
    transition: background 0.2s;
}

.profile-card .profile-save-btn:hover {
    background: #0056b3;
}

.profile-card .profile-cancel-btn {
    background: #2a0a4d;
    border: 2px solid #7e5bb7;
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 8px 28px;
    transition: background 0.2s, border 0.2s;
}

.profile-card .profile-cancel-btn:hover {
    background: #18002a;
    border-color: #b49ddb;
}

/* Ajoute à la fin de style.css */
#profileMenu {
  min-width: 320px;
  background: #fff;
  color: #222;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  overflow: hidden;
  font-size: 1rem;
  top: 90px !important; /* descend encore plus le menu */
  border: 1px solid #eee;
  padding-bottom: 0.5rem;
}
#profileMenu .p-3 {
  padding-bottom: 0.5rem !important;
}
#profileMenu .dropdown-item {
  color: #222;
  padding-left: 1.2rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  font-size: 1.05rem;
  border-radius: 0;
  background: none;
  transition: background 0.15s;
}
#profileMenu .dropdown-item:hover {
  background: #f2f2f7;
  color: #00b4d8;
}
#profileMenu .dropdown-divider {
  height: 1px;
  background: #eee;
  margin: 0.5rem 0;
  border: none;
}
#profileMenu .text-danger {
  color: #d90429 !important;
  font-weight: 600;
}
#profileMenu .fw-bold {
  font-size: 1.15rem;
}
#profileMenu .small {
  color: #888 !important;
}
#profileMenu .dropdown-item.text-danger:hover {
  background: #ffeaea;
  color: #d90429 !important;
}

/* Modal overlay pour édition profil */
.profile-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(20, 20, 30, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.profile-modal-card {
    background: #22003a;
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    padding: 2.5rem 2.5rem 2.5rem 2.5rem;
    min-width: 600px;
    max-width: 98vw;
    color: #fff;
    position: relative;
    border: 2px solid #1677ff;
    animation: modalPop 0.2s;
}

@media (max-width: 700px) {
    .profile-modal-card {
        min-width: 95vw;
        padding: 1.2rem 0.7rem 1.2rem 0.7rem;
    }
}

/* Centrage horizontal parfait des boutons */
.profile-modal-card .profile-modal-actions,
.profile-modal-card .d-flex.gap-2.justify-content-end {
    display: flex !important;
    justify-content: center !important;
    gap: 2rem !important;
    margin-top: 1.5rem;
    width: 100%;
}

@keyframes modalPop {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.profile-modal-close {
    position: absolute;
    top: 0px;
    right: 30px;
    background: none;
    border: none;
    color: #1677ff;
    font-size: 2.5rem;
    cursor: pointer;
    z-index: 2;
    transition: color 0.2s;
    line-height: 1;
    font-weight: bold;
    padding: 0;
}
.profile-modal-close:hover {
    color: #00eaff;
}

.profile-modal-card button.profile-save-btn,
.profile-modal-card button.profile-cancel-btn {
    background: #18002a;
    border: 2px solid #7e5bb7;
    color: #00eaff;
    border-radius: 14px;
    padding: 10px 0;
    min-width: 180px;
    font-weight: 600;
    font-size: 1.15rem;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s, color 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-top: 0;
    margin-bottom: 0;
    margin-left: 0;
    margin-right: 0;
    width: max-content;
    align-self: flex-start;
    display: inline-block;
    text-align: center;
}

.profile-modal-card button.profile-save-btn:hover,
.profile-modal-card button.profile-cancel-btn:hover {
    background: #2d0050;
    border-color: #b49ddb;
    color: #fff;
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}

@media (max-width: 991px) {
    body {
        padding-top: 70px;
    }
    .profile-layout {
        flex-direction: column;
        height: auto;
        min-height: 0;
    }
    .profile-sidebar {
        position: static;
        min-width: 100vw;
        max-width: 100vw;
        width: 100vw;
        height: auto;
        border-right: none;
        border-bottom: 2px solid #2a0a4d;
        flex-direction: row !important;
        align-items: flex-start;
        padding: 1.5rem 0.5rem 1rem 0.5rem;
        top: 0;
    }
    .profile-separator {
        width: 100vw;
        height: 2px;
        min-height: 2px;
        background: #2a0a4d;
        box-shadow: 0 1px 8px #00000033;
    }
    .profile-main {
        margin-left: 0;
        padding: 1rem;
        height: auto;
    }
    .sidebar-custom {
        min-width: 100vw;
        max-width: 100vw;
        min-height: auto;
        border-right: none;
        border-bottom: 2px solid #2a0a4d;
        flex-direction: row !important;
        align-items: flex-start;
        padding: 1rem 0.5rem;
    }
    .sidebar-custom .nav {
        flex-direction: row !important;
        width: 100%;
        justify-content: space-around;
    }
    .sidebar-custom .nav-link {
        margin-bottom: 0;
        padding: 10px 8px;
        font-size: 1rem;
    }
    .main-content-custom {
        margin-left: 0;
        padding: 1rem;
    }
    .main-header .navbar-nav {
        margin-top: 90px !important;
    }
    .nav-profile-pic.d-lg-flex {
        display: none !important;
    }
    .nav-profile-pic img {
        margin: 0 auto;
    }
}

.profile-nav a {
    color: #00eaff;
    display: block;
    margin: 1.2rem 0;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}
.profile-nav a.active,
.profile-nav a:hover {
    color: #fff;
}

.profile-user {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
}
.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 0.7rem;
    background: #2a0a4d;
}
.profile-username {
    font-weight: bold;
    font-size: 1.2rem;
    color: #fff;
}

/* --- STYLES POUR LE SYSTEME DE TICKETS --- */

.tickets-header-bar {
    border-bottom: 2px solid #1677ff;
    margin-bottom: 1.5rem;
    margin-top: 0.5rem;
}
.tickets-sidebar-list {
    min-width: 320px;
    max-width: 340px;
    border-right: 1px solid #1677ff;
    padding-right: 0.5rem !important;
    padding-left: 0 !important;
    background: none;
}

.ticket-list-item {
    min-width: 380px;
    max-width: 480px;
    padding: 18px 22px 18px 28px;
    font-size: 1.15rem;
    white-space: normal;
}
.ticket-status {
    font-size: 0.95rem;
    margin-top: 2px;
}
.ticket-status.waiting { color: #ffc107; }
.ticket-status.working { color: #00eaff; }
.ticket-status.closed { color: #ff4d4d; }
.ticket-status.archived { color: #b9b9b9; }
.ticket-detail-label {
    color: #b9eaff;
    font-weight: 600;
    margin-right: 1.5rem;
}
.ticket-detail-value {
    color: #fff;
}
.ticket-messages-area {
    background: #181828;
    border-radius: 16px;
    padding: 2rem 1.5rem;
    margin-top: 1.5rem;
    min-height: 220px;
}
.ticket-message {
    margin-bottom: 1.2rem;
    display: flex;
    align-items: flex-start;
}
.ticket-message .avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 1rem;
}
.ticket-message-content {
    background: linear-gradient(90deg, #ff6600 0%, #ff9900 100%);
    color: #fff;
    border-radius: 10px;
    padding: 12px 18px;
    min-width: 120px;
    max-width: 70vw;
    font-size: 1rem;
    font-weight: 500;
}
.ticket-message.staff .ticket-message-content {
    background: linear-gradient(90deg, #1677ff 0%, #00eaff 100%);
}
.ticket-message-date {
    font-size: 0.9rem;
    color: #b9b9b9;
    margin-left: 1rem;
    margin-top: 0.2rem;
}
.ticket-send-area {
    display: flex;
    align-items: center;
    margin-top: 2rem;
    gap: 1rem;
}
.ticket-send-area input[type="text"] {
    flex: 1;
    border-radius: 10px;
    border: none;
    padding: 14px 18px;
    background: #2a0a4d;
    color: #fff;
    font-size: 1rem;
}
.ticket-send-btn {
    background: #ff6600;
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 1.7rem;
    width: 56px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.ticket-send-btn:hover {
    background: #00eaff;
    color: #181828;
}
.tickets-title {
    font-size: 2.2rem;
    color: #00eaff;
    font-weight: bold;
    margin-bottom: 0.2rem;
}
.tickets-conversation-title {
    font-size: 1.4rem;
    color: #fff;
    font-weight: 600;
    margin-bottom: 0.8rem;
}
.tickets-section {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
}
@media (max-width: 991px) {
    .tickets-section {
        max-width: 100vw;
        padding: 0 0.5rem;
    }
    .tickets-sidebar-list {
        min-width: 100vw;
        max-width: 100vw;
        border-right: none;
        border-bottom: 2px solid #1677ff;
    }
    .tickets-main-content {
        padding-left: 0 !important;
    }
}

.text-muted {
    color: #14c1d1 !important;
}

.tickets-sidebar-title {
    color: #ff6600;
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 0;
    margin-right: 2.5rem;
    min-width: 220px;
    white-space: nowrap;
    display: inline-block;
}
.tickets-section .d-flex.align-items-end {
    margin-bottom: 0.7rem;
    margin-left: 0;
    margin-right: 0;
}
.tickets-section .tickets-sidebar-title {
    color: #ff6600;
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 0;
    margin-right: 2.5rem;
    min-width: 220px;
    white-space: nowrap;
    display: inline-block;
}
.tickets-section .tickets-main-title {
    color: #00eaff;
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0;
    display: inline-block;
}
.ticket-title {
    color: #14c1d1;
    font-size: 1.15rem;
    font-weight: bold;
    margin-bottom: 0.2rem;
    display: block;
    white-space: normal;
}
.ticket-status-text {
    color: #14c1d1;
    font-size: 1rem;
    margin-bottom: 0;
    display: block;
    white-space: normal;
}
.tickets-main-title {
    color: #00eaff;
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}
.tickets-header-bar {
    border-bottom: 2px solid #1677ff;
    margin-bottom: 1.5rem;
}
.ticket-infos {
    font-size: 1.1rem;
    margin-bottom: 1.2rem;
    color: #fff;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.2rem;
}
.ticket-info-label {
    color: #b9eaff;
    font-weight: 600;
    margin-right: 0.3rem;
    margin-left: 0.5rem;
}
.ticket-badge {
    display: inline-block;
    padding: 6px 18px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    background: #22003a;
    color: #fff;
    margin-right: 0.7rem;
    margin-bottom: 0.3rem;
    letter-spacing: 0.5px;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    transition: background 0.2s, color 0.2s;
}
.badge-referent {
    background: #1677ff;
    color: #fff;
}
.badge-status.badge-en_attente {
    background: #00eaff;
    color: #181828;
}
.badge-status.badge-en_cours {
    background: #ffb300;
    color: #181828;
}
.badge-status.badge-archive {
    background: #b9b9b9;
    color: #181828;
}
.badge-status.badge-ferme {
    background: #ff4d4d;
    color: #fff;
}
.badge-id {
    background: #18002a;
    color: #00eaff;
    font-family: 'Consolas', 'Menlo', monospace;
    font-size: 0.98rem;
    letter-spacing: 0.5px;
}