* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: #1d2b33; }
body { display: flex; flex-direction: column; }
#topbar { display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: #0e2a3a; color: #fff; flex-wrap: wrap; z-index: 1000; }
.brand { font-weight: 800; font-size: 22px; letter-spacing: 1px; }
.brand span { color: #4fc3f7; }
.brand-logo { height: 30px; width: auto; flex: none; }
.search-wrap { position: relative; flex: 1; min-width: 220px; max-width: 520px; }
#search { width: 100%; padding: 9px 12px; border: none; border-radius: 6px; font-size: 15px; }
#results { position: absolute; top: 44px; left: 0; right: 0; background: #fff; color: #1d2b33; border-radius: 6px; box-shadow: 0 6px 24px rgba(0,0,0,.25); max-height: 300px; overflow-y: auto; }
#results button { display: block; width: 100%; text-align: left; padding: 9px 12px; border: none; background: none; font-size: 14px; cursor: pointer; border-bottom: 1px solid #eee; }
#results button:hover { background: #eef6f9; }
#results small { color: #6b7b84; display: block; }
.status { display: flex; flex-direction: column; font-size: 12px; text-align: right; color: #b9d4e2; }
.status #count { font-size: 14px; font-weight: 700; color: #fff; }
#notice { background: #fff8e1; color: #6d5b00; font-size: 13px; padding: 6px 16px; border-bottom: 1px solid #f0e2a8; z-index: 999; }
#map { flex: 1; min-height: 300px; }
#panel { position: absolute; top: 110px; right: 12px; width: 300px; max-width: calc(100vw - 24px); background: #fff; border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.3); padding: 16px; z-index: 1001; }
#panel h2 { font-size: 18px; margin-bottom: 10px; padding-right: 24px; }
#panel dl div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
#panel dt { color: #6b7b84; }
#panel dd { font-weight: 600; text-align: right; word-break: break-word; }
#panel-close { position: absolute; top: 8px; right: 10px; border: none; background: none; font-size: 22px; cursor: pointer; color: #6b7b84; }
#foot { font-size: 11px; color: #6b7b84; padding: 6px 12px; background: #f4f6f7; border-top: 1px solid #e2e8ea; }
.leaflet-container { background: #a8c8d8; }
@media (max-width: 700px) {
  #panel { top: auto; bottom: 60px; right: 8px; left: 8px; width: auto; }
  .status { flex-direction: row; gap: 10px; align-items: baseline; }
}

/* Compte utilisateur + logo */
.user-chip { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.user-chip .user-name { font-weight: 700; color: #fff; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip a { color: #b9d4e2; text-decoration: none; }
.user-chip a:hover { color: #fff; text-decoration: underline; }
#foot { display: flex; align-items: center; gap: 10px; }
.foot-logo { height: 22px; width: auto; flex: none; }
@media (max-width: 700px) {
  .user-chip .user-name { display: none; }
  .brand-logo { height: 22px; }
}

/* Alerte relevé ancien */
.stale-alert { background: #fdecea; color: #9c2b1f; font-weight: 700; font-size: 13px; border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; }
.stale-time { color: #c0392b !important; font-weight: 800; }

/* Navigation laterale */
#menu-toggle { display: none; background: none; border: none; color: #fff; font-size: 22px; cursor: pointer; padding: 2px 6px; }
#layout { flex: 1; display: flex; min-height: 0; }
#sidebar { width: 176px; flex: none; background: #0e2a3a; display: flex; flex-direction: column; padding: 10px 8px; gap: 4px; }
#sidebar .tab { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: none; border-radius: 8px; background: none; color: #b9d4e2; font-size: 14px; cursor: pointer; text-align: left; text-decoration: none; width: 100%; }
#sidebar .tab:hover { background: rgba(255,255,255,.08); color: #fff; }
#sidebar .tab.active { background: #16455f; color: #fff; font-weight: 700; }
#content { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }
#fleet-view { flex: 1; background: #fff; padding: 24px; overflow: auto; }
#fleet-view h2 { font-size: 20px; margin-bottom: 10px; }
#fleet-view .soon { color: #6b7b84; font-size: 14px; max-width: 460px; }
@media (max-width: 700px) {
  #menu-toggle { display: block; }
  #sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: 220px; z-index: 2000; transform: translateX(-100%); transition: transform .2s ease; padding-top: 16px; }
  #sidebar.open { transform: none; box-shadow: 4px 0 24px rgba(0,0,0,.35); }
}

/* Lien langue dans la barre utilisateur */
.user-lang { color: #eaf2f8; text-decoration: none; font-size: 13px; padding: 4px 8px; border: 1px solid rgba(255,255,255,.4); border-radius: 6px; white-space: nowrap; }
.user-lang:hover { background: rgba(255,255,255,.12); }

.favorite-row{display:block;margin:10px 0;padding:12px;cursor:pointer;background:#fff;border:1px solid #ccc;border-radius:5px} #favorite{padding:8px 10px;cursor:pointer;margin-bottom:10px} #favorites-list{max-height:65vh;overflow:auto}

#foot span{white-space:normal;overflow:visible;text-overflow:clip} #foot a{color:#21586e} #panel{max-height:calc(100vh - 165px);overflow-y:auto} @media(max-width:650px){#panel{max-height:calc(100dvh - 285px);bottom:80px} #foot{align-items:flex-start} }

#results button:disabled{color:#3f5059;opacity:1;background:#edf6fa;cursor:default} .status #count{white-space:nowrap}
