/* Portail PortalOps — reprend la présentation du portail ALYS.
   Les couleurs et polices viennent des variables écrites par le serveur (Theme::css). */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 14.5px; line-height: 1.45; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }

/* Barre du haut */
.topbar { position: sticky; top: 0; z-index: 20; min-height: 68px; padding: 0 clamp(14px, 4vw, 32px); display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: linear-gradient(120deg, var(--brand), var(--brand-strong)); color: var(--on-brand); box-shadow: 0 2px 14px var(--brand-soft); }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.wordmark { font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: .02em; padding: 6px 12px; border-radius: 10px; background: rgba(255, 255, 255, .16); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title { font-family: var(--font-display); font-weight: 600; font-size: 18px; opacity: .92; padding-left: 12px; border-left: 1px solid currentColor; border-left-color: rgba(255, 255, 255, .35); white-space: nowrap; }
.ctl { display: flex; align-items: center; gap: 8px; }
.ib, .hamb { width: 40px; height: 40px; border-radius: 11px; border: 1px solid rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .10); color: inherit; display: grid; place-items: center; cursor: pointer; }
.ib:hover, .hamb:hover { background: rgba(255, 255, 255, .2); }
.hamb { display: none; }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: none; }
  :root:not([data-theme="light"]) .i-moon { display: block; }
}

/* Compte connecté */
.user { position: relative; }
.user summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; border-radius: 12px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); cursor: pointer; }
.user summary::-webkit-details-marker { display: none; }
.av { width: 34px; height: 34px; border-radius: 50%; background: #fff; color: var(--brand-strong); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.who { display: flex; flex-direction: column; line-height: 1.15; max-width: 220px; }
.who .nm { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who .rl { font-size: 11.5px; opacity: .82; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.userpop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 8px; z-index: 30; }
.quit { width: 100%; text-align: left; padding: 10px 12px; border: 0; border-radius: 9px; background: transparent; cursor: pointer; font-weight: 600; color: #b91c1c; }
.quit:hover { background: var(--surface-2); }

/* Page de connexion */
.signin { max-width: 560px; margin: clamp(24px, 8vh, 80px) auto 0; text-align: center; }
.signin .hero { flex-direction: column; align-items: center; gap: 0; }
.signin .hero p { margin-left: auto; margin-right: auto; }
.btn-ms { display: inline-flex; align-items: center; gap: 12px; height: 50px; padding: 0 22px; border: 0; border-radius: 13px; background: var(--brand); color: var(--on-brand); font-weight: 650; font-size: 15px; cursor: pointer; }
.btn-ms:hover { background: var(--brand-strong); }
.ms-logo { display: grid; grid-template-columns: 9px 9px; gap: 2px; padding: 4px; background: #fff; border-radius: 4px; }
.ms-logo i { width: 9px; height: 9px; display: block; }
.notice { margin-top: 18px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font-size: 13.5px; }

/* Structure */
.shell { display: flex; align-items: stretch; min-height: calc(100vh - 68px); }
.sidebar { flex: none; width: 232px; position: sticky; top: 68px; height: calc(100vh - 68px); overflow-y: auto; background: var(--surface); border-right: 1px solid var(--line); padding: 16px 12px; }
.sbnav { display: flex; flex-direction: column; gap: 4px; }
.sb-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 11px; color: var(--muted); font-weight: 500; }
.sb-item:hover { background: var(--surface-2); color: var(--ink); }
.sb-item.on { background: var(--brand-soft); color: var(--brand); font-weight: 650; }
.sb-item svg { flex: none; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wrap { flex: 1; width: 100%; max-width: 1320px; margin: 0 auto; padding: clamp(18px, 3.5vw, 34px) clamp(14px, 4vw, 28px) 56px; }
:root[data-width="full"] .wrap { max-width: none; }
.foot { text-align: center; color: var(--muted); font-size: 12.5px; padding: 0 16px 24px; }

/* Bandeau d'accueil */
.hero { position: relative; overflow: hidden; display: flex; flex-wrap: wrap; gap: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: clamp(20px, 4vw, 34px); box-shadow: var(--shadow); margin-bottom: 26px; }
.hero::before { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: var(--accent); opacity: .16; pointer-events: none; }
.hero::after { content: ""; position: absolute; right: 40px; top: 60px; width: 90px; height: 90px; border-radius: 50%; background: var(--brand); opacity: .10; pointer-events: none; }
.hero-in { position: relative; z-index: 1; flex: 1 1 480px; min-width: 0; }
.eyebrow { display: inline-block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--brand); background: var(--brand-soft); padding: 5px 11px; border-radius: 999px; }
.hero h1 { font-family: var(--font-display); font-size: clamp(26px, 3.4vw, 34px); line-height: 1.1; letter-spacing: -.02em; margin: 14px 0 8px; }
.hero p { color: var(--muted); margin: 0 0 20px; font-size: 15.5px; max-width: 620px; }
.search { display: flex; gap: 10px; max-width: 660px; }
.field { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); color: var(--muted); }
.field:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; }
.btn-go { height: 48px; padding: 0 20px; border: 0; border-radius: 13px; background: var(--brand); color: var(--on-brand); font-weight: 650; cursor: pointer; }
.btn-go:hover { background: var(--brand-strong); }
.search-info { min-height: 1.2em; margin: 8px 2px 0 !important; font-size: 13px !important; }
.publinks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 500; }
.chip:hover { border-color: var(--brand); }
.chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.clock { position: relative; z-index: 1; flex: 0 0 190px; align-self: center; text-align: right; }
.clock .d { font-weight: 600; text-transform: capitalize; }
.clock .w { color: var(--muted); font-size: 13px; }
.clock .t { font-family: var(--font-display); font-size: 40px; font-weight: 700; letter-spacing: -.02em; color: var(--brand); font-variant-numeric: tabular-nums; }

/* Groupes de tuiles */
.h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-family: var(--font-display); font-size: 18px; }
.h2 small { font-family: var(--font-body); font-size: 12.5px; font-weight: 500; color: var(--muted); }
.h2 .ln { flex: 1; height: 1px; background: var(--line); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(186px, 1fr)); gap: 14px; margin-bottom: 28px; }
.tile { position: relative; }
.tile-link { display: flex; flex-direction: column; gap: 10px; height: 100%; min-height: 124px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); transition: transform .14s, box-shadow .14s, border-color .14s; }
.tile-link:hover { transform: translateY(-3px); box-shadow: var(--shadow-h); border-color: var(--brand); }
.ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--ic); background: color-mix(in srgb, var(--ic) 14%, transparent); font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.tx b { display: block; font-size: 14.5px; font-weight: 650; padding-right: 22px; }
.tx small { display: block; color: var(--muted); font-size: 12px; line-height: 1.35; }
.status { margin-top: auto; display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--accent-ink); }
.status i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.star { position: absolute; top: 10px; right: 10px; border: 0; background: transparent; color: var(--muted); padding: 4px; border-radius: 8px; cursor: pointer; opacity: .55; }
.star:hover { opacity: 1; background: var(--surface-2); }
.star.on { color: #f5a623; opacity: 1; }
.empty { padding: 32px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: 16px; }

/* Petits écrans */
@media (max-width: 900px) {
  .hamb { display: grid; }
  .who { display: none; }
  .user summary { padding: 4px; }
  .sidebar { position: fixed; top: 68px; left: 0; bottom: 0; height: auto; z-index: 15; transform: translateX(-100%); transition: transform .18s ease; box-shadow: var(--shadow); }
  body.menu-open .sidebar { transform: none; }
  .clock { display: none; }
  .title { display: none; }
}
@media (max-width: 560px) {
  .search { flex-direction: column; }
  .field, .btn-go { flex: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .tile-link, .sidebar { transition: none; }
  .tile-link:hover { transform: none; }
}
