/* fichier : extranet_bluupi/assets/css/style.css */

/* ------------ Variables globales ------------ */
:root {
  --bluupi-navy: #0e3e61;
  --bluupi-blue: #127194;
  --bluupi-light: #e9f5fb;
  --bluupi-bg: #f4f7fb;
  --bluupi-accent: #24b3d6;
  --text-main: #1f2a3c;
  --text-muted: #6b7483;
  --card-bg: #ffffff;
  --border-soft: #dde3ee;
  --shadow-soft: 0 10px 25px rgba(15, 40, 80, 0.08);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-pill: 999px;
  --transition-fast: 0.18s ease-out;
  --sidebar-width: 260px;
  --header-height: 64px;
  --font-main: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
}

/* ------------ Reset simple ------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: var(--font-main);
  color: var(--text-main);
  background: var(--bluupi-bg);
}

/* ------------ Boutons ------------ */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--bluupi-blue), var(--bluupi-accent));
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  box-shadow: 0 6px 14px rgba(12, 88, 130, 0.35);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(12, 88, 130, 0.4);
}

.btn-ghost {
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-soft);
  background: transparent;
  padding: 8px 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.8);
  color: var(--bluupi-blue);
}

/* ------------ Page d'accueil centrée ------------ */

.layout-centered {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top left, #d3ecff 0, #f4f7fb 45%, #ffffff 90%);
}

.welcome-card {
  background: var(--card-bg);
  padding: 32px 28px 28px;
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
  text-align: center;
  max-width: 420px;
  width: 100%;
}

.welcome-logo {
  width: 96px;
  height: 96px;
  object-fit: contain;
  margin-bottom: 12px;
}

.welcome-card h1 {
  margin: 0 0 8px;
  font-size: 1.5rem;
  color: var(--bluupi-navy);
}

.welcome-subtitle {
  margin: 0 0 20px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ------------ Layout Dashboard ------------ */

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  background: var(--bluupi-bg);
}

/* Sidebar */

.app-sidebar {
  background: linear-gradient(180deg, var(--bluupi-navy), #071f35);
  color: #fff;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;

  /* sidebar fixe, scrollable indépendamment */
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.app-brand-logo img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.app-brand-text {
  display: flex;
  flex-direction: column;
}

.app-brand-text span:nth-child(1) {
  font-size: 0.8rem;
  opacity: 0.8;
}

.app-brand-text span:nth-child(2) {
  font-weight: 600;
}

.app-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  position: relative; /* pour les sous-menus flyout */
}

.app-nav-section {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.6;
  margin: 12px 0 4px;
}

.app-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  font-size: 0.9rem;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.app-nav-link span.icon {
  font-size: 1.05rem;
}

.app-nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(1px);
}

.app-nav-link.active {
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
}

.app-sidebar-footer {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.75rem;
  opacity: 0.8;
}

/* Main content */

.app-main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
  position: sticky;
  top: 0;
  z-index: 10;
}

.app-header-left h1 {
  font-size: 1.2rem;
  margin: 0 0 2px;
  color: var(--bluupi-navy);
}

.app-header-left .subtitle {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.app-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.app-header-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--bluupi-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--bluupi-navy);
}

/* Contenu dashboard */

.app-content {
  padding: 20px 24px 32px;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.section-title h2 {
  margin: 0;
  font-size: 1rem;
  color: var(--text-main);
}

.section-title small {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Cartes de KPIs */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.kpi-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 14px 14px 12px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kpi-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.kpi-value {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--bluupi-navy);
}

.kpi-trend {
  font-size: 0.8rem;
}

.kpi-trend .up {
  color: #1aa053;
}

.kpi-trend .down {
  color: #e55353;
}

/* Grille des blocs principaux */

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(260px, 0.9fr);
  gap: 18px;
}

/* Bloc cartes + graphiques */

.block {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 16px 16px 18px;
  box-shadow: var(--shadow-soft);
}

.block + .block {
  margin-top: 14px;
}

.block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.block-header h3 {
  margin: 0;
  font-size: 0.95rem;
}

.block-header small {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Graphiques (placeholders) */

.chart-placeholder {
  width: 100%;
  height: 220px;
  border-radius: 14px;
  border: 1px dashed var(--border-soft);
  background: linear-gradient(145deg, #f8fbff, #eef3fb);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Colonne droite : Booster + Météo */

.side-column {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.boost-card {
  background: linear-gradient(145deg, var(--bluupi-blue), var(--bluupi-accent));
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 16px 16px 14px;
  position: relative;
  overflow: hidden;
}

.boost-card::after {
  content: "";
  position: absolute;
  right: -20px;
  bottom: -20px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.boost-card h3 {
  margin: 0 0 4px;
  font-size: 0.98rem;
}

.boost-card p {
  margin: 0 0 10px;
  font-size: 0.85rem;
}

.boost-card small {
  font-size: 0.75rem;
  opacity: 0.9;
}

.boost-card .btn-primary {
  background: #fff;
  color: var(--bluupi-blue);
  box-shadow: none;
  margin-top: 4px;
}

.boost-card .btn-primary:hover {
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
}

/* Météo & prévisions */

.meteo-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 14px 14px 12px;
  box-shadow: var(--shadow-soft);
  font-size: 0.85rem;
}

.meteo-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.meteo-main {
  font-weight: 600;
  color: var(--bluupi-navy);
}

.meteo-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bluupi-light);
  border-radius: var(--radius-pill);
  padding: 3px 8px;
  font-size: 0.75rem;
  color: var(--bluupi-blue);
}

/* Petite responsivité */

@media (max-width: 1024px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    display: none; /* sidebar desktop seulement pour l’instant */
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .main-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 600px) {
  .kpi-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --- Formulaires & tableaux --- */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-weight: 500;
  color: var(--text-main);
}

.form-group input,
.form-group select,
.form-group textarea {
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  padding: 8px 10px;
  font-size: 0.9rem;
  font-family: var(--font-main);
}

.form-group input[type="range"] {
  padding: 0;
}

.help-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.table-basic {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.table-basic th,
.table-basic td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
}

.table-basic th {
  background: #f3f6fb;
  font-weight: 600;
}

.tag {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
}

.tag-success {
  background: #e0f5ea;
  color: #1a7a42;
}

.tag-info {
  background: #e2f0ff;
  color: #205b9c;
}

.preview-notif {
  border-radius: 16px;
  border: 1px solid var(--border-soft);
  padding: 10px 12px;
  background: linear-gradient(135deg, #f7fbff, #f2f6ff);
  font-size: 0.85rem;
}

.preview-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.preview-body {
  margin-bottom: 4px;
}

.preview-footer {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Responsive formulaires */
@media (max-width: 800px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* Cartes établissements & grilles génériques */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.etab-card {
  display: flex;
  gap: 12px;
  border-radius: 16px;
  border: 1px solid var(--border-soft);
  padding: 12px;
  background: #ffffff;
}

/* Bloc image à gauche */
.etab-image {
  width: 120px;
  height: 90px;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #f5f7fa;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Quand il y a une vraie image */
.etab-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Fallback si tu n’as pas encore mis d’image */
.etab-image-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  border: 1px dashed var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.etab-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9rem;
}

.etab-location {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.etab-desc {
  font-size: 0.85rem;
  color: var(--text-main);
}

.etab-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.etab-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Mobile : une seule colonne */
@media (max-width: 900px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }
}

/* === HEADER BANDEAU 2025 === */
.page-header {
  background: linear-gradient(135deg, #5CD6F4, #127194);
  color: #fff;
  padding: 1.5rem 2rem;
  border-radius: 1rem;
  margin-bottom: 1.5rem;
}

.page-breadcrumb {
  font-size: .9rem;
  opacity: .85;
  margin-bottom: .5rem;
}

.page-header-top {
  display:flex;
  justify-content:space-between;
  gap:1rem;
  align-items:flex-start;
}

.page-header h1 {
  font-size: 1.6rem;
  margin: 0 0 .25rem;
}

.page-header p {
  margin: 0;
  opacity: .9;
}

@media (max-width: 900px) {
  .page-header {
    padding: 1rem 1.25rem;
    border-radius: 0 0 1rem 1rem;
    margin: -1rem -1rem 1rem;
  }
}

/* --- Sous-menu latéral “premium” (flyout) --- */

/* Groupe qui peut avoir un sous-menu (ex : Cartes prépayées du parc) */
.app-nav-group {
  position: relative;
}

/* Bloc du sous-menu qui apparaît à droite */
.app-nav-submenu {
  position: absolute;
  top: 4px;
  left: 100%;
  margin-left: 8px;
  min-width: 200px;
  padding: 10px 12px;
  background: #022842;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.45);
  display: none;
  z-index: 50;
}

/* Affichage au survol du parent */
.app-nav-group.has-submenu:hover .app-nav-submenu {
  display: block;
}

/* Liens du sous-menu */
.app-nav-sublink {
  display: block;
  font-size: 13px;
  color: #e5f0ff;
  text-decoration: none;
  padding: 6px 0;
  white-space: nowrap;
  border-radius: 6px;
}

.app-nav-sublink:hover {
  background: rgba(255, 255, 255, 0.1);
  text-decoration: underline;
}

/* Quand un des sous-liens est actif → on marque le parent */
.app-nav-group.is-open > .app-nav-link {
  background: rgba(255,255,255,0.15);
}
/* === Sous-menu latéral "Cartes prépayées du parc" === */

.app-nav {
  position: relative; /* pour ancrer le sous-menu */
}

/* Le groupe qui contient le lien + le flyout */
.app-nav-group {
  position: relative;
}

/* Le petit panneau à droite du menu */
.app-nav-submenu {
  position: absolute;
  top: 4px;
  left: 100%;
  margin-left: 8px;
  min-width: 200px;
  padding: 10px 12px;
  background: #022842;              /* bleu très foncé */
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.45);
  display: none;                     /* masqué par défaut */
  z-index: 50;
}

/* Affichage au survol du groupe */
.app-nav-group.has-submenu:hover .app-nav-submenu {
  display: block;
}

/* Style des liens du sous-menu */
.app-nav-sublink {
  display: block;
  font-size: 13px;
  color: #e5f0ff;
  text-decoration: none;
  padding: 6px 0;
  white-space: nowrap;
  border-radius: 6px;
}

.app-nav-sublink:hover {
  background: rgba(255, 255, 255, 0.1);
  text-decoration: underline;
}
/* --- Sous-liens sous "Cartes prépayées du parc" --- */

.app-nav-group {
  margin-bottom: 4px;
}

/* conteneur des sous-liens, indenté sous l'item principal */
.app-nav-sublinks {
  margin: 4px 0 6px 36px;   /* décale vers la droite */
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* style des sous-liens */
.app-nav-sublink {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  padding: 1px 0;
}

.app-nav-sublink:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* sous-lien actif */
.app-nav-sublink.active {
  font-weight: 600;
  color: #ffffff;
}
