:root {
  --ink: #15201f;
  --muted: #66736f;
  --line: #dbe4df;
  --paper: #f7faf8;
  --panel: #ffffff;
  --green: #16644f;
  --blue: #2457a6;
  --gold: #b47b16;
  --red: #b63b3b;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
}
a { color: inherit; text-decoration: none; }
.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .92);
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 210px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--green); color: white; font-weight: 800;
}
.brand small, .muted, .request-row small { color: var(--muted); }
.field-hint {
  margin: -8px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.field-hint[data-tone="error"] { color: var(--red); }
.form-link {
  color: var(--blue);
  font-weight: 800;
  justify-self: start;
}
.nav { display: flex; gap: 16px; flex: 1; }
.nav a { color: #33413e; font-weight: 600; font-size: 14px; }
.logout { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }
.public-nav { flex: 1; }
.login-link {
  border: 1px solid var(--line);
  background: white;
  border-radius: 6px;
  padding: 10px 14px;
  font-weight: 800;
  color: var(--green);
}
button, .primary {
  border: 0;
  background: var(--green);
  color: white;
  border-radius: 6px;
  padding: 11px 15px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.logout button, .inline button { background: #e9efec; color: var(--ink); }
.secondary {
  border: 1px solid var(--line);
  background: white;
  color: var(--green);
  border-radius: 6px;
  padding: 11px 15px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.shell { width: min(1120px, calc(100% - 32px)); margin: 34px auto 70px; }
.hero {
  min-height: calc(100vh - 150px);
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 40px;
  align-items: center;
}
.hero-copy h1, .auth-grid h1, .page-head h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 66px);
  line-height: 1.02;
  letter-spacing: 0;
}
.hero-copy p { max-width: 620px; font-size: 19px; color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; color: var(--blue); font-size: 12px; font-weight: 900; }
.hero-panel {
  min-height: 430px;
  border-radius: 8px;
  background:
    linear-gradient(rgba(21,32,31,.08), rgba(21,32,31,.08)),
    url("/public/mairie-hero.png");
  background-size: cover;
  background-position: center;
  padding: 22px;
  display: grid;
  align-content: end;
  gap: 12px;
}
.mini-card, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(20, 32, 31, .07);
}
.mini-card { padding: 16px; display: flex; justify-content: space-between; }
.auth-grid {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 48px;
  align-items: center;
  min-height: 70vh;
}
.panel { padding: 22px; }
.form { display: grid; gap: 16px; }
.wide { max-width: 820px; }
label { display: grid; gap: 7px; color: #34423f; font-weight: 700; }
input, select, textarea {
  width: 100%;
  border: 1px solid #cbd8d3;
  border-radius: 6px;
  padding: 12px 13px;
  font: inherit;
  background: white;
}
textarea { resize: vertical; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.alert, .success {
  padding: 12px 14px;
  border-radius: 6px;
  font-weight: 700;
}
.alert { background: #fff0f0; color: var(--red); }
.success { background: #e8f6ef; color: var(--green); margin-bottom: 16px; }
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}
.page-head h1 { font-size: clamp(30px, 4vw, 46px); }
.request-list { display: grid; gap: 10px; }
.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.summary-tile {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  display: grid;
  gap: 8px;
}
.summary-tile span {
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}
.summary-tile strong {
  font-size: 30px;
  color: var(--green);
}
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 22px;
}
.compact-head { margin-top: 10px; }
.compact-head h1 { font-size: clamp(26px, 3vw, 36px); }
.compact-item {
  border-top: 1px solid var(--line);
  padding: 13px 0;
  display: grid;
  gap: 5px;
}
.compact-item:first-of-type { border-top: 0; padding-top: 0; }
.compact-item span, .compact-item small {
  color: var(--muted);
}
.compact-item p { margin: 4px 0 0; color: var(--muted); line-height: 1.55; }
.request-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 18px;
  align-items: center;
  padding: 16px 18px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.request-row:hover { border-color: #9db8ad; }
.request-row span:first-child { display: grid; gap: 4px; }
.status {
  border-radius: 999px;
  background: #eef3f1;
  color: #34504a;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}
.status.large { font-size: 15px; padding: 10px 14px; }
.status[data-tone="good"] { background: #e2f3ea; color: var(--green); }
.status[data-tone="warn"] { background: #fff3dc; color: var(--gold); }
.detail-grid {
  display: grid;
  grid-template-columns: 1.5fr .8fr;
  gap: 18px;
  margin-bottom: 18px;
}
h2 { margin: 0 0 16px; font-size: 20px; }
dl { display: grid; grid-template-columns: 150px 1fr; gap: 12px; margin: 0; }
dt { color: var(--muted); font-weight: 800; }
dd { margin: 0; }
.file-link {
  display: block;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  color: var(--blue);
  font-weight: 800;
}
.file-link.subtle { color: var(--muted); }
.inline-file {
  display: inline;
  padding: 0;
  border-bottom: 0;
}
.document-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 16px 0;
}
.document-row:first-of-type { border-top: 0; padding-top: 0; }
.document-row div:first-child { display: grid; gap: 6px; }
.document-row small { color: var(--muted); }
.document-row code {
  justify-self: start;
  background: #eef4f1;
  color: #34504a;
  border-radius: 6px;
  padding: 4px 7px;
  font-size: 12px;
}
.document-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.note { border-top: 1px solid var(--line); padding: 14px 0 0; margin-top: 14px; }
.note small { color: var(--muted); margin-left: 8px; }
.message-item {
  border-top: 1px solid var(--line);
  padding: 16px 0;
  display: grid;
  gap: 9px;
}
.message-item:first-of-type { border-top: 0; padding-top: 0; }
.message-item.unread {
  border-left: 4px solid var(--blue);
  padding-left: 12px;
}
.message-item strong { display: block; }
.message-item small { color: var(--muted); }
.message-item p { margin: 0; color: #33413e; line-height: 1.55; }
.message-item form { justify-self: start; }
.mail-item {
  border-top: 1px solid var(--line);
  padding: 16px 0;
  display: grid;
  gap: 8px;
}
.mail-item:first-of-type { border-top: 0; padding-top: 0; }
.mail-item small { color: var(--muted); }
.mail-item pre {
  margin: 0;
  white-space: pre-wrap;
  background: #f1f5f3;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: #33413e;
}
.appointment-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding: 16px 0;
}
.appointment-row:first-of-type { border-top: 0; padding-top: 0; }
.appointment-row span, .appointment-row small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}
.appointment-row p { margin: 8px 0 0; color: var(--muted); line-height: 1.5; }
.datebox {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: #eef4f1;
  color: var(--green);
  display: grid;
  place-items: center;
  align-content: center;
}
.datebox strong { font-size: 22px; line-height: 1; }
.datebox span { color: var(--green); font-size: 12px; font-weight: 900; margin: 0; }
.form-record {
  border-top: 1px solid var(--line);
  padding: 16px 0;
  display: grid;
  gap: 10px;
}
.form-record:first-of-type { border-top: 0; padding-top: 0; }
.form-record small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}
.form-record pre {
  margin: 0;
  white-space: pre-wrap;
  background: #f1f5f3;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: #33413e;
}
.searchbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-bottom: 20px;
}
.table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.table th, .table td { text-align: left; padding: 13px; border-bottom: 1px solid var(--line); }
.table th { background: #eef4f1; font-size: 13px; text-transform: uppercase; color: var(--muted); }
.inline { display: flex; gap: 8px; align-items: center; }
.inline select { min-width: 120px; padding: 9px; }
.preview, .error-box pre {
  white-space: pre-wrap;
  overflow: auto;
  background: #101a18;
  color: #dff5ed;
  border-radius: 8px;
  padding: 18px;
}
.preview.light {
  background: #f1f5f3;
  color: #33413e;
  border: 1px solid var(--line);
}
.public-section { margin: 34px 0; }
.quick-grid, .info-grid, .alert-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 28px 0;
}
.quick-grid article, .info-grid article, .alert-strip > div {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
}
.quick-grid span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.quick-grid h2, .info-grid h2, .alert-strip h2 {
  margin: 8px 0 10px;
  font-size: 22px;
  line-height: 1.18;
}
.quick-grid p, .info-grid p, .alert-strip p {
  color: var(--muted);
  line-height: 1.6;
}
.info-grid ul {
  margin: 12px 0 0;
  padding-left: 18px;
  color: #40504c;
  line-height: 1.75;
  font-weight: 700;
}
.alert-strip {
  grid-template-columns: 1fr 1fr;
}
.alert-strip > div {
  border-left: 5px solid var(--gold);
}
.civic-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 28px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  overflow: hidden;
}
.civic-strip div {
  padding: 20px;
  border-left: 1px solid var(--line);
  display: grid;
  gap: 7px;
}
.civic-strip div:first-child { border-left: 0; }
.civic-strip strong { color: var(--green); }
.civic-strip span { color: var(--muted); line-height: 1.5; }
.section-title { max-width: 720px; margin-bottom: 18px; }
.section-title h2, .public-band h2, .lore-layout h2, .timeline h2 {
  margin: 0 0 10px;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.08;
}
.story-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.story-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.story-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.story-card div { padding: 18px; }
.story-card h3 { margin: 0 0 8px; font-size: 21px; }
.story-card p { color: var(--muted); line-height: 1.55; }
.story-card a { color: var(--blue); font-weight: 900; }
.public-band {
  margin-top: 28px;
  padding: 28px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
}
.public-band p { max-width: 760px; color: var(--muted); line-height: 1.6; }
.public-hero {
  margin: -6px 0 34px;
  min-height: 430px;
  border-radius: 8px;
  overflow: hidden;
}
.public-hero h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(38px, 6vw, 68px);
  line-height: 1.02;
  letter-spacing: 0;
}
.public-hero p:not(.eyebrow) {
  max-width: 690px;
  color: rgba(255,255,255,.9);
  font-size: 18px;
  line-height: 1.6;
}
.image-hero {
  background-size: cover;
  background-position: center;
  display: grid;
  align-items: end;
}
.image-hero > div {
  min-height: 430px;
  padding: 44px;
  display: grid;
  align-content: end;
  background: linear-gradient(90deg, rgba(16,26,24,.78), rgba(16,26,24,.36), rgba(16,26,24,.08));
  color: white;
}
.image-hero .eyebrow { color: #bde8d7; }
.split-hero {
  display: grid;
  grid-template-columns: 1fr .9fr;
  gap: 28px;
  min-height: 0;
  align-items: center;
  background: white;
  border: 1px solid var(--line);
  padding: 28px;
}
.split-hero h1 { color: var(--ink); }
.split-hero p:not(.eyebrow) { color: var(--muted); }
.split-hero img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
}
.lore-layout {
  display: grid;
  grid-template-columns: 1.5fr .8fr;
  gap: 20px;
  align-items: start;
  margin-bottom: 28px;
}
.lore-layout article, .facts-panel, .program-panel, .timeline, .service-grid article, .news-list article {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
}
.lore-layout p, .service-grid p, .news-list p {
  color: var(--muted);
  line-height: 1.65;
}
.facts-panel dl { grid-template-columns: 110px 1fr; }
.program-panel ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.9;
  font-weight: 700;
}
.timeline { display: grid; gap: 12px; }
.timeline div {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.timeline strong { color: var(--blue); }
.timeline span { color: var(--muted); }
.service-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.service-grid span {
  color: var(--blue);
  font-weight: 900;
  font-size: 13px;
}
.service-grid h2, .news-list h2 {
  margin: 8px 0 8px;
  font-size: 22px;
}
.news-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.news-list time {
  color: var(--blue);
  font-weight: 900;
  font-size: 13px;
}

@media (max-width: 860px) {
  .topbar { height: auto; align-items: flex-start; flex-direction: column; padding: 16px; gap: 14px; }
  .nav, .logout { flex-wrap: wrap; }
  .hero, .auth-grid, .detail-grid, .two, .story-grid, .public-band, .split-hero, .lore-layout, .service-grid, .news-list, .summary-grid, .dashboard-grid, .quick-grid, .info-grid, .alert-strip, .civic-strip { grid-template-columns: 1fr; }
  .civic-strip div { border-left: 0; border-top: 1px solid var(--line); }
  .civic-strip div:first-child { border-top: 0; }
  .hero { min-height: 0; }
  .hero-panel { min-height: 320px; }
  .public-hero, .image-hero > div { min-height: 360px; }
  .image-hero > div { padding: 28px; }
  .request-row, .document-row { grid-template-columns: 1fr; }
  .document-actions { justify-content: flex-start; }
  .page-head { align-items: flex-start; flex-direction: column; }
  dl { grid-template-columns: 1fr; }
}
