:root {
  color-scheme: light;
  --bg: #f4f7f7;
  --surface: #ffffff;
  --surface-soft: #edf3f3;
  --text: #173f63;
  --muted: #617487;
  --line: #d6e0e3;
  --brand: #cc5055;
  --brand-dark: #9f363d;
  --shadow: 0 18px 45px rgba(28, 62, 83, .10);
  --radius: 20px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, rgba(204,80,85,.10), transparent 34rem),
    radial-gradient(circle at 100% 10%, rgba(101,179,90,.09), transparent 32rem),
    var(--bg);
}
a { color: inherit; }
button, input { font: inherit; }
form { margin: 0; }

.topbar {
  min-height: 84px;
  padding: 14px clamp(18px, 4vw, 56px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: rgba(255,255,255,.90);
  border-bottom: 1px solid rgba(214,224,227,.9);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar--module { box-shadow: inset 0 -3px 0 var(--module-color); }
.brand-lockup { display: inline-flex; align-items: center; gap: 13px; text-decoration: none; min-width: 0; }
.brand-lockup--center { justify-content: center; width: 100%; }
.brand-lockup strong { display: block; font-size: 1.06rem; letter-spacing: .02em; }
.brand-lockup span { display: block; margin-top: 2px; color: var(--muted); font-size: .84rem; }
.brand-mark {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: linear-gradient(145deg, #e87678, var(--brand));
  color: #fff;
  font-family: Georgia, serif;
  font-size: 1.75rem;
  font-weight: 700;
  box-shadow: 0 9px 23px rgba(204,80,85,.25);
}
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.user-chip {
  max-width: 250px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: .88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.launcher-shell, .module-shell { width: min(1180px, calc(100% - 36px)); margin: 0 auto; padding: 54px 0 70px; }
.launcher-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.eyebrow { margin: 0 0 6px; color: var(--brand); font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .16em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(2rem, 4vw, 3.2rem); letter-spacing: -.04em; }
h2 { letter-spacing: -.02em; }
.muted { color: var(--muted); }

.app-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 22px;
  align-items: stretch;
}
.app-card {
  --mx: 50%;
  --my: 50%;
  min-height: 270px;
  padding: 26px 20px 24px;
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-rows: 94px minmax(52px, auto) 1fr;
  justify-items: center;
  align-items: start;
  text-align: center;
  text-decoration: none;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.8);
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,255,255,.90));
  box-shadow: var(--shadow);
  transform: translateY(0);
  transition: transform .2s ease, box-shadow .2s ease;
}
.app-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at var(--mx) var(--my), color-mix(in srgb, var(--app-color) 16%, transparent), transparent 40%);
  opacity: .75;
}
.app-card:hover { transform: translateY(-5px); box-shadow: 0 25px 55px rgba(28,62,83,.16); }
.app-card:focus-visible { outline: 4px solid color-mix(in srgb, var(--app-color) 28%, transparent); outline-offset: 3px; }
.app-icon {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  align-self: start;
  border-radius: 26px;
  color: var(--app-color);
  background: linear-gradient(145deg, color-mix(in srgb, var(--app-color) 16%, white), color-mix(in srgb, var(--app-color-2) 20%, white));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.9), 0 16px 30px color-mix(in srgb, var(--app-color) 20%, transparent);
}
.app-icon svg { width: 65px; height: 65px; }
.app-name {
  position: relative;
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 12px;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.2;
}
.app-description {
  position: relative;
  max-width: 25ch;
  margin-top: 6px;
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.45;
}

.foundation-card, .notice-card {
  margin-top: 28px;
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.76);
  box-shadow: var(--shadow);
}
.foundation-card h2, .notice-card h2 { margin-bottom: 7px; }
.foundation-card p, .notice-card p { max-width: 760px; margin-bottom: 0; color: var(--muted); }
.foundation-badge { display: inline-flex; margin-bottom: 12px; padding: 5px 9px; border-radius: 999px; background: #173f63; color: #fff; font-size: .73rem; font-weight: 800; }

.status-pill { display: inline-flex; align-items: center; gap: 7px; padding: 9px 13px; border-radius: 999px; font-size: .79rem; font-weight: 800; white-space: nowrap; }
.status-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-pill--ok { color: #2c7c45; background: #e9f7ed; }
.status-pill--warn { color: #9a671e; background: #fff4db; }

.button { min-height: 42px; padding: 10px 16px; border: 0; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; text-align: center; text-decoration: none; font-weight: 800; cursor: pointer; transition: transform .15s ease, filter .15s ease; }
.button:hover { transform: translateY(-1px); filter: brightness(.98); }
.button--primary { background: var(--brand); color: #fff; }
.button--secondary { background: var(--text); color: #fff; }
.button--ghost { background: var(--surface-soft); color: var(--text); }
.button--wide { width: 100%; }

.module-hero { padding: 34px; display: flex; align-items: center; gap: 26px; border-radius: 26px; background: linear-gradient(135deg, color-mix(in srgb, var(--module-color) 12%, white), color-mix(in srgb, var(--module-color-2) 9%, white)); border: 1px solid color-mix(in srgb, var(--module-color) 24%, white); box-shadow: var(--shadow); }
.module-hero h1 { margin-bottom: 10px; }
.module-hero p:last-child { max-width: 760px; margin-bottom: 0; color: var(--muted); }
.module-hero-icon { flex: 0 0 auto; width: 110px; height: 110px; padding: 18px; color: var(--module-color); border-radius: 30px; background: rgba(255,255,255,.76); box-shadow: inset 0 0 0 1px rgba(255,255,255,.95), 0 15px 34px color-mix(in srgb, var(--module-color) 18%, transparent); }
.module-hero-icon svg { width: 100%; height: 100%; }
.module-status { margin: 20px 0; display: flex; gap: 10px; flex-wrap: wrap; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature-card { min-height: 170px; padding: 24px; display: flex; gap: 14px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); box-shadow: 0 10px 30px rgba(28,62,83,.07); }
.feature-card h3 { margin-bottom: 8px; }
.feature-card p { margin-bottom: 0; color: var(--muted); line-height: 1.55; }
.feature-dot { width: 12px; height: 12px; margin-top: 6px; flex: 0 0 auto; border-radius: 50%; }

.data-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
.data-card { padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 10px 26px rgba(28,62,83,.06); }
.data-card strong { display: block; margin-top: 7px; font-size: 1.55rem; }
.data-card span { color: var(--muted); font-size: .85rem; }
.table-shell { margin-top: 20px; overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); }
th { background: var(--surface-soft); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
tr:last-child td { border-bottom: 0; }

.login-shell, .error-shell { min-height: 100vh; padding: 30px; display: grid; place-items: center; }
.login-card, .panel { width: min(430px, 100%); padding: 34px; border: 1px solid var(--line); border-radius: 24px; background: rgba(255,255,255,.92); box-shadow: var(--shadow); }
.login-card h1 { margin-top: 26px; font-size: 2rem; }
.stack { display: grid; gap: 16px; }
label { display: grid; gap: 7px; font-size: .9rem; font-weight: 800; }
input { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #bfd0d8; border-radius: 11px; background: #fff; color: var(--text); outline: none; }
input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(204,80,85,.10); }
.alert { margin: 14px 0; padding: 12px 14px; border-radius: 12px; }
.alert--danger { color: #9c2731; background: #fdecef; border: 1px solid #f7c9ce; }

@media (max-width: 1100px) {
  .app-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .topbar, .launcher-heading, .foundation-card, .module-hero { align-items: flex-start; }
  .topbar, .launcher-heading, .foundation-card { flex-direction: column; }
  .topbar-actions { width: 100%; justify-content: flex-start; }
  .feature-grid, .data-grid { grid-template-columns: 1fr; }
  .app-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
}

@media (max-width: 600px) {
  .topbar { min-height: auto; padding: 12px 14px; gap: 12px; }
  .brand-mark { width: 42px; height: 42px; flex-basis: 42px; border-radius: 13px; font-size: 1.55rem; }
  .brand-lockup strong { font-size: .98rem; }
  .brand-lockup span { font-size: .76rem; }
  .topbar-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
  .topbar-actions .button { min-height: 40px; padding-inline: 13px; }
  .topbar-actions > .button:first-child { grid-column: 1 / -1; width: 100%; }
  .user-chip { width: 100%; max-width: none; }

  .launcher-shell, .module-shell { width: min(100% - 22px, 1180px); padding-top: 28px; padding-bottom: 42px; }
  .launcher-heading { margin-bottom: 20px; }
  .launcher-heading .status-pill { max-width: 100%; white-space: normal; }
  h1 { font-size: 2rem; }

  .app-grid { grid-template-columns: 1fr; gap: 12px; }
  .app-card {
    min-height: 124px;
    padding: 16px;
    grid-template-columns: 82px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 16px;
    row-gap: 4px;
    justify-items: start;
    align-items: center;
    text-align: left;
  }
  .app-icon {
    grid-column: 1;
    grid-row: 1 / 3;
    width: 78px;
    height: 78px;
    border-radius: 22px;
    align-self: center;
  }
  .app-icon svg { width: 56px; height: 56px; }
  .app-name {
    grid-column: 2;
    grid-row: 1;
    min-height: 0;
    padding-top: 0;
    justify-content: flex-start;
    align-self: end;
    text-align: left;
  }
  .app-description {
    grid-column: 2;
    grid-row: 2;
    max-width: none;
    margin-top: 0;
    align-self: start;
    text-align: left;
  }
  .app-card:hover { transform: none; }

  .foundation-card, .notice-card { padding: 20px; }
  .foundation-card .button { width: 100%; }
  .module-hero { padding: 22px; flex-direction: column; }
  .module-hero-icon { width: 86px; height: 86px; border-radius: 24px; }
  .module-status .status-pill { white-space: normal; }
  .login-shell, .error-shell { padding: 16px; }
  .login-card, .panel { padding: 24px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}


/* Navigation globale v0.14 */
.topbar{display:block;padding-bottom:10px}.topbar-main{display:flex;align-items:center;justify-content:space-between;gap:24px}.breadcrumbs{width:100%;margin-top:9px;display:flex;align-items:center;gap:7px;min-width:0;color:var(--muted);font-size:.78rem;font-weight:750;white-space:nowrap;overflow:hidden}.breadcrumbs a{color:var(--text);text-decoration:none}.breadcrumbs span{overflow:hidden;text-overflow:ellipsis}.breadcrumbs-current{color:var(--text);font-weight:900}.topbar-back{min-width:94px}
@media(max-width:820px){.topbar-main{width:100%;align-items:flex-start;flex-direction:column}.breadcrumbs{margin-top:10px}}
@media(max-width:600px){.topbar-main{gap:10px}.topbar-actions{width:100%;display:grid;grid-template-columns:1fr 1fr;gap:8px}.topbar-actions>.button,.topbar-actions>form,.topbar-actions>form .button,.topbar-actions>.user-chip{width:100%;max-width:none}.topbar-actions>.user-chip{grid-column:1/-1}.breadcrumbs{font-size:.73rem}}

/* Portail regroupé par typologie v0.15.2 */
.app-categories{display:grid;gap:38px}
.app-category{min-width:0}
.app-category-heading{margin-bottom:16px;padding-bottom:12px;display:flex;align-items:flex-end;justify-content:space-between;gap:18px;border-bottom:1px solid var(--line)}
.app-category-heading .eyebrow{margin-bottom:4px}
.app-category-heading h2{margin:0;font-size:1.45rem}
.app-category-heading>span{flex:0 0 auto;padding:7px 10px;border-radius:999px;background:var(--surface-soft);color:var(--muted);font-size:.76rem;font-weight:850}
.app-category .app-grid{grid-template-columns:repeat(5,minmax(0,1fr))}
@media(max-width:1100px){.app-category .app-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:820px){.app-categories{gap:30px}.app-category .app-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.app-category-heading{align-items:center}.app-category-heading h2{font-size:1.25rem}.app-category .app-grid{grid-template-columns:1fr}}


/* Portail compact et descriptions en infobulle v0.15.3 */
.app-category .app-grid{grid-template-columns:repeat(auto-fit,minmax(175px,205px));justify-content:start;align-items:start}
.app-card-shell{position:relative;min-width:0;isolation:isolate}
.app-card-shell .app-card{min-height:182px;padding:18px 14px 16px;grid-template-rows:76px minmax(42px,auto);border-radius:18px}
.app-card-shell .app-icon{width:74px;height:74px;border-radius:21px}
.app-card-shell .app-icon svg{width:52px;height:52px}
.app-card-shell .app-name{min-height:42px;padding:10px 24px 0;font-size:1rem}
.app-card-shell .app-description{display:none}
.app-card-info{position:absolute;top:10px;right:10px;z-index:4}
.app-card-info summary{width:28px;height:28px;display:grid;place-items:center;cursor:pointer;list-style:none;border:1px solid color-mix(in srgb,var(--app-color) 28%,white);border-radius:999px;background:rgba(255,255,255,.94);color:var(--app-color);font-size:.82rem;font-weight:950;box-shadow:0 6px 18px rgba(28,62,83,.10);user-select:none}
.app-card-info summary::-webkit-details-marker{display:none}
.app-card-tooltip{position:absolute;top:36px;right:0;width:245px;max-width:calc(100vw - 38px);padding:12px 13px;border:1px solid var(--line);border-radius:12px;background:#fff;color:var(--muted);box-shadow:0 16px 36px rgba(28,62,83,.18);font-size:.8rem;line-height:1.45;text-align:left}
.app-card-info:not([open]) .app-card-tooltip{visibility:hidden;opacity:0;transform:translateY(-4px);pointer-events:none}
.app-card-info[open] .app-card-tooltip{visibility:visible;opacity:1;transform:none}
@media(hover:hover) and (pointer:fine){.app-card-info:hover .app-card-tooltip,.app-card-info:focus-within .app-card-tooltip{visibility:visible;opacity:1;transform:none}}
@media(max-width:1100px){.app-category .app-grid{grid-template-columns:repeat(auto-fit,minmax(170px,205px))}}
@media(max-width:820px){.app-category .app-grid{grid-template-columns:repeat(2,minmax(0,1fr));justify-content:stretch}.app-card-shell .app-card{min-height:168px}}
@media(max-width:600px){.app-category .app-grid{grid-template-columns:1fr}.app-card-shell .app-card{min-height:100px;padding:13px 48px 13px 13px;grid-template-columns:66px minmax(0,1fr);grid-template-rows:1fr;column-gap:13px;text-align:left}.app-card-shell .app-icon{grid-column:1;grid-row:1;width:64px;height:64px;border-radius:18px}.app-card-shell .app-icon svg{width:45px;height:45px}.app-card-shell .app-name{grid-column:2;grid-row:1;min-height:0;padding:0;justify-content:flex-start;text-align:left}.app-card-info{top:50%;right:12px;transform:translateY(-50%)}.app-card-tooltip{top:36px;right:-2px}}

/* Portail réellement compact, centré et responsive v0.16.0 */
.app-categories{display:grid;gap:22px}
.app-category{display:grid;gap:10px;justify-items:center;min-width:0}
.app-category-heading{width:100%;margin:0;padding:0 0 8px;display:flex;justify-content:center;align-items:center;border-bottom:1px solid var(--line);text-align:center}
.app-category-heading h2{margin:0;font-size:1.12rem;line-height:1.25}
.app-category-heading h2 span{color:var(--muted);font-size:.85em;font-weight:800}
.app-category-heading>span{display:none!important}
.app-category .app-grid{width:100%;display:flex!important;flex-wrap:wrap;justify-content:center!important;align-items:flex-start;gap:12px}
.app-card-shell{width:148px;flex:0 0 148px}
.app-card-shell .app-card{min-height:112px;height:112px;padding:12px 10px 10px;display:grid;grid-template-rows:52px minmax(30px,auto);gap:5px;border-radius:15px}
.app-card-shell .app-icon{width:50px;height:50px;border-radius:15px}
.app-card-shell .app-icon svg{width:36px;height:36px}
.app-card-shell .app-name{min-height:30px;padding:3px 12px 0;font-size:.86rem;line-height:1.15}
.app-card-info{top:7px;right:7px}
.app-card-info summary{width:23px;height:23px;font-size:.7rem}
.app-card-tooltip{top:29px;width:230px;font-size:.78rem}
.launcher-shell,.module-shell{margin-inline:auto}
@media(max-width:820px){.app-categories{gap:18px}.app-category .app-grid{gap:10px}.app-card-shell{width:140px;flex-basis:140px}.app-card-shell .app-card{height:108px;min-height:108px}}
@media(max-width:600px){.app-category{gap:9px}.app-category-heading h2{font-size:1.04rem}.app-category .app-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;justify-content:stretch!important;width:100%;gap:10px}.app-card-shell{width:auto;min-width:0;flex:auto}.app-card-shell .app-card{height:104px;min-height:104px;padding:10px 28px 9px 9px;display:grid;grid-template-columns:48px minmax(0,1fr);grid-template-rows:1fr;column-gap:9px;text-align:left}.app-card-shell .app-icon{grid-column:1;grid-row:1;width:46px;height:46px;border-radius:14px;align-self:center}.app-card-shell .app-icon svg{width:33px;height:33px}.app-card-shell .app-name{grid-column:2;grid-row:1;min-height:0;padding:0;justify-content:flex-start;text-align:left;font-size:.82rem}.app-card-info{top:8px;right:7px;transform:none}.app-card-tooltip{position:fixed;left:12px;right:12px;top:auto;bottom:14px;width:auto;max-width:none;z-index:1000}.launcher-shell{padding-top:20px}}
@media(max-width:380px){.app-category .app-grid{grid-template-columns:1fr!important}.app-card-shell .app-card{height:86px;min-height:86px}}

/* Champs communs homogènes */
select,textarea{width:100%;padding:10px 12px;border:1px solid #bfd0d8;border-radius:11px;background:#fff;color:var(--text);outline:none;font:inherit}
select{min-height:46px}
textarea:focus,select:focus{border-color:var(--brand);box-shadow:0 0 0 4px rgba(204,80,85,.10)}
.panel.panel--wide{width:100%;max-width:none}

/* Aperçu du logo contenu sans modifier le fichier original */
.company-logo-preview{width:min(220px,100%);height:120px;margin:0 0 16px;padding:10px;display:grid;place-items:center;border:1px solid var(--line);border-radius:14px;background:linear-gradient(45deg,#eef2f3 25%,transparent 25%),linear-gradient(-45deg,#eef2f3 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#eef2f3 75%),linear-gradient(-45deg,transparent 75%,#eef2f3 75%);background-size:16px 16px;background-position:0 0,0 8px,8px -8px,-8px 0}
.company-logo-preview img{display:block!important;width:100%!important;height:100%!important;max-width:200px!important;max-height:100px!important;object-fit:contain!important}
.visit-links{display:grid;gap:8px;margin-bottom:12px}.visit-links .document-link{display:grid;gap:2px;padding:10px 12px;border:1px solid var(--line);border-radius:11px;background:#fff}.visit-links .document-link small{color:var(--muted);font-weight:400}

/* En-tête mobile compact v0.17.1 */
@media(max-width:600px){
  .topbar{padding:8px 10px 7px;gap:7px}
  .topbar-main{display:flex;flex-direction:column;align-items:stretch;gap:7px}
  .brand-lockup{gap:9px}
  .brand-mark{width:38px;height:38px;flex-basis:38px;border-radius:11px;font-size:1.35rem}
  .brand-lockup strong{font-size:.92rem}
  .brand-lockup span{font-size:.7rem;margin-top:0}
  .topbar-actions{display:flex;flex-wrap:nowrap;width:100%;gap:6px}
  .topbar-actions>.button:first-child{grid-column:auto;width:auto}
  .topbar-actions>.button,.topbar-actions>form,.topbar-actions>form .button{width:auto;max-width:none;flex:1;min-width:0}
  .topbar-actions .button{min-height:34px;padding:6px 7px;font-size:.76rem;white-space:nowrap}
  .topbar-actions>.user-chip{display:none}
  .breadcrumbs{margin-top:6px;font-size:.68rem;gap:5px}
}
