/* ═══ AidTech — UI immersive plein écran (mobile / tablette / desktop) ═══ */

#page-app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.app-main.app-main--immersive {
  flex: 1;
  max-width: min(1440px, 100%);
  width: 100%;
  margin: 0 auto;
  padding: 12px 16px calc(96px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .app-main.app-main--immersive {
    padding: 20px 28px calc(100px + env(safe-area-inset-bottom, 0px));
  }
}

.immersive-view {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  width: 100%;
  max-width: none;
}

.immersive-view.card {
  background: transparent;
}

.immersive-subview .subview-body {
  background: #f8fafc;
  border-radius: 16px;
  padding: 20px;
  border: 1px solid #e2e8f0;
  box-shadow: none;
  margin-top: 12px;
}

@media (min-width: 768px) {
  .immersive-subview .subview-body {
    padding: 24px 28px;
    border-radius: 16px;
  }
}

.subview-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}

.subview-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  width: 100%;
}

@media (min-width: 768px) {
  .subview-title {
    font-size: 1.75rem;
  }
}

/* Hub grid — occupe toute la largeur */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
  margin: 16px 0 24px;
}

@media (min-width: 600px) {
  .hub-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
}

@media (min-width: 1024px) {
  .hub-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
}

.hub-card {
  position: relative;
  min-height: 132px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  color: #0f172a;
  overflow: hidden;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: none;
}

.hub-card::before {
  display: none;
}

.hub-card:hover {
  border-color: #00c07f;
  box-shadow: 0 4px 12px rgba(0, 192, 127, 0.1);
  transform: none;
}

.hub-card:active {
  transform: scale(0.99);
}

.hub-card-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.hub-card-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.25;
  color: #0a1628;
}

.hub-card-desc {
  display: block;
  font-size: 13px;
  color: #64748b;
  line-height: 1.4;
}

.hub-card-stat {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
}

.hub-card-cta {
  font-size: 12px;
  font-weight: 600;
  color: #00a86b;
}

/* Accents discrets — même logique que .dash-panel */
.hub-card--teal {
  border-left: 4px solid #0d9488;
}
.hub-card--indigo {
  border-left: 4px solid #4338ca;
}
.hub-card--violet {
  border-left: 4px solid #7c3aed;
}
.hub-card--amber {
  border-left: 4px solid #d97706;
}
.hub-card--cyan {
  border-left: 4px solid #0284c7;
}
.hub-card--emerald {
  border-left: 4px solid #059669;
}

.hub-preview {
  background: #f8fafc;
  border-radius: 16px;
  padding: 16px;
  border: 1px solid #e2e8f0;
  margin-top: 8px;
}

.hub-preview h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  color: #334155;
}

.hub-preview-actions {
  margin-top: 12px;
}

/* Navigation dock — mobile : bas ; desktop : intégré au header */
.app-nav.app-nav-dock {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  top: auto;
  z-index: 100;
  padding: 0 10px calc(10px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
  background: transparent;
  border: none;
}

.app-nav-dock-inner {
  pointer-events: auto;
  max-width: min(520px, calc(100% - 20px));
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 2px;
  background: #fff;
  border-radius: 16px;
  padding: 6px 8px;
  box-shadow: 0 -1px 8px rgba(10, 22, 40, 0.06);
  border: 1px solid #e2e8f0;
}

@media (min-width: 900px) {
  .app-header {
    display: grid;
    grid-template-columns: auto minmax(260px, 1fr) auto;
    align-items: center;
    gap: 12px 16px;
    padding: 8px 18px 8px 22px;
  }

  .app-header > h1 {
    grid-column: 1;
    grid-row: 1;
  }

  .app-header > .app-nav-dock {
    position: static;
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    align-self: center;
    width: min(100%, 720px);
    padding: 0;
    pointer-events: auto;
    z-index: 1;
  }

  .app-header > .app-header-actions {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }

  .app-nav-dock-inner {
    max-width: 100%;
    margin: 0 auto;
    box-shadow: 0 1px 6px rgba(10, 22, 40, 0.08);
    padding: 5px 8px;
  }

  .app-dock-link {
    max-width: 76px;
    padding: 6px 3px;
    font-size: 9px;
  }

  .app-dock-icon {
    font-size: 1.15rem;
  }
}

@media (min-width: 768px) and (max-width: 899px) {
  .app-nav-dock-inner {
    max-width: min(680px, 90%);
    padding: 8px 12px;
    gap: 4px;
  }
}

.app-dock-link {
  flex: 1;
  min-width: 0;
  max-width: 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 4px;
  border: none;
  border-radius: 20px;
  background: transparent;
  color: #64748b;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

@media (min-width: 768px) {
  .app-dock-link {
    max-width: 100px;
    font-size: 11px;
    padding: 10px 8px;
  }
}

.app-dock-icon {
  font-size: 1.35rem;
  line-height: 1;
}

@media (min-width: 768px) {
  .app-dock-icon {
    font-size: 1.5rem;
  }
}

.app-dock-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.app-dock-link--active {
  background: #ecfdf5;
  color: #047857;
}

.app-dock-link--active .app-dock-icon {
  transform: none;
}

/* Masquer ancienne nav drawer */
.app-nav:not(.app-nav-dock) .app-nav-bar,
.app-nav:not(.app-nav-dock) .app-nav-drawer,
.app-nav:not(.app-nav-dock) .app-nav-backdrop {
  display: none !important;
}

.app-nav-dock .app-nav-bar {
  display: none;
}

/* Hero — fond pastel, texte sombre (immersif + classique) */
.immersive-view .dash-hero {
  margin: 0 0 16px;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
}

.immersive-view .dash-hero h2,
.immersive-view .dash-hero-sub {
  color: inherit;
}

.immersive-view .dash-hero-sub {
  opacity: 0.85;
}

/* Home élève — reprend le hero simple d'origine (pas de fond sombre) */
.view-home-immersive .home-hero {
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  margin-bottom: 24px;
}

.view-home-immersive .home-hero h2 {
  color: #0a1628;
}

.view-home-immersive .home-hero .sub {
  color: #64748b;
}

.view-home-immersive .home-section-title {
  font-size: 1rem;
  text-transform: none;
  letter-spacing: normal;
  color: #0a1628;
  margin: 20px 0 12px;
}

.dash-kpi-row {
  margin-bottom: 8px;
}

.view-home-immersive .home-features {
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 768px) {
  .view-home-immersive .home-features {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
}

/* Breadcrumb compact au-dessus du contenu */
.app-breadcrumb {
  padding: 6px 16px;
  font-size: 12px;
}

.app-breadcrumb .bc-parent {
  color: #64748b;
}

@media (max-width: 899px) {
  .app-header-actions .user-pill {
    display: none;
  }

  .app-header-actions #quota-info:empty {
    display: none;
  }
}

@media (max-width: 599px) {
  .app-header-actions #quota-info {
    display: none;
  }
}

#page-app:not(.hidden) ~ .guide-widget {
  bottom: calc(92px + env(safe-area-inset-bottom, 0px));
}
