/* ==========================================================================
   APP.CSS — Interface applicative WazeEditor
   Layout sidebar + contenu, animations, identité Waze.
   Préfixe « app- » pour les composants de layout global.
   ========================================================================== */

/* --------------------------------------------------------------------------
   VARIABLES APPLICATIVES
   -------------------------------------------------------------------------- */
:root {
  --app-sidebar-w: 256px;
  --app-bg: #f4f6f8;
  --app-surface: #ffffff;
  --app-surface-2: #f0f4f7;
  --app-ink: #18212b;
  --app-muted: #5a6a75;
  --app-line: rgba(24, 33, 43, 0.1);
  --app-blue: #33ccff;
  --app-blue-dark: #0099cc;
  --app-blue-mid: #00b8e6;
  --app-dark: #121316;
  --app-nav-dark: #1a1d22;
  --app-radius: 16px;
  --app-radius-sm: 10px;
  --app-shadow: 0 2px 16px rgba(0,0,0,0.07);
  --app-shadow-md: 0 8px 32px rgba(0,0,0,0.12);
  --app-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --app-sidebar-transition: 0.32s var(--app-ease);
  --app-mobile-nav-h: 64px;
}

/* --------------------------------------------------------------------------
   RESET APPLICATIF
   -------------------------------------------------------------------------- */
body.app-layout {
  display: flex;
  flex-direction: row;
  min-height: 100svh;
  background: var(--app-bg);
  overflow-x: hidden;
}

body.app-layout .global-nav,
body.app-layout .waze-footer { display: none !important; }
body.app-layout [data-component="header"],
body.app-layout [data-component="footer"] { display: none !important; }

/* --------------------------------------------------------------------------
   SIDEBAR
   -------------------------------------------------------------------------- */
.app-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--app-sidebar-w);
  background: var(--app-dark);
  color: #fff;
  display: flex;
  flex-direction: column;
  z-index: 900;
  overflow: hidden;
  transition: transform var(--app-sidebar-transition);
  will-change: transform;
}

.app-sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(135deg, rgba(51,204,255,0.03) 25%, transparent 25%),
    linear-gradient(225deg, rgba(51,204,255,0.03) 25%, transparent 25%);
  background-size: 40px 40px;
  pointer-events: none;
}

/* Brand */
.app-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px 18px;
  text-decoration: none;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.app-sidebar__brand-icon {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
}

.app-sidebar__brand-icon img {
  width: 34px; height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(51,204,255,0.4));
}

.app-sidebar__brand-text {
  display: flex; flex-direction: column;
  line-height: 1.2; min-width: 0;
}

.app-sidebar__brand-name {
  font-size: 1rem; font-weight: 800;
  color: #fff; letter-spacing: -0.01em; white-space: nowrap;
}

.app-sidebar__brand-role {
  font-size: 0.68rem; font-weight: 500;
  color: rgba(255,255,255,0.42);
  text-transform: uppercase; letter-spacing: 0.08em; white-space: nowrap;
}

/* Nav */
.app-sidebar__nav {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 14px 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.app-sidebar__section-label {
  padding: 14px 10px 6px;
  font-size: 0.63rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(255,255,255,0.28);
}
.app-sidebar__section-label:first-child { padding-top: 4px; }

.app-nav-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 2px;
}

.app-nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: rgba(255,255,255,0.68);
  text-decoration: none;
  font-size: 0.88rem; font-weight: 500;
  transition: background 0.18s, color 0.18s, transform 0.2s var(--app-ease);
  white-space: nowrap; position: relative; overflow: hidden;
}

.app-nav-link::before {
  content: ''; position: absolute; inset: 0;
  border-radius: 10px;
  background: rgba(51,204,255,0.08);
  opacity: 0; transition: opacity 0.18s;
}

.app-nav-link:hover { color: #fff; transform: translateX(3px); }
.app-nav-link:hover::before { opacity: 1; }

.app-nav-link.is-active {
  color: var(--app-blue);
  background: rgba(51,204,255,0.13);
  font-weight: 700;
}

.app-nav-link.is-active::after {
  content: ''; position: absolute;
  left: 0; top: 25%; bottom: 25%;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--app-blue);
}

.app-nav-icon {
  width: 20px; height: 20px; flex-shrink: 0;
  fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  transition: stroke 0.18s;
}

.app-nav-link--primary {
  margin-top: 6px;
  color: var(--app-blue);
  background: rgba(51,204,255,0.1);
  border: 1px solid rgba(51,204,255,0.18);
  font-weight: 700;
}
.app-nav-link--primary:hover { background: rgba(51,204,255,0.18); color: #fff; }

.app-nav-badge {
  margin-left: auto;
  display: inline-grid; place-items: center;
  min-width: 20px; height: 20px;
  padding: 0 6px; border-radius: 9999px;
  background: var(--app-blue); color: #000;
  font-size: 0.7rem; font-weight: 800;
}

/* Pied de sidebar */
.app-sidebar__footer {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex; flex-direction: column; gap: 3px;
  flex-shrink: 0;
}

.app-sidebar__footer-link {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 8px;
  color: rgba(255,255,255,0.42);
  text-decoration: none; font-size: 0.77rem;
  transition: color 0.18s, background 0.18s;
  white-space: nowrap;
}
.app-sidebar__footer-link:hover { color: rgba(255,255,255,0.78); background: rgba(255,255,255,0.05); }
.app-sidebar__footer-link svg {
  width: 14px; height: 14px; flex-shrink: 0;
  fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}

.app-sidebar__admin-link {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px; border-radius: 7px;
  color: rgba(255,255,255,0.22);
  text-decoration: none; font-size: 0.7rem; font-weight: 500;
  transition: color 0.18s;
}
.app-sidebar__admin-link:hover { color: rgba(255,255,255,0.45); }
.app-sidebar__admin-link svg {
  width: 11px; height: 11px; flex-shrink: 0;
  fill: none; stroke: currentColor;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}

/* --------------------------------------------------------------------------
   CONTENU PRINCIPAL
   -------------------------------------------------------------------------- */
.app-main {
  flex: 1; min-width: 0;
  margin-left: var(--app-sidebar-w);
  display: flex; flex-direction: column;
  min-height: 100svh;
  transition: margin-left var(--app-sidebar-transition);
}

/* Topbar mobile */
.app-topbar {
  display: none;
  position: sticky; top: 0; z-index: 200;
  height: 56px;
  background: var(--app-dark);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  align-items: center; justify-content: space-between;
  padding: 0 16px; flex-shrink: 0;
}

.app-topbar__brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: #fff;
}
.app-topbar__brand img { width: 28px; height: 28px; object-fit: contain; }
.app-topbar__brand-name { font-size: 0.95rem; font-weight: 800; color: #fff; }

.app-topbar__menu-btn {
  background: transparent; border: none; color: #fff;
  padding: 8px; cursor: pointer; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.18s;
}
.app-topbar__menu-btn:hover { background: rgba(255,255,255,0.1); }
.app-topbar__menu-btn svg {
  width: 22px; height: 22px;
  fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round;
}

/* Zone de contenu */
.app-page {
  flex: 1;
  padding: 36px 40px 60px;
  max-width: 1200px;
  width: 100%;
  box-sizing: border-box;
  animation: app-fade-in 0.35s var(--app-ease) both;
}

@keyframes app-fade-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   EN-TÊTE DE PAGE
   -------------------------------------------------------------------------- */
.app-page-header { margin-bottom: 28px; }

.app-page-eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  margin-bottom: 8px;
  font-size: 0.69rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--app-blue-dark);
}

.app-page-eyebrow::before {
  content: '';
  display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; background: var(--app-blue);
  animation: pulse-dot 2.5s infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(51,204,255,0.6); }
  50% { box-shadow: 0 0 0 5px rgba(51,204,255,0); }
}

.app-page-title {
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  font-weight: 800; color: var(--app-ink);
  letter-spacing: -0.03em; line-height: 1.15;
}

.app-page-lead {
  margin: 0;
  font-size: 0.96rem; color: var(--app-muted);
  line-height: 1.6; max-width: 60ch;
}

/* --------------------------------------------------------------------------
   MÉTRIQUES
   -------------------------------------------------------------------------- */
.app-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px; margin-bottom: 28px;
}

.app-metric {
  background: var(--app-surface);
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius-sm);
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 4px;
  transition: box-shadow 0.2s, transform 0.2s var(--app-ease);
}
.app-metric:hover { box-shadow: var(--app-shadow); transform: translateY(-2px); }

.app-metric__value {
  font-size: 1.65rem; font-weight: 800;
  color: var(--app-blue-dark); line-height: 1; letter-spacing: -0.03em;
}
.app-metric__label { font-size: 0.77rem; color: var(--app-muted); font-weight: 500; }

.app-metric--note {
  border-color: rgba(0,153,204,0.18);
  background: rgba(231,249,255,0.6);
  flex-direction: row; align-items: center; gap: 12px;
}
.app-metric--note .app-metric__icon {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(51,204,255,0.15); border-radius: 8px; flex-shrink: 0;
}
.app-metric--note .app-metric__icon svg {
  width: 17px; height: 17px;
  fill: none; stroke: var(--app-blue-dark);
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.app-metric--note .app-metric__label { line-height: 1.4; margin: 0; }

/* --------------------------------------------------------------------------
   SECTION DOSSIERS
   -------------------------------------------------------------------------- */
.app-section {
  background: var(--app-surface);
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  overflow: hidden; margin-bottom: 20px;
}

.app-section__head {
  display: flex; align-items: center;
  justify-content: space-between; gap: 16px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--app-line);
}

.app-section__title { margin: 0; font-size: 1rem; font-weight: 700; color: var(--app-ink); }
.app-section__subtitle { margin: 3px 0 0; font-size: 0.79rem; color: var(--app-muted); }
.app-section__actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.app-case-list { list-style: none; margin: 0; padding: 0; }

.app-case-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 14px; align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(24,33,43,0.06);
  transition: background 0.15s;
  animation: app-fade-in 0.3s var(--app-ease) both;
}
.app-case-item:last-child { border-bottom: none; }
.app-case-item:hover { background: rgba(51,204,255,0.03); }

.app-case-dot {
  width: 10px; height: 10px;
  border-radius: 50%; background: #b0bec5; flex-shrink: 0;
}
.app-case-dot--pending { background: var(--app-blue); box-shadow: 0 0 0 3px rgba(51,204,255,0.2); }
.app-case-dot--processing { background: #ff9f40; box-shadow: 0 0 0 3px rgba(255,159,64,0.2); }
.app-case-dot--done { background: #4caf50; box-shadow: 0 0 0 3px rgba(76,175,80,0.2); }

.app-case-info { min-width: 0; }
.app-case-id { font-size: 0.91rem; font-weight: 700; color: var(--app-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-case-meta { font-size: 0.77rem; color: var(--app-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.app-case-badge {
  display: inline-block; padding: 3px 10px; border-radius: 9999px;
  font-size: 0.69rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  background: rgba(176,190,197,0.2); color: var(--app-muted); white-space: nowrap;
}
.app-case-badge--pending { background: rgba(51,204,255,0.12); color: var(--app-blue-dark); }
.app-case-badge--processing { background: rgba(255,159,64,0.12); color: #b36a00; }
.app-case-badge--done { background: rgba(76,175,80,0.12); color: #2e7d32; }

.app-empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 52px 32px; text-align: center;
}
.app-empty__illustration { margin-bottom: 20px; }
.app-empty__title { margin: 0 0 10px; font-size: 1.1rem; font-weight: 700; color: var(--app-ink); }
.app-empty__text { margin: 0 0 24px; font-size: 0.89rem; color: var(--app-muted); max-width: 44ch; line-height: 1.6; }

/* --------------------------------------------------------------------------
   GRILLE D'ACTIONS
   -------------------------------------------------------------------------- */
.app-action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }

.app-action-card {
  background: var(--app-surface); border: 1px solid var(--app-line);
  border-radius: var(--app-radius); padding: 22px;
  display: flex; flex-direction: column; gap: 12px;
  text-decoration: none; color: inherit;
  transition: box-shadow 0.22s, transform 0.22s var(--app-ease), border-color 0.22s;
  position: relative; overflow: hidden;
}
.app-action-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--app-blue); transform: scaleY(0); transform-origin: bottom;
  transition: transform 0.22s var(--app-ease); border-radius: 0 3px 3px 0;
}
.app-action-card:hover { box-shadow: var(--app-shadow-md); transform: translateY(-3px); border-color: rgba(51,204,255,0.25); }
.app-action-card:hover::before { transform: scaleY(1); }

.app-action-card--primary {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, var(--app-dark) 0%, #1e2530 100%);
  border-color: rgba(51,204,255,0.2); color: #fff;
  flex-direction: row; align-items: center; gap: 20px; padding: 26px 28px;
}
.app-action-card--primary::before { background: var(--app-blue); }
.app-action-card--primary:hover { border-color: rgba(51,204,255,0.5); box-shadow: 0 12px 40px rgba(0,0,0,0.3); }

.app-action-icon {
  width: 48px; height: 48px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(51,204,255,0.1); flex-shrink: 0;
  transition: background 0.2s, transform 0.2s var(--app-ease);
}
.app-action-card:hover .app-action-icon { background: rgba(51,204,255,0.18); transform: scale(1.08); }
.app-action-card--primary .app-action-icon { width: 54px; height: 54px; border-radius: 16px; background: rgba(51,204,255,0.15); }
.app-action-icon svg { width: 24px; height: 24px; fill: none; stroke: var(--app-blue); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.app-action-card--primary .app-action-icon svg { width: 26px; height: 26px; }
.app-action-body { flex: 1; min-width: 0; }
.app-action-label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--app-blue); margin-bottom: 4px; display: block; }
.app-action-title { font-size: 1.02rem; font-weight: 700; color: inherit; margin: 0 0 4px; line-height: 1.2; }
.app-action-card--primary .app-action-title { font-size: 1.2rem; }
.app-action-desc { font-size: 0.82rem; color: var(--app-muted); margin: 0; line-height: 1.45; }
.app-action-card--primary .app-action-desc { color: rgba(255,255,255,0.52); }
.app-action-arrow { width: 34px; height: 34px; border-radius: 50%; background: rgba(51,204,255,0.1); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background 0.2s, transform 0.2s var(--app-ease); }
.app-action-card:hover .app-action-arrow { background: rgba(51,204,255,0.2); transform: translateX(3px); }
.app-action-arrow svg { width: 15px; height: 15px; fill: none; stroke: var(--app-blue); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* --------------------------------------------------------------------------
   STATUT BANNER / SPECS / BOUTONS
   -------------------------------------------------------------------------- */
.app-status-banner { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--app-surface); border: 1px solid var(--app-line); border-radius: var(--app-radius-sm); text-decoration: none; color: inherit; transition: box-shadow 0.18s, border-color 0.18s; margin-bottom: 20px; }
.app-status-banner:hover { border-color: rgba(51,204,255,0.3); box-shadow: var(--app-shadow); }
.app-status-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; background: #b0bec5; }
.app-status-dot--ok { background: var(--app-blue-dark); animation: pulse-status 2.5s infinite; }
.app-status-dot--warn { background: #ff9f40; }
.app-status-dot--error { background: #c74646; }
.app-status-dot--maintenance { background: #5572c9; }
@keyframes pulse-status { 0%, 100% { box-shadow: 0 0 0 0 rgba(0,153,204,0.5); } 50% { box-shadow: 0 0 0 5px rgba(0,153,204,0); } }
.app-status-info { flex: 1; min-width: 0; }
.app-status-info strong { display: block; font-size: 0.84rem; color: var(--app-ink); }
.app-status-info small { font-size: 0.75rem; color: var(--app-muted); }
.app-status-arrow { font-size: 1.1rem; color: var(--app-blue-dark); transition: transform 0.18s; }
.app-status-banner:hover .app-status-arrow { transform: translateX(3px); }
.app-status-banner.service-status--error { border-color: #e2a2a2; background: #fff4f4; }
.app-status-banner.service-status--maintenance { border-color: #aebcf0; background: #f2f5ff; }
.app-status-banner.service-status--warn { border-color: #edcc8b; background: #fff9eb; }
.app-status-banner.service-status--ok { border-color: #9bd5b8; background: #f0fbf5; }
.app-status-banner .app-status-info small { line-height: 1.35; }
.app-status-source { margin: 6px 0 0; font-size: 0.75rem; color: var(--app-muted); }

.app-specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.app-spec { display: flex; align-items: center; gap: 10px; padding: 14px 15px; background: var(--app-surface); border: 1px solid var(--app-line); border-radius: var(--app-radius-sm); }
.app-spec__icon { width: 34px; height: 34px; border-radius: 9px; background: rgba(0,153,204,0.08); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.app-spec__icon svg { width: 17px; height: 17px; fill: none; stroke: var(--app-blue-dark); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.app-spec__value { display: block; font-size: 1rem; font-weight: 800; color: var(--app-ink); line-height: 1.1; }
.app-spec__label { display: block; font-size: 0.73rem; color: var(--app-muted); margin-top: 2px; }

.app-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 26px; border: 2px solid #111; border-radius: 9999px; background: #111; color: #fff; font-family: inherit; font-size: 0.92rem; font-weight: 700; text-decoration: none; cursor: pointer; transition: background 0.18s, border-color 0.18s, transform 0.18s var(--app-ease), box-shadow 0.18s; white-space: nowrap; }
.app-btn:hover { background: #2b2b2b; border-color: #2b2b2b; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.app-btn--sm { padding: 7px 16px; font-size: 0.82rem; }
.app-btn--outline { background: transparent; color: #111; }
.app-btn--outline:hover { background: #111; color: #fff; }
.app-btn--ghost { background: transparent; border-color: transparent; color: var(--app-muted); font-weight: 500; }
.app-btn--ghost:hover { background: transparent; border-color: transparent; color: var(--app-ink); text-decoration: underline; text-underline-offset: 3px; transform: none; box-shadow: none; }

/* --------------------------------------------------------------------------
   PROSE / AIDE
   -------------------------------------------------------------------------- */
.app-prose { max-width: 70ch; line-height: 1.7; color: var(--app-ink); }
.app-prose h2 { margin: 32px 0 12px; font-size: 1.15rem; font-weight: 700; color: var(--app-ink); }
.app-prose h2:first-child { margin-top: 0; }
.app-prose p, .app-prose li { color: var(--app-muted); }
.app-prose ol, .app-prose ul { padding-left: 1.5em; display: flex; flex-direction: column; gap: 8px; }
.app-prose a { color: var(--app-blue-dark); text-underline-offset: 3px; }
.app-prose a:hover { color: var(--app-blue-mid); }
.app-prose figure { margin: 20px 0; }
.app-prose figure img { border-radius: 10px; max-width: 100%; border: 1px solid var(--app-line); }
.app-prose figcaption { margin-top: 8px; font-size: 0.82rem; color: var(--app-muted); }
.app-notice { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 10px; border: 1px solid; font-size: 0.88rem; margin-bottom: 20px; line-height: 1.5; }
.app-notice--info { background: rgba(231,249,255,0.7); border-color: rgba(0,153,204,0.2); color: var(--app-muted); }
.app-notice--warn { background: rgba(255,249,196,0.7); border-color: rgba(255,193,7,0.3); color: #7a5f00; }

/* --------------------------------------------------------------------------
   PAGE STATUT
   -------------------------------------------------------------------------- */
.app-status-summary { display: flex; align-items: flex-start; gap: 16px; padding: 20px 22px; background: var(--app-surface); border: 1px solid var(--app-line); border-left: 4px solid #b0bec5; border-radius: var(--app-radius-sm); margin-bottom: 20px; }
.app-status-summary--ok { border-left-color: var(--app-blue-dark); }
.app-status-summary--warn { border-left-color: #ff9f40; }
.app-status-summary.service-status--error { border-left-color: #c74646; background: #fff4f4; }
.app-status-summary.service-status--maintenance { border-left-color: #5572c9; background: #f2f5ff; }
.app-status-summary .app-status-dot { margin-top: 4px; }
.app-status-summary strong { display: block; color: var(--app-ink); font-size: 1rem; }
.app-status-summary p { margin: 6px 0 0; color: var(--app-muted); font-size: 0.87rem; line-height: 1.5; }
.app-status-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 28px; }
.app-status-row { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 16px 18px; background: var(--app-surface); border: 1px solid var(--app-line); border-radius: var(--app-radius-sm); }
.app-status-row strong { display: block; color: var(--app-ink); font-size: 0.9rem; }
.app-status-row small { margin-top: 3px; display: block; color: var(--app-muted); font-size: 0.78rem; }
.app-status-row b { color: var(--app-muted); font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }
.app-history-section { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--app-line); }
.app-history-section h2 { margin: 0 0 10px; font-size: 1.2rem; font-weight: 700; color: var(--app-ink); }
.app-history-section p { color: var(--app-muted); font-size: 0.88rem; line-height: 1.6; }
.app-status-updated { margin-top: 20px; font-size: 0.78rem; color: var(--app-muted); }

/* --------------------------------------------------------------------------
   OVERLAY / MOBILE NAV / SKIP / ANIMATIONS
   -------------------------------------------------------------------------- */
.app-sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.55); backdrop-filter: blur(3px); z-index: 850; opacity: 0; transition: opacity 0.3s; }
.app-sidebar-overlay.is-visible { opacity: 1; }

.app-mobile-nav { display: none; position: fixed; bottom: 0; left: 0; right: 0; width: auto; box-sizing: border-box; overflow: hidden; z-index: 800; background: rgba(17, 29, 39, 0.97); border-top: 1px solid rgba(255,255,255,0.12); padding: 4px 8px max(4px, env(safe-area-inset-bottom)); height: var(--app-mobile-nav-h); align-items: center; justify-content: space-around; transition: transform 0.22s var(--app-ease); }
.app-mobile-nav.is-hidden { transform: translateY(110%); }
.app-mobile-nav__item { display: flex; flex: 1 1 0; min-width: 0; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 48px; padding: 6px 4px; text-decoration: none; color: rgba(255,255,255,0.52); font-size: 0.62rem; font-weight: 700; border-radius: 12px; transition: color 0.18s, background 0.18s, transform 0.16s; }
.app-mobile-nav__item svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.app-mobile-nav__item.is-active { color: var(--app-blue); }
.app-mobile-nav__item--primary { color: var(--app-blue); }
.app-mobile-nav__item:active { transform: scale(0.94); background: rgba(51,204,255,0.14); }

.app-skip { position: absolute; top: -100px; left: 16px; z-index: 9999; padding: 10px 20px; border-radius: 9999px; background: #111; color: #fff; font-weight: 700; text-decoration: none; font-size: 0.9rem; }
.app-skip:focus { top: 12px; }

.app-map-route { stroke-dasharray: 300; stroke-dashoffset: 300; animation: draw-route 2.5s var(--app-ease) 0.5s forwards; }
@keyframes draw-route { to { stroke-dashoffset: 0; } }
.app-map-pin { transform-origin: center bottom; animation: bounce-pin 3s ease-in-out 1.5s infinite; }
@keyframes bounce-pin { 0%, 100% { transform: translateY(0) scale(1); } 30% { transform: translateY(-6px) scale(1.05); } 60% { transform: translateY(-2px) scale(0.98); } }

.app-sidebar__nav::-webkit-scrollbar { width: 4px; }
.app-sidebar__nav::-webkit-scrollbar-track { background: transparent; }
.app-sidebar__nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 4px; }

/* --------------------------------------------------------------------------
   RESPONSIVE
   -------------------------------------------------------------------------- */
@media (max-width: 900px) { :root { --app-sidebar-w: 220px; } }

@media (max-width: 767px) {
  .app-sidebar { transform: translateX(-100%); box-shadow: none; }
  .app-sidebar.is-open { transform: translateX(0); box-shadow: var(--app-shadow-md); }
  .app-sidebar-overlay { display: block; }
  .app-main { margin-left: 0; }
  .app-topbar { display: flex; }
  .app-page { padding: 20px 16px 80px; }
  .app-metrics { grid-template-columns: 1fr 1fr; }
  .app-action-grid { grid-template-columns: 1fr; }
  .app-action-card--primary { grid-column: auto; flex-direction: column; align-items: flex-start; padding: 20px; gap: 14px; }
  .app-specs { grid-template-columns: 1fr 1fr; }
  .app-case-item { grid-template-columns: auto 1fr auto; padding: 14px 16px; }
  .app-case-badge { display: none; }
  .app-section__head { padding: 16px 16px 14px; }
  .app-empty { padding: 36px 20px; }
  .app-main { padding-bottom: calc(var(--app-mobile-nav-h) + 24px); }
  .app-mobile-nav { display: flex; }
  .app-status-row { grid-template-columns: auto 1fr; }
  .app-status-row b { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  .app-mobile-nav { transition: none; }
  .app-mobile-nav.is-hidden { transform: none; }
  .app-map-route { animation: none; stroke-dashoffset: 0; }
  .app-map-pin { animation: none; }
  .app-page { animation: none; }
  .app-metric, .app-action-card { transition: none; }
  .app-page-eyebrow::before { animation: none; }
  .app-status-dot--ok { animation: none; }
}

/* --------------------------------------------------------------------------
   COMPATIBILITÉ : éléments générés par dossiers.js / depot-home.js
   Adaptés au nouveau design app
   -------------------------------------------------------------------------- */

/* Éléments générés par dossiers.js dans acces-dossier.html */
.dp-dossier {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(24,33,43,0.06);
  transition: background 0.15s;
}
.dp-dossier:last-child { border-bottom: none; }
.dp-dossier:hover { background: rgba(51,204,255,0.03); }

.dp-dossier__id {
  margin: 0;
  font-size: 0.91rem; font-weight: 700; color: var(--app-ink, #18212b);
}
.dp-dossier__meta {
  margin: 3px 0 0;
  font-size: 0.77rem; color: var(--app-muted, #5a6a75);
}
.dp-dossier__actions {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}

/* Éléments générés par depot-home.js dans index.html */
.app-case-list .dp-dashboard__case,
.app-case-list article {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 14px; align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(24,33,43,0.06);
  animation: app-fade-in 0.3s var(--app-ease, cubic-bezier(0.22,1,0.36,1)) both;
}
.app-case-list article:last-child { border-bottom: none; }
.app-case-list article:hover { background: rgba(51,204,255,0.03); }
.app-case-list article::before {
  content: '';
  width: 10px; height: 10px;
  border-radius: 50%; background: #b0bec5; flex-shrink: 0;
}
.app-case-list article h3 {
  margin: 0; font-size: 0.91rem; font-weight: 700; color: var(--app-ink, #18212b);
}
.app-case-list article p {
  margin: 3px 0 0; font-size: 0.77rem; color: var(--app-muted, #5a6a75);
}
.dp-dashboard__case-state {
  display: inline-block; padding: 3px 10px; border-radius: 9999px;
  font-size: 0.69rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  background: rgba(176,190,197,0.2); color: var(--app-muted, #5a6a75);
}

/* --------------------------------------------------------------------------
   PHASE 1 — shell WazeEditor unifié
   -------------------------------------------------------------------------- */
:root {
  --app-sidebar-w: 280px;
  --app-bg: #f7fbfd;
  --app-surface: #fff;
  --app-ink: #202124;
  --app-muted: #5f6368;
  --app-line: rgba(32, 33, 36, 0.12);
  --app-blue: #33ccff;
  --app-blue-dark: #007ea8;
  --app-yellow: #fff59d;
  --app-dark: #0b2638;
}

body.app-layout {
  position: relative;
  background:
    radial-gradient(circle at 92% 8%, rgba(255, 245, 157, 0.6) 0 7rem, transparent 7.1rem),
    linear-gradient(120deg, transparent 0 68%, rgba(51, 204, 255, 0.08) 68% 69%, transparent 69%),
    var(--app-bg);
}
body.app-layout::before {
  content: '';
  position: fixed;
  z-index: 0;
  right: 3vw;
  bottom: 4vh;
  width: 34vw;
  height: 28vh;
  min-width: 260px;
  background: url("../images/waze-icon.svg") no-repeat right bottom / 90px auto;
  opacity: 0.045;
  pointer-events: none;
}
.app-sidebar {
  background: #fff;
  color: var(--app-ink);
  border-right: 1px solid rgba(32, 33, 36, 0.12);
  box-shadow: 8px 0 24px rgba(32, 33, 36, 0.04);
}
.app-sidebar::before {
  background: linear-gradient(135deg, transparent 48%, rgba(51, 204, 255, 0.12) 49% 51%, transparent 52%) 0 0 / 44px 44px;
  opacity: 0.55;
}
.app-sidebar__brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--app-line);
  flex-shrink: 0;
}
.app-sidebar__brand { border: 0; padding: 0; }
.app-sidebar__brand-name { color: var(--app-dark); }
.app-sidebar__brand-role { color: var(--app-blue-dark); }
.app-sidebar__brand-icon img { filter: none; }
.app-sidebar__nav { position: relative; z-index: 1; }
.app-sidebar__section-label { color: var(--app-muted); }
.app-nav-link { color: var(--app-muted); border: 1px solid transparent; }
.app-nav-link::before { background: rgba(51, 204, 255, 0.1); }
.app-nav-link:hover { color: var(--app-dark); }
.app-nav-link.is-active {
  color: var(--app-dark);
  background: #e8f8fd;
  border-color: rgba(51, 204, 255, 0.28);
}
.app-nav-link.is-active::after { background: var(--app-blue-dark); }
.app-nav-link--primary {
  color: var(--app-dark);
  background: var(--app-yellow);
  border-color: rgba(32, 33, 36, 0.14);
}
.app-nav-link--primary:hover { background: #ffeb62; color: var(--app-dark); }
.app-sidebar__footer { border-top-color: var(--app-line); }
.app-sidebar__footer-link { color: var(--app-muted); }
.app-sidebar__footer-link:hover { color: var(--app-dark); background: #f0f8fb; }
.app-sidebar__admin-link { color: #84919a; }
.app-sidebar__admin-link:hover { color: var(--app-dark); }
.app-main { position: relative; z-index: 1; }
.app-topbar {
  background: rgba(255, 255, 255, 0.92);
  color: var(--app-dark);
  border-bottom: 1px solid var(--app-line);
  box-shadow: 0 3px 16px rgba(32, 33, 36, 0.06);
  backdrop-filter: blur(12px);
}
.app-topbar__brand, .app-topbar__brand-name { color: var(--app-dark); }
.app-topbar__menu-btn { color: var(--app-dark); }
.app-topbar__menu-btn:hover { background: #e8f8fd; }
.app-page { max-width: 1280px; padding-top: clamp(32px, 5vw, 64px); }
.app-page-header::after {
  content: '';
  display: block;
  width: 112px;
  height: 6px;
  margin-top: 20px;
  background: var(--app-blue);
  clip-path: polygon(0 40%, 35% 40%, 50% 0, 62% 40%, 100% 40%, 100% 65%, 62% 65%, 50% 100%, 35% 65%, 0 65%);
  animation: app-route-draw 0.8s var(--app-ease) both;
}
@keyframes app-route-draw {
  from { opacity: 0; transform: scaleX(0); transform-origin: left; }
  to { opacity: 1; transform: scaleX(1); transform-origin: left; }
}
.app-action-card--primary { background: var(--app-dark); }
.app-action-card--primary::after {
  content: '';
  position: absolute;
  right: -24px;
  bottom: -34px;
  width: 150px;
  height: 100px;
  border: 6px solid rgba(51, 204, 255, 0.35);
  border-left-color: transparent;
  border-radius: 50%;
  transform: rotate(-18deg);
}
.app-btn { background: var(--app-dark); }
.app-btn:hover { background: #16445d; }
.app-main .dp-hero {
  margin: clamp(20px, 4vw, 48px) clamp(20px, 4vw, 56px) 0;
  border-radius: 28px;
  background: var(--app-blue);
  overflow: hidden;
  position: relative;
}
.app-main .dp-hero::after {
  content: '';
  position: absolute;
  right: 7%;
  bottom: -34px;
  width: 220px;
  height: 110px;
  border: 8px solid rgba(255,255,255,.55);
  border-left-color: transparent;
  border-radius: 50%;
  transform: rotate(-12deg);
}
.app-main .dp-hero__inner { position: relative; z-index: 1; }
.app-main .dp-section { background: transparent; }
.app-main .dp-prose {
  background: #fff;
  border: 1px solid var(--app-line);
  border-radius: 24px;
  padding: clamp(24px, 4vw, 52px);
  box-shadow: 0 12px 30px rgba(32,33,36,.05);
}
.app-main .dp-form-wrap {
  max-width: 920px;
  margin: 0 auto;
}
.app-main .dp-step {
  background: #fff;
  border: 1px solid var(--app-line);
  border-radius: 24px;
  box-shadow: 0 10px 24px rgba(32,33,36,.04);
}

@media (max-width: 900px) {
  .app-sidebar { transform: translateX(-105%); }
  .app-sidebar.is-open { transform: translateX(0); }
  .app-main { margin-left: 0; }
  .app-topbar { display: flex; }
  .app-main .dp-hero { margin: 16px 16px 0; border-radius: 22px; }
  .app-main .dp-section { padding-left: 16px; padding-right: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .app-page, .app-case-item, .app-page-header::after { animation: none; }
}
