/* ========================================
   Variables et Reset
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --text-primary: #194979;
    --text-secondary: #515150;
    --text-accent: #00795A;
    --text-basic: #000000;
    --gradient-start: #DDDC3C;
    --gradient-mid: #229B48;
    --gradient-end: #194979;
    --gradient-main: linear-gradient(0deg, rgba(221, 220, 60, 1) 0%, rgba(34, 155, 72, 1) 50%, rgba(25, 73, 121, 1) 100%);
    --gradient-horizontal: linear-gradient(90deg, rgba(221, 220, 60, 1) 0%, rgba(34, 155, 72, 1) 50%, rgba(25, 73, 121, 1) 100%);
    --gradient-flip: linear-gradient(90deg, rgba(25, 73, 121, 1) 0%, rgba(34, 155, 72, 1) 50%, rgba(221, 220, 60, 1) 100%);
    --gradient-diagonal: linear-gradient(135deg, rgba(34, 155, 72, 1) 0%, rgba(25, 73, 121, 1) 100%);
    --bg-primary: #f8f9fa;
    --bg-secondary: #eef1f5;
    --bg-sidebar: #194979;
    --bg-sidebar-light: #1e5a8f;
    --bg-hover: rgba(255, 255, 255, 0.15);
    --bg-active: rgba(255, 255, 255, 0.25);
    --bg-icon: rgba(255, 255, 255, 0.1);
    --text-sidebar: #ffffff;
    --text-sidebar-muted: rgba(255, 255, 255, 0.7);
    --border-color: #d0dce8;
    --border-sidebar: rgba(255, 255, 255, 0.1);
    --shadow-color: rgba(25, 73, 121, 0.15);
    --sidebar-width: 280px;
    --sidebar-collapsed: 78px;
    --header-height: 70px;
    --icon-size: 46px;
    --transition-speed: 0.25s;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-basic);
    height: 100vh;
    overflow: hidden;
}

table
{
	border-collapse: collapse;
}
table, td, th
{
	padding: 2px;
	border: 1px solid var(--border-color);
	vertical-align: top;
}
tr:nth-child(odd)
{
	background-color: var(--bg-primary);
}
tr:nth-child(even)
{
	background-color: var(--bg-secondary);
}
table.highlight tr:hover
{
	background-color: var(--bg-sidebar-light);
	color: var(--text-sidebar);
}

.app-container {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: var(--sidebar-collapsed);
    background: linear-gradient(180deg, var(--bg-sidebar) 0%, var(--bg-sidebar-light) 100%);
    display: flex;
    flex-direction: column;
    transition: width var(--transition-speed) ease;
    position: relative;
    box-shadow: 2px 0 12px var(--shadow-color);
    z-index: 100;
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-main);
}

.sidebar:hover {
    width: var(--sidebar-width);
}

.sidebar-header {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-sidebar);
    height: var(--header-height);
    min-height: var(--header-height);
}

.logo-icon {
    width: var(--icon-size);
    height: var(--icon-size);
    min-width: var(--icon-size);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
}

.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.logo-text {
    font-weight: 600;
    font-size: 1.2rem;
    white-space: nowrap;
    opacity: 0;
    transition: opacity var(--transition-speed) ease;
    color: var(--text-sidebar);
}

.sidebar:hover .logo-text {
    opacity: 1;
}

.sidebar-nav {
    flex: 1;
    padding: 8px 16px;
}

.nav-section {
    margin-bottom: 8px;
}

.nav-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-sidebar-muted);
    padding: 12px 0 8px 4px;
    letter-spacing: 0.5px;
    white-space: nowrap;
    display: none;
}

.sidebar:hover .nav-section-title {
    display: block;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: var(--icon-size);
    height: var(--icon-size);
    min-width: var(--icon-size);
    min-height: var(--icon-size);
    margin-bottom: 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    color: var(--text-sidebar);
    text-decoration: none;
    background-color: var(--bg-icon);
    justify-content: center;
    position: relative;
}

.nav-item:hover { background-color: var(--bg-hover); }
.nav-item.active { background: var(--gradient-diagonal); box-shadow: 0 2px 6px rgba(34, 155, 72, 0.3); }

.nav-text { display: none; }
.sidebar:hover .nav-item { width: 100%; padding: 0 14px; justify-content: flex-start; background-color: transparent; }
.sidebar:hover .nav-item:hover { background-color: var(--bg-hover); }
.sidebar:hover .nav-text { display: inline; }

.sidebar-footer { padding: 16px; border-top: 1px solid var(--border-sidebar); }
.user-profile { display: flex; align-items: center; gap: 12px; width: var(--icon-size); height: var(--icon-size); border-radius: 12px; cursor: pointer; justify-content: center; transition: all 0.15s ease; }
.user-profile:hover { background-color: var(--bg-hover); }
.avatar { width: var(--icon-size); height: var(--icon-size); min-width: var(--icon-size); background: linear-gradient(135deg, var(--gradient-start), var(--gradient-mid)); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 600; color: var(--text-primary); }
.user-info { display: none; white-space: nowrap; }
.sidebar:hover .user-profile { width: 100%; justify-content: flex-start; }
.sidebar:hover .user-info { display: block; }
.user-name { font-weight: 500; font-size: 0.95rem; color: var(--text-sidebar); }

/* ========================================
   Correction de la zone principale
   ======================================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--bg-primary);
}

.main-header {
    height: var(--header-height);
    min-height: var(--header-height);
    flex-shrink: 0; /* Empêche le header de se réduire */
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    background-image: var(--gradient-flip);
}

.header-left { display: flex; align-items: center; }
.page-title { font-size: 1.2rem; font-weight: 500; color: #ffffff; }

.content-area {
    flex: 1;
    padding: 24px;
    overflow-y: auto; /* Permet le scroll */
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Modification : flex-start au lieu de center */
    justify-content: flex-start;
}

.welcome-message {
    text-align: center;
    max-width: 600px;
    /* Optionnel : ajout d'un margin-top pour l'esthétique */
    margin-top: 40px;
}

.main-area {
    flex: 1;
    padding: 24px;
    overflow-y: auto; /* Permet le scroll */
    display: flex;
    flex-direction: column;
    align-items: left;
    /* Modification : flex-start au lieu de center */
    justify-content: flex-start;
}

.main-bloc {
    text-align: left;
    /* max-width: 600px; */
    /* Optionnel : ajout d'un margin-top pour l'esthétique */
    margin-top: 40px;
}

.welcome-message h1 {
    font-size: 2.2rem;
    margin-bottom: 16px;
    background: var(--gradient-horizontal);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.welcome-message p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* ========================================
   Styles Sous-menus
   ======================================== */
.nav-item-parent { display: flex; flex-direction: column; }
.nav-item-header { display: flex; align-items: center; gap: 12px; width: var(--icon-size); height: var(--icon-size); border-radius: 12px; cursor: pointer; justify-content: center; transition: all 0.15s ease; color: var(--text-sidebar); position: relative; }
.sidebar:hover .nav-item-header { width: 100%; padding: 0 14px; justify-content: flex-start; }
.nav-item-header .chevron { display: none; transition: transform 0.3s ease; }
.sidebar:hover .nav-item-header .chevron { display: inline-block; margin-left: auto; }
.nav-item-parent.open .chevron { transform: rotate(180deg); }
.submenu { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; width: 100%; }
.nav-item-parent.open .submenu { max-height: 200px; }
.nav-item-parent:hover .chevron { transform: rotate(180deg); }
.nav-item-parent:hover .submenu { max-height: 200px; }
