/**
 * @file
 * Branding et mise en forme « dashboard » du thème Middle Office (StatsRS).
 * Couleurs Ville & Métropole de Montpellier.
 */

:root {
  --mo-blue: #0356f2;
  --mo-blue-dark: #0246c9;
  --mo-mint: #51edc6;
  --mo-ink: #16223a;
  --mo-muted: #5b6b85;
  --mo-bg: #f4f7fb;
  --mo-card: #ffffff;
  --mo-border: #e3e9f2;
  --mo-radius: 12px;
  --mo-shadow: 0 1px 3px rgba(22, 34, 58, 0.06), 0 8px 24px rgba(22, 34, 58, 0.05);
  --mo-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html,
body {
  background: var(--mo-bg);
  color: var(--mo-ink);
  font-family: var(--mo-font);
  font-size: 16px;
  line-height: 1.5;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

/* Texte courant à ~0.82× (≈13px). On le pose sur body uniquement : html reste
   à 16px (ancre des `rem`), donc les titres (.page-title, h1…h3 en rem) gardent
   leur taille, et la barre d'administration (sa propre échelle) n'est pas
   touchée non plus. Demande Max. */
body {
  font-size: 0.82rem;
}

a {
  color: var(--mo-blue);
  text-decoration: none;
}
a:hover {
  color: var(--mo-blue-dark);
  text-decoration: underline;
}

.layout-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 48px;
}

/* ---- En-tête ---- */
header[role="banner"] {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 14px 0;
  margin-bottom: 28px;
  border-bottom: 3px solid var(--mo-blue);
}

header[role="banner"] a {
  text-decoration: none;
}

/* Bloc d'identité du site (logo + nom) */
.site-branding__name a,
header[role="banner"] .site-branding a {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--mo-ink);
  background: linear-gradient(135deg, var(--mo-blue), var(--mo-mint));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Menu de compte (Max / se déconnecter) aligné à droite */
header[role="banner"] nav ul,
header[role="banner"] .menu {
  display: flex;
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}
header[role="banner"] nav a {
  color: var(--mo-muted);
  font-weight: 600;
  font-size: 0.82rem;
}
header[role="banner"] nav a:hover {
  color: var(--mo-blue);
}

/* ---- Titre de page (corrige aussi tout rognage) ---- */
.page-title,
main h1,
.block-page-title-block h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--mo-ink);
  margin: 0 0 20px;
  padding: 0;
}

/* ---- Onglets / actions locales ---- */
nav.tabs,
.block-local-tasks-block {
  margin-bottom: 20px;
}

/* ---- Carte de contenu principale (vues, formulaires) ---- */
.layout-content > .region-content,
.layout-content {
  display: block;
}

.views-element-container,
.view,
form.user-form,
form#user-login-form,
.block-system-main-block > * {
  background: var(--mo-card);
  border: 1px solid var(--mo-border);
  border-radius: var(--mo-radius);
  box-shadow: var(--mo-shadow);
  padding: 24px;
  margin-bottom: 24px;
}

/* ---- Tableaux (dashboard Views) ---- */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
thead th {
  text-align: left;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--mo-muted);
  padding: 10px 14px;
  border-bottom: 2px solid var(--mo-blue);
  white-space: nowrap;
}
thead th a {
  color: var(--mo-muted);
}
tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--mo-border);
  vertical-align: middle;
}
tbody tr:hover {
  background: #f7faff;
}
td a {
  word-break: break-all;
}

/* ---- Boutons / formulaires ---- */
.button,
button.button,
input[type="submit"],
.form-submit {
  background: var(--mo-blue);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 10px 18px;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s ease;
}
.button:hover,
input[type="submit"]:hover,
.form-submit:hover {
  background: var(--mo-blue-dark);
  color: #fff;
  text-decoration: none;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
select,
textarea {
  border: 1px solid var(--mo-border);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 0.82rem;
  font-family: inherit;
  max-width: 100%;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--mo-blue);
  outline-offset: 1px;
  border-color: var(--mo-blue);
}

label {
  font-weight: 600;
  color: var(--mo-ink);
}

/* ---- Fil d'Ariane ---- */
nav.breadcrumb ol,
.breadcrumb {
  padding: 0;
  margin: 0 0 12px;
  font-size: 0.85rem;
  color: var(--mo-muted);
}

/* ---- Pied de page ---- */
footer[role="contentinfo"] {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--mo-border);
  color: var(--mo-muted);
  font-size: 0.85rem;
}

/* Colonne actuellement triée : surbrillance discrète (au lieu du gris par défaut) */
table td.active,
table th.active {
  background-color: rgba(3, 86, 242, 0.04);
}
