:root {
  --bg: #fbf7ef;
  --panel: #fffdf8;
  --ink: #2b211b;
  --muted: #79695f;
  --line: #e8d9c8;
  --accent: #965f43;
  --accent-dark: #74452f;
  --soft: #f1e4d7;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}
.topbar {
  min-height: 62px;
  padding: 9px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.topbar-left, .main-nav, .auth-area, .login-form, .user-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.topbar-left { min-width: 0; }
.brand { font: 700 18px Georgia, serif; white-space: nowrap; margin-left: 4px; }
.nav-btn {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: transparent;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}
.nav-btn:hover, .nav-btn.active { background: var(--soft); color: var(--accent-dark); }
.auth-area { justify-content: flex-end; min-width: 0; }
input {
  min-width: 165px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 11px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  font-size: 14px;
}
.primary { background: var(--accent); color: white; border-color: var(--accent); }
.primary:hover { background: var(--accent-dark); }
.ghost { background: transparent; color: var(--ink); }
.ghost:hover { background: var(--soft); }
.link-btn { border: 0; background: transparent; color: var(--accent-dark); font-size: 12px; padding-left: 4px; padding-right: 4px; }
.link-btn:hover { text-decoration: underline; }
.user-dot { width: 9px; height: 9px; border-radius: 50%; background: #4f9a63; }
.role-badge { background: #efe0d0; color: #6f4430; border-radius: 999px; padding: 3px 7px; font-size: 11px; font-weight: 800; }
.hidden { display: none !important; }
.wrap { max-width: 1000px; margin: 0 auto; padding: 70px 24px; }
.hero { text-align: center; margin-bottom: 38px; }
.hero h1 { font: 700 42px Georgia, serif; margin: 0 0 10px; }
.hero p { color: var(--muted); font-size: 17px; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  min-height: 170px;
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 8px 28px rgba(68, 44, 29, .06);
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(68, 44, 29, .10); }
.icon { font-size: 44px; }
.card h2 { margin: 0 0 8px; font: 700 26px Georgia, serif; }
.card p { margin: 0; color: var(--muted); line-height: 1.5; }
.arrow { font-size: 30px; color: var(--accent); }
.status { text-align: center; margin-top: 24px; color: var(--muted); }
@media (max-width: 980px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .auth-area { width: 100%; justify-content: flex-start; }
}
@media (max-width: 760px) {
  .main-nav { width: 100%; }
  .brand { display: none; }
  .auth-area, .login-form { width: 100%; }
  .login-form input { flex: 1 1 160px; min-width: 0; }
  .cards { grid-template-columns: 1fr; }
  .wrap { padding-top: 40px; }
  .compact-link { padding-left: 8px; padding-right: 8px; }
}

/* Accès privé : Carnet et Tableur restent verrouillés tant que la session n'est pas ouverte. */
.protected-link.locked {
  opacity: .58;
  cursor: not-allowed;
  filter: saturate(.55);
}
.protected-link.locked:hover {
  transform: none;
  box-shadow: 0 8px 28px rgba(68, 44, 29, .06);
  background: var(--panel);
  color: inherit;
}
.nav-btn.protected-link.locked:hover { background: transparent; }
.lock-icon { display: none; font-size: 18px; }
.protected-link.locked .open-arrow { display: none; }
.protected-link.locked .lock-icon { display: inline; }
.status.require-login { color: #8a4d31; font-weight: 700; }
