/* Variables globales */
:root {
  --sidebar-width: 250px;
  --header-height: 60px;
  --primary-color: #2196F3;
  --text-color: #2c3e50;
  --text-light: #6c757d;
  --background-color: #f5f5f5;
  --border-radius: 8px;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --transition-speed: 0.3s;
}

/* Reset et styles de base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-text-size-adjust: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.2;
}

/* Layout principal */
.app-container {
  display: grid;
  grid-template-areas: "sidebar header" "sidebar main";
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: var(--header-height) 1fr;
  min-height: 100vh;
}

/* Header */
.app-header {
  grid-area: header;
  background: #fff;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  z-index: 10;
  height: var(--header-height);
}

.header-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
  max-width: 60%;
}

.header-logo {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
}

.header-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.header-main-title {
  font-size: 1.1rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-subtitle {
  font-size: 0.8rem;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: flex;
  gap: 0.5rem;
  margin-left: 1rem;
  flex: 0 0 auto;
}

/* Info modules */
.info-module {
  background: #fff;
  padding: 0.35rem 0.75rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 70px;
}

.info-module-label {
  font-size: 0.65rem;
  color: var(--text-light);
  text-transform: uppercase;
  white-space: nowrap;
}

.info-module-value {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Sidebar */
.app-sidebar {
  grid-area: sidebar;
  background: #fff;
  padding: 20px 0;
  box-shadow: var(--shadow-md);
  z-index: 20;
  overflow-y: auto;
}

/* Menu burger pour mobile */
.menu-toggle {
  display: none;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
}

.menu-toggle svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
}

/* Zone de contenu principal */
.app-main {
  grid-area: main;
  padding: 20px;
  overflow: auto;
  height: calc(100vh - var(--header-height));
}

.sections-container {
  height: 100%;
  overflow: auto;
}

/* Media queries pour le responsive */
@media (max-width: 768px) {
  .app-container {
    grid-template-areas: "header" "main";
    grid-template-columns: 1fr;
  }

  .app-header {
    padding: 0 8px;
  }

  .menu-toggle {
    display: block;
  }

  .header-title {
    max-width: 50%;
    gap: 0.35rem;
  }

  .header-logo {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
  }

  .header-main-title {
    font-size: 0.9rem;
  }

  .header-subtitle {
    font-size: 0.7rem;
  }

  .header-actions {
    gap: 0.35rem;
    margin-left: 0.5rem;
  }

  .info-module {
    padding: 0.25rem 0.5rem;
    min-width: 60px;
    transform: scale(0.9);
    margin: 0 -2px;
  }

  .info-module-label {
    font-size: 0.6rem;
  }

  .info-module-value {
    font-size: 0.8rem;
  }

  .app-sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    transition: left var(--transition-speed) ease;
  }

  .app-sidebar.active {
    left: 0;
  }
}

/* Overlay pour mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 15;
}

.sidebar-overlay.active {
  display: block;
}

/* Très petits écrans */
@media (max-width: 360px) {
  .header-actions {
    display: none;
  }

  .header-title {
    max-width: calc(100% - 40px);
  }
}