/* Espace client Skydev — mobile d'abord, menu latéral à partir de 900px */
:root {
  --bg: #F3F5F9;
  --surface: #FFFFFF;
  --border: #D5DBE6;
  --divider: #E3E7EF;
  --text: #121826;
  --text-2: #3B4456;
  --muted: #5B6475;
  --accent: #2457D6;
  --accent-hover: #1A43AD;
  --accent-soft: #E6EDFC;
  --accent-fg: #FFFFFF;
  --warm-bg: #FFF6E5;
  --warm-badge: #FFE7B8;
  --warm: #8A5300;
  --warm-text: #6B4A10;
  --success: #16A34A;
  --danger-bg: #FDECEC;
  --danger: #B42318;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 1px 2px rgba(18, 24, 38, .06);
  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.5; }
h1, h2 { margin: 0; letter-spacing: -.02em; line-height: 1.2; }
p { margin: 0; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.muted { color: var(--muted); font-size: 15px; }

/* ---- Logo & avatar ---- */
.logo { font-weight: 800; font-size: 20px; letter-spacing: -.02em; color: var(--text); text-decoration: none; }
.logo span { color: var(--accent); }
.logo:hover { color: var(--text); }
.logo-lg { font-size: 22px; }
.avatar { width: 40px; height: 40px; flex: none; border-radius: 999px; background: #DDE6FA; color: var(--accent-hover); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }

/* ---- Structure ---- */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.sidebar { display: none; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px 0; }
.content { flex: 1; padding: 20px 20px 104px; }
.page { max-width: 1040px; display: flex; flex-direction: column; gap: 20px; }

.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--divider); padding: 6px 8px calc(14px + env(safe-area-inset-bottom, 0px)); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tab { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 52px; justify-content: center; text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 600; transition: color .15s; }
.tab.is-active { color: var(--accent); font-weight: 700; }
.tab.is-disabled { opacity: .45; cursor: not-allowed; }

@media (min-width: 900px) {
  .app { flex-direction: row; }
  .topbar, .bottom-nav { display: none; }
  .sidebar { display: flex; flex-direction: column; gap: 28px; width: 260px; flex: none; background: var(--surface); border-right: 1px solid var(--divider); padding: 28px 16px; position: sticky; top: 0; height: 100vh; }
  .sidebar .logo { padding: 0 12px; font-size: 22px; }
  .content { padding: 40px 48px; min-width: 0; }
}

.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 12px; border-radius: 12px; color: var(--text-2); font-weight: 600; font-size: 15px; text-decoration: none; transition: background .15s, color .15s; }
.nav-link:hover { background: var(--bg); color: var(--text); }
.nav-link.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.nav-link.is-disabled { color: var(--muted); opacity: .6; cursor: not-allowed; }
.nav-link.is-disabled:hover { background: none; }
.nav-link small { margin-left: auto; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.side-help { background: var(--bg); border-radius: var(--radius); padding: 14px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.side-help strong { color: var(--text); font-size: 14px; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 0 4px; }
.side-user-text { display: flex; flex-direction: column; min-width: 0; font-size: 14px; }
.side-user form { margin: 0; }
.link-button { background: none; border: 0; padding: 2px 0; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; text-align: left; }
.link-button:hover { color: var(--text); text-decoration: underline; }

/* ---- Contenu ---- */
.greeting { display: flex; flex-direction: column; gap: 4px; }
.greeting span { color: var(--muted); font-size: 15px; }
.greeting h1 { font-size: 28px; font-weight: 800; }
@media (min-width: 900px) { .greeting h1 { font-size: 34px; } }

.row-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.card { background: var(--surface); border-radius: var(--radius-lg); padding: 20px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); }
.card-warm { background: var(--warm-bg); box-shadow: none; }
.card-title { font-size: 17px; font-weight: 700; }
.warm-text { color: var(--warm-text); font-size: 15px; }
.status { display: flex; align-items: center; gap: 10px; }
.dot { width: 10px; height: 10px; border-radius: 999px; background: var(--success); flex: none; }

.section-label { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-top: 4px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 12px; }
@media (min-width: 900px) { .tiles { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; } }
.tile { background: var(--surface); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 12px; text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: box-shadow .15s, transform .15s; }
a.tile:hover { color: var(--text); box-shadow: 0 4px 14px rgba(18, 24, 38, .08); transform: translateY(-1px); }
.tile.is-disabled { opacity: .6; cursor: not-allowed; }
.tile-text { display: flex; flex-direction: column; gap: 2px; }
.tile-text strong { font-size: 16px; }
.tile-text span { font-size: 13px; color: var(--muted); }
.icon-badge { width: 44px; height: 44px; flex: none; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; }
.icon-badge-warm { background: var(--warm-badge); color: var(--warm); }

/* ---- Boutons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: var(--radius); border: 1.5px solid transparent; font: inherit; font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, color .15s; align-self: flex-start; }
.btn-primary { background: var(--accent); color: var(--accent-fg); }
.btn-primary:hover { background: var(--accent-hover); color: var(--accent-fg); }
.btn-primary:active { transform: translateY(1px); }
.btn-outline { border-color: var(--border); color: var(--text); background: var(--surface); font-weight: 600; }
.btn-outline:hover { border-color: var(--text); color: var(--text); }
.btn-warm { background: var(--warm); color: #FFFFFF; }
.btn.is-disabled, .btn:disabled { background: var(--divider); color: var(--muted); border-color: transparent; cursor: not-allowed; }
.btn-block { width: 100%; align-self: stretch; min-height: 54px; font-size: 16px; }

/* ---- Formulaires ---- */
.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 14px; font-weight: 600; }
.field input { height: 52px; border: 1.5px solid var(--border); border-radius: var(--radius); padding: 0 16px; font: inherit; font-size: 16px; color: var(--text); background: var(--surface); transition: border-color .15s; }
.field input:hover { border-color: #AEB7C7; }
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.alert { border-radius: var(--radius); padding: 14px 16px; font-size: 15px; }
.alert-error { background: var(--danger-bg); color: var(--danger); font-weight: 600; }

/* ---- Connexion ---- */
.login-page { background: var(--surface); }
.login { max-width: 420px; margin: 0 auto; min-height: 100vh; padding: 72px 24px 28px; display: flex; flex-direction: column; gap: 28px; }
.login-intro { display: flex; flex-direction: column; gap: 8px; }
.login-intro h1 { font-size: 30px; font-weight: 800; }
.login-intro p { color: var(--muted); }
.login-help { margin-top: auto; background: var(--bg); border-radius: 16px; padding: 16px; display: flex; gap: 12px; align-items: center; font-size: 14px; line-height: 1.4; color: var(--muted); }
.login-help svg { flex: none; }
.login-help strong { color: var(--text); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
