:root {
	--primary: #1d3557;
	--secondary: #457b9d;
	--accent: #a8dadc;
	--light: #f1faee;
	--danger: #e63946;
}

* { box-sizing: border-box; }

body {
	margin: 0;
	font-family: "Segoe UI", Arial, sans-serif;
	display: flex;
	height: 100vh;
	background: #F7F7F7;
}

/* --- SIDEBAR --- */
.sidebar {
	width: 250px;
	background: #2A3F54;
	color: #fff;
	display: flex;
	flex-direction: column;
	position: fixed;
	top: 0;
	left: 0;
	bottom: 0;
	box-shadow: 2px 0 10px rgba(0,0,0,0.2);
}
.sidebar .logo {
	text-align: center;
	padding-top: 20px;
	font-size: 22px;
	font-weight: bold;
	letter-spacing: 1px;
	background: #2A3F54;
}
.sidebar .menu {
	flex: 1;
	display: flex;
	flex-direction: column;
	padding: 0;
}
.sidebar .menu A SPAN {
	display: inline-block;
	width: 30px;
	text-align: right;    
}
.sidebar .menu A EM {
	position: absolute;
    right: 10px;
    color: #fff;
    font-style: normal;
    font-weight: 600;
    font-size: 12px;
    background-color: red;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    text-align: center;
    align-content: center;
    display: grid;
}
.sidebar .menu-title {
	font-size: 12px;
	font-weight: bold;
	letter-spacing: 1px;
	color: #aaa;
	padding: 10px 25px;
	text-transform: uppercase;
	margin-top: 15px;
}
.sidebar a {
	color: #cfd8dc;
	text-decoration: none;
	padding: 12px 10px;
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 15px;
	transition: all 0.2s ease;
	border-left: 4px solid transparent;
}
.sidebar a:hover {
	background: rgba(255,255,255,0.05);
	color: #fff;
}
.sidebar a.active {
	border-left: 4px solid #1abb9c;
    background-color: #314456;
    border-top: 1px solid #546371;
    border-bottom: 1px solid #1f2f3f;
}
.sidebar .bottom {
	padding: 15px 20px;
	font-size: 13px;
	color: #aaa;
	border-top: 1px solid rgba(255,255,255,0.1);
}

/* --- TOPBAR --- */
.topbar {
	position: fixed;
	top: 0;
	left: 250px;
	right: 0;
	height: 60px;
	background: #EDEDED;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 20px;
	box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}
.topbar h1 {
	margin: 0;
	font-size: 18px;
	color: var(--primary);
}
.topbar .user {
	display: flex;
	align-items: center;
	gap: 10px;
}
.topbar .avatar {
	width: 32px;
	height: 32px;
	background: var(--secondary);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-weight: bold;
}

/* --- CONTENU --- */
.main {
	margin-left: 250px;
	margin-top: 60px;
	padding: 10px;
	flex: 1;
    overflow: hidden;
	overflow-y: auto;
}
.card {
  position: relative;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  min-width: 0;
  word-wrap: break-word;
  background-color: #fff;
  background-clip: border-box;
  border: 1px solid rgba(0, 0, 0, 0.125);
  border-radius: 0.25rem;	
}
.card.cardd {
	margin-top: 20px;
}

.card > hr {
  margin-right: 0;
  margin-left: 0;
}

.card > .list-group:first-child .list-group-item:first-child {
  border-top-left-radius: 0.25rem;
  border-top-right-radius: 0.25rem;
}

.card > .list-group:last-child .list-group-item:last-child {
  border-bottom-right-radius: 0.25rem;
  border-bottom-left-radius: 0.25rem;
}

.card-body {
  -webkit-box-flex: 1;
  -ms-flex: 1 1 auto;
  flex: 1 1 auto;
  padding: 1.25rem;
}

.card-title {
  margin-bottom: 0.75rem;
}

.card-subtitle {
  margin-top: -0.375rem;
  margin-bottom: 0;
}

.card-text:last-child {
  margin-bottom: 0;
}

.card-link:hover {
  text-decoration: none;
}

.card-link + .card-link {
  margin-left: 1.25rem;
}

.card-header {
  padding: 0.75rem 1.25rem;
  margin-bottom: 0;
  background-color: rgba(0, 0, 0, 0.03);
  border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

.card-header:first-child {
  border-radius: calc(0.25rem - 1px) calc(0.25rem - 1px) 0 0;
}

.card-header + .list-group .list-group-item:first-child {
  border-top: 0;
}

.card-footer {
  padding: 0.75rem 1.25rem;
  background-color: rgba(0, 0, 0, 0.03);
  border-top: 1px solid rgba(0, 0, 0, 0.125);
}

.card-footer:last-child {
  border-radius: 0 0 calc(0.25rem - 1px) calc(0.25rem - 1px);
}

.card-header-tabs {
  margin-right: -0.625rem;
  margin-bottom: -0.75rem;
  margin-left: -0.625rem;
  border-bottom: 0;
}

.card-header-pills {
  margin-right: -0.625rem;
  margin-left: -0.625rem;
}

.card-img-overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 1.25rem;
}

.card-img {
  width: 100%;
  border-radius: calc(0.25rem - 1px);
}

.card-img-top {
  width: 100%;
  border-top-left-radius: calc(0.25rem - 1px);
  border-top-right-radius: calc(0.25rem - 1px);
}

.card-img-bottom {
  width: 100%;
  border-bottom-right-radius: calc(0.25rem - 1px);
  border-bottom-left-radius: calc(0.25rem - 1px);
}

.card-deck {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
}

.card-deck .card {
  margin-bottom: 15px;
}

@media (min-width: 576px) {
  .card-deck {
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -ms-flex-flow: row wrap;
    flex-flow: row wrap;
    margin-right: -15px;
    margin-left: -15px;
  }
  .card-deck .card {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-flex: 1;
    -ms-flex: 1 0 0%;
    flex: 1 0 0%;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    margin-right: 15px;
    margin-bottom: 0;
    margin-left: 15px;
  }
}

.card-group {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
}

.card-group > .card {
  margin-bottom: 15px;
}

@media (min-width: 576px) {
  .card-group {
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -ms-flex-flow: row wrap;
    flex-flow: row wrap;
  }
  .card-group > .card {
    -webkit-box-flex: 1;
    -ms-flex: 1 0 0%;
    flex: 1 0 0%;
    margin-bottom: 0;
  }
  .card-group > .card + .card {
    margin-left: 0;
    border-left: 0;
  }
  .card-group > .card:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
  }
  .card-group > .card:first-child .card-img-top,
  .card-group > .card:first-child .card-header {
    border-top-right-radius: 0;
  }
  .card-group > .card:first-child .card-img-bottom,
  .card-group > .card:first-child .card-footer {
    border-bottom-right-radius: 0;
  }
  .card-group > .card:last-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
  }
  .card-group > .card:last-child .card-img-top,
  .card-group > .card:last-child .card-header {
    border-top-left-radius: 0;
  }
  .card-group > .card:last-child .card-img-bottom,
  .card-group > .card:last-child .card-footer {
    border-bottom-left-radius: 0;
  }
  .card-group > .card:only-child {
    border-radius: 0.25rem;
  }
  .card-group > .card:only-child .card-img-top,
  .card-group > .card:only-child .card-header {
    border-top-left-radius: 0.25rem;
    border-top-right-radius: 0.25rem;
  }
  .card-group > .card:only-child .card-img-bottom,
  .card-group > .card:only-child .card-footer {
    border-bottom-right-radius: 0.25rem;
    border-bottom-left-radius: 0.25rem;
  }
  .card-group > .card:not(:first-child):not(:last-child):not(:only-child) {
    border-radius: 0;
  }
  .card-group > .card:not(:first-child):not(:last-child):not(:only-child) .card-img-top,
  .card-group > .card:not(:first-child):not(:last-child):not(:only-child) .card-img-bottom,
  .card-group > .card:not(:first-child):not(:last-child):not(:only-child) .card-header,
  .card-group > .card:not(:first-child):not(:last-child):not(:only-child) .card-footer {
    border-radius: 0;
  }
}

.card-columns .card {
  margin-bottom: 0.75rem;
}

@media (min-width: 576px) {
  .card-columns {
    -webkit-column-count: 3;
    -moz-column-count: 3;
    column-count: 3;
    -webkit-column-gap: 1.25rem;
    -moz-column-gap: 1.25rem;
    column-gap: 1.25rem;
  }
  .card-columns .card {
    display: inline-block;
    width: 100%;
  }
}
.burger { display: none; }
.burger.right {margin-left: 250px;}
/* --- RESPONSIVE --- */
@media (max-width: 1199px) {
	.sidebar {
		transform: translateX(-100%);
		z-index: 1000;
		transition: transform 0.3s ease;
        height: 100svh;
        overflow: hidden;
        overflow-Y: auto;
	}
    .sidebar::-webkit-scrollbar {
      display: none;
    }

    /* Hide scrollbar for IE, Edge and Firefox */
    .sidebar {
      -ms-overflow-style: none;  /* IE and Edge */
      scrollbar-width: none;  /* Firefox */
    }
	.sidebar.open { transform: translateX(0); }
	.topbar { left: 0; }
	.main { margin-left: 0; }
	.burger {
		display: block;
		cursor: pointer;
		font-size: 22px;
		color: var(--primary);
	}
}
    
@media (max-width: 768px) {

  /* On transforme les lignes en cartes */
  #match-table,
  #match-table thead,
  #match-table tbody,
  #match-table th,
  #match-table td,
  #match-table tr:not(.serie-header) {
      display: block;
  }
    
  #arbitres-table table,   
  #arbitres-table thead,
  #arbitres-table tbody,
  #arbitres-table th,
  #arbitres-table td,
  #arbitres-table tr:not(.serie-header) {
      display: block;
  }
    
    
  /* On masque le header */
  #match-table thead, #arbitres-table thead { 
      display: none; 
  }

#match-table tr:not(.serie-header), #arbitres-table TR {
      margin: 10px 0;
      padding: 12px;
      border: 1px solid #ddd;
      border-radius: 10px;
      background: #fff;
  }

  /* Chaque TD devient une ligne indépendante */
  #match-table tr:not(.serie-header) td, #arbitres-table TR TD {
      padding: 8px 0;
      border: none;
  }

  /* ---- LIGNE 1 (TD1 + TD2) EN FLEX ---- */
  #match-table td:nth-child(1),
  #match-table td:nth-child(2) {
      display: flex;
  }

  /* On crée un vrai conteneur flex pour TD1 + TD2 SEULEMENT */
  #match-table tr:not(.serie-header) td:nth-child(1) {
      display: inline-flex;
      width: 110px;     /* largeur fixe */
      vertical-align: top;
  }

  #match-table td:nth-child(2) {
      display: inline-flex;
      flex: 1;          /* prend le reste */
      min-width: 0;
      margin-left: 10px;
  }

  /* ---- Colonne 3,4,5 masquées comme avant ---- */
  #match-table td:nth-child(3),
  #match-table td:nth-child(4),
  #match-table td:nth-child(5) {
      display: none;
  }

  /* ---- Concaténation automatique ---- */
  #match-table tr {
      --jour: attr(data-jour);
      --heure: attr(data-heure);
  }

  #match-table td:nth-child(2)::after {
      content: " " var(--jour) " à " var(--heure);
      margin-left: 4px;
      color: #444;
  }

  /* ---- LES AUTRES TD REVIENNENT COMME AVANT ---- */

  #match-table td:nth-child(6),
  #match-table td:nth-child(7) {
      display: inline;       /* remet inline pour rester sur la même ligne */
  }

  /* BLOQUER le retour à la ligne entre TD6 et TD7 */
  #match-table td:nth-child(6),
  #match-table td:nth-child(7) {
      white-space: nowrap;   /* évite le passage à la ligne */
  }
#match-table td:nth-child(7)::before {
      content: " - ";
  }
  /* Forcer un saut de ligne APRÈS TD7 */
  #match-table td:nth-child(7)::after {
      content: "\A";         /* newline */
      white-space: pre;
  }  
    #match-table td:nth-child(6)::before {
      content: "\A";         /* newline */
      white-space: pre;
  }
    
  /* Les TD8-9-10 doivent s'aligner sur une ligne */
  #match-table td:nth-child(8),
  #match-table td:nth-child(9),
  #match-table td:nth-child(10) {
      display: inline-flex !important;
      white-space: nowrap;
      margin-right: 30px;
      vertical-align: middle;
  }

  /* empêcher les retours à la ligne entre eux */
  #match-table td:nth-child(8),
  #match-table td:nth-child(9) {
      margin-bottom: 0;
  }
    #match-table TR:hover TD, #arbitres-table table TR:hover TD {
        background-color: #fff;
    }
    
    #semaine-matchs SELECT {
        max-width: calc(100% - 85px);
    }
    .btn-right {
        display: none;
    }
    
    
    
    #arbitres-table table td:nth-child(1),
    #arbitres-table table td:nth-child(2),
    #arbitres-table table td:nth-child(3), 
    #arbitres-table table td:nth-child(4), 
    #arbitres-table table td:nth-child(5) {
        display: inline;
        margin-right: 10px;
    }
    #arbitres-table table td:nth-child(6) {
        text-align: left;
        /*display: inline-flex !important;*/
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 5px;
    }
}


