/* ===================================================
   Tokens
   =================================================== */
:root {
  --brand:      #003366;
  --brand-mid:  #0a4a8f;
  --brand-dark: #002347;
  --accent:     #c0964a;
  --bg:         #eef0f5;
  --surface:    #ffffff;
  --border:     #e2e8f0;
  --ink:        #0f172a;
  --ink-2:      #334155;
  --muted:      #64748b;
  --muted-2:    #94a3b8;
  --r:          18px;
  --r-sm:       10px;
}

/* ===================================================
   Base
   =================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Roboto", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 32px; }

/* ===================================================
   Header
   =================================================== */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .24em;
  color: var(--brand);
  text-transform: uppercase;
}
.brand__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.topbar__right { display: flex; align-items: center; gap: 10px; }

.user-badge {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 14px 5px 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13.5px;
  color: var(--ink-2);
  font-weight: 500;
  background: var(--bg);
}
.user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-mid), var(--brand-dark));
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
  letter-spacing: .04em;
  flex-shrink: 0;
}
.logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding: 8px 15px;
  border-radius: 999px;
  transition: color .15s, background .15s;
}
.logout:hover { color: var(--ink); background: var(--border); }

/* ===================================================
   Hero
   =================================================== */
.hero {
  background: var(--brand-dark);
  background-image:
    radial-gradient(900px 500px at 100% 120%, rgba(192,150,74,.2), transparent 55%),
    radial-gradient(700px 400px at -5%  -10%, rgba(10,74,143,.5), transparent 55%);
  padding: 52px 0 56px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 30px 30px;
  pointer-events: none;
}
.hero__inner { position: relative; z-index: 1; }
.hero__greeting {
  font-family: "DM Mono", Georgia, serif;
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1.1;
}
.hero__sub {
  margin-top: 10px;
  font-size: 15px;
  color: rgba(255,255,255,.55);
}
.hero__stats {
  display: flex;
  gap: 24px;
  margin-top: 28px;
}
.hero__stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hero__stat-num {
  font-family: "DM Mono", Georgia, serif;
  font-size: 26px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 1;
}
.hero__stat-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255,255,255,.42);
}
.hero__stat-sep {
  width: 1px;
  background: rgba(255,255,255,.15);
  align-self: stretch;
  margin: 4px 0;
}

/* ===================================================
   Sections
   =================================================== */
.section { padding: 48px 0; }
.section + .section { padding-top: 8px; }

.section__head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.section__title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}
.section__line {
  flex: 1;
  height: 1px;
  background: var(--border);
}
.section__count {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 10px;
}

/* ===================================================
   App Grid + Cards
   =================================================== */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}

.app-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--r);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.07), 0 4px 12px rgba(0,0,0,.05);
  transition: box-shadow .25s, transform .25s cubic-bezier(.2,.8,.2,1);
}
.app-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,.12), 0 2px 6px rgba(0,0,0,.07);
  transform: translateY(-5px);
}

/* Gradient header */
.app-card__header {
  height: 108px;
  background: var(--card-accent, var(--brand));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.app-card__header::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(145deg, rgba(255,255,255,.2) 0%, rgba(0,0,0,.22) 100%);
}
.app-card__header::after {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,.1) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* Icon pill */
.app-card__icon {
  position: relative;
  z-index: 1;
  width: 58px; height: 58px;
  border-radius: 16px;
  background: rgba(255,255,255,.18);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.28);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.02em;
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
}

/* Card body */
.app-card__body {
  padding: 20px 22px 16px;
  flex: 1;
}
.app-card__name {
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  line-height: 1.25;
}
.app-card__desc {
  margin-top: 7px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

/* Card footer */
.app-card__footer {
  padding: 0 22px 20px;
}
.app-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--card-accent, var(--brand));
  opacity: 0;
  transform: translateY(5px);
  transition: opacity .22s, transform .22s;
}
.app-card:hover .app-card__cta {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered entrance */
.app-card { animation: fadeUp .45s both; }
.app-grid .app-card:nth-child(2) { animation-delay: .05s; }
.app-grid .app-card:nth-child(3) { animation-delay: .1s; }
.app-grid .app-card:nth-child(4) { animation-delay: .15s; }
.app-grid .app-card:nth-child(5) { animation-delay: .2s; }
.app-grid .app-card:nth-child(6) { animation-delay: .25s; }
.app-grid .app-card:nth-child(7) { animation-delay: .3s; }
.app-grid .app-card:nth-child(8) { animation-delay: .35s; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
}

.empty {
  padding: 40px 0;
  color: var(--muted-2);
  font-size: 14px;
  font-style: italic;
}

/* ===================================================
   Footer
   =================================================== */
.foot {
  padding: 28px 0;
  font-size: 13px;
  color: var(--muted-2);
  border-top: 1px solid var(--border);
}

/* ===================================================
   Login — Split Screen
   =================================================== */
.login-page { min-height: 100vh; background: var(--surface); }

.login-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

/* Panneau gauche */
.login-panel-left {
  background: var(--brand-dark);
  background-image:
    radial-gradient(900px 700px at -10% 110%, rgba(192,150,74,.18), transparent 55%),
    radial-gradient(700px 500px at 110% -10%, rgba(10,74,143,.45), transparent 55%);
  display: flex;
  flex-direction: column;
  padding: 56px 60px;
  position: relative;
  overflow: hidden;
}
.login-panel-left::before {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,.055) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}
.login-panel-left__inner {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-logo {
  display: flex;
  align-items: center;
  gap: 9px;
}
.login-logo__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.login-logo__mark {
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .26em;
  color: #fff;
  text-transform: uppercase;
}
.login-headline {
  font-family: "DM Mono", Georgia, serif;
  font-weight: 600;
  font-size: clamp(36px, 4vw, 52px);
  line-height: 1.06;
  letter-spacing: -0.025em;
  color: #fff;
}
.login-headline em {
  font-style: italic;
  color: rgba(255,255,255,.5);
}
.login-tagline {
  margin-top: 20px;
  font-size: 15px;
  color: rgba(255,255,255,.52);
  max-width: 320px;
  line-height: 1.65;
}
.login-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 36px;
}
.login-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  font-size: 12px;
  color: rgba(255,255,255,.65);
  background: rgba(255,255,255,.04);
}
.login-panel-left__foot {
  font-size: 12px;
  color: rgba(255,255,255,.3);
}

/* Panneau droit */
.login-panel-right {
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 52px;
}
.login-form-box { width: 100%; max-width: 360px; }
.login-form-box__title {
  font-family: "DM Mono", Georgia, serif;
  font-weight: 600;
  font-size: 28px;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 8px;
}
.login-form-box__sub {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 32px;
  line-height: 1.6;
}
.ms-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  padding: 14px 20px;
  border-radius: var(--r-sm);
  transition: background .18s, box-shadow .18s, transform .18s;
  box-shadow: 0 4px 14px rgba(0,51,102,.28);
}
.ms-button:hover {
  background: var(--brand-mid);
  box-shadow: 0 8px 24px rgba(0,51,102,.38);
  transform: translateY(-1px);
}
.ms-button__logo {
  flex-shrink: 0;
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 3px;
  padding: 2px;
  display: grid;
  place-items: center;
}
.login-secure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 22px;
  font-size: 12.5px;
  color: var(--muted-2);
}
.login-messages { margin-bottom: 22px; }
.msg--error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  line-height: 1.5;
}

/* ===================================================
   Responsive
   =================================================== */
@media (max-width: 780px) {
  .login-split { grid-template-columns: 1fr; }
  .login-panel-left { padding: 40px 32px; min-height: 260px; }
  .login-panel-left__inner { gap: 28px; }
  .login-panel-left__foot { display: none; }
  .login-panel-right { padding: 40px 28px; }
  .hero__stats { gap: 16px; }
}

@media (max-width: 600px) {
  .wrap { padding: 0 18px; }
  .hero { padding: 36px 0 40px; }
  .section { padding: 32px 0; }
  .app-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .app-card__header { height: 88px; }
  .topbar__inner { height: 56px; }
  .user-name { display: none; }
}
