@import url('variables.css');

/* ============================= */
/*          BASE GLOBAL         */
/* ============================= */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden;
  font-family: var(--font-main);
   background-color: var(--cgt-red); /* Rouge CGT */
  color: var(--cgt-white);               /* Texte blanc par défaut */
}

body.dashboard-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
}

/* ============================= */
/*         BANDEAU HAUT         */
/* ============================= */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 50px;
  background-color: var(--cgt-red);
  color: var(--cgt-white);
  display: flex;
  align-items: center;
  padding: 0 1rem;
  z-index: 1000;
  box-sizing: border-box;
}

.topbar-title {
  font-size: 1.1rem;
  font-weight: bold;
}

.menu-button {
  background: none;
  border: none;
  color: var(--cgt-white);
  font-size: 1.35rem;
  cursor: pointer;
  margin-left: 1rem;
  height: 80%;
  display: flex;
  align-items: center;
}

.menu-button:focus {
  outline: none;
}

/* ============================= */
/*           SIDEBAR            */
/* ============================= */
.sidebar {
  position: fixed;
  top: 50px;
  left: -260px;
  width: 260px;
  height: calc(100% - 50px);
  background-color: var(--cgt-red);
  color: var(--cgt-white);
  transition: left 0.3s ease;
  z-index: 999;
  overflow-y: auto;
  padding: 1rem 0;
}

.sidebar.show {
  left: 0;
}

.sidebar-title {
  font-size: 1.4rem;
  text-align: center;
  margin-bottom: 2rem;
  color: var(--cgt-white);
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
}

.menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.menu li {
  margin-bottom: 0.4rem;
}

.menu li:first-child button {
  margin-top: 0.5rem;
}

.sidebar .menu button {
  background-color: var(--cgt-red);
  color: var(--cgt-white);
  font-weight: bold;
  width: 90%;
  margin: 0 auto;
  display: block;
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  font-size: 0.85rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.sidebar .menu button:hover {
  background-color: var(--cgt-darkred);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
}

.sidebar .menu button.active {
  background-color: var(--cgt-darkred);
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.4);
}

.second-menu {
  margin-top: 2rem;
  border-top: 2px solid var(--cgt-darkred);
  padding-top: 1rem;
}

/* ============================= */
/*        CONTENU CENTRAL       */
/* ============================= */
.main-content,
#module-content {
  margin-top: 50px;
  padding: 1rem;
  flex-grow: 1;
  background-color: var(--cgt-white);
  color: var(--text-dark);
  box-sizing: border-box;
  max-width: 100%;
}

.main-content h1 {
  color: var(--cgt-red);
  margin-top: 0;
}

/* ============================= */
/*         RESPONSIVE           */
/* ============================= */
@media (max-width: 768px) {
  .sidebar {
    width: 260px;
    left: -260px;
    top: 50px;
  }

  .sidebar.show {
    left: 0;
  }

  .main-content {
    margin-top: 60px;
    padding: 1rem;
  }

  .menu {
    display: flex;
    flex-direction: column;       /* ← colonne au lieu de wrap */
    align-items: center;          /* ← centrage horizontal */
    width: 100%;
  }

  .menu li {
    margin: 0.2rem 0;             /* petit espacement vertical */
    width: 100%;
    display: flex;
    justify-content: center;
  }

  .sidebar .menu button {
    width: 90%;
    margin: 0 auto;
  }
}
.form-popup {
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translate(-50%, -10%);
  background: white;
  border: 2px solid var(--cgt-red);
  padding: 1rem;
  box-shadow: 0 0 10px gray;
  z-index: 9999;
}
/* ===============================
   PAGE DE CONNEXION
   =============================== */
.login-page {
  background-color: var(--cgt-black);
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  font-family: var(--font-main);
}

.login-box {
  background-color: var(--cgt-white);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-default);
  width: 100%;
  max-width: 400px;
  box-sizing: border-box;
}

.login-title {
  color: var(--cgt-red);
  margin-bottom: 1.5rem;
  text-align: center;
  font-size: 1.2rem;
}

.login-box label {
  display: block;
  margin-top: 1rem;
  margin-bottom: 0.3rem;
  font-weight: bold;
  color: var(--text-dark);
}

.login-box input[type="text"],
.login-box input[type="password"] {
  width: 100%;
  padding: 0.6rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
}

.login-box button {
  margin-top: 1.5rem;
  width: 100%;
  padding: 0.8rem;
  background-color: var(--cgt-red);
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.login-box button:hover {
  background-color: var(--cgt-darkred);
}
.logo-cgt {
  height: 36px;
  vertical-align: middle;
  margin-right: 10px;
}
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 52px;
  background: var(--cgt-red);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 1rem;
  z-index: 1000;
  box-sizing: border-box;
}
.topbar-logo {
  height: 40px;
  margin-right: 1.1rem;
  border-radius: 5px;
  padding: 3px;
  box-shadow: var(--shadow-default);
}
.topbar-title {
  font-size: 1.12rem;
  font-weight: bold;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.main-content {
  margin-top: 54px; /* adapte si besoin */
}
@media (max-width: 768px) {
  .topbar-title { font-size: 1rem; }
  .topbar-logo { height: 30px; }
}
