/*
 * FICHIER: assets/css/app.css
 * Révision: 1.3
 * Date de révision: 2026-09-28 20:28:00 UTC
 * Description: Feuille de style globale Constel (ex-style.css + header + nav).
 *              Palette inspirée du site public Groupe Noël :
 *              - Bleu marine profond (#0A2F5C) pour l'autorité et le corporate
 *              - Teal (#00A99D) pour l'efficacité énergétique / CVCA
 *              - Typographie system-ui moderne et lisible
 *              - Design épuré, cartes avec ombre douce, espacement aéré
 * Note: Toutes les timestamps en base de données doivent être en UTC.
 */

:root {
  --primary-color: #0A2F5C;
  --accent-color: #00A99D;
  --accent-dark: #008F84;
  --text-dark: #1E293B;
  --text-muted: #64748B;
  --bg-light: #E2E8F0;
  --white: #FFFFFF;
  --border-color: #E2E8F0;
  --success: #10B981;
  --warning: #F59E0B;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-dark);
  background-color: var(--bg-light);
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* === TOP HEADER / NAVBAR === */
.top-header {
  background-color: var(--primary-color);
  color: var(--white);
  padding: 0.85rem 0;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.top-header .header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.5px;
}

.logo span {
  color: #fff;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-avatar {
  width: 36px;
  height: 36px;
  background-color: var(--accent-color);
  color: white;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
}

.user-info {
  text-align: right;
  font-size: 0.875rem;
}

.user-info .name {
  font-weight: 600;
}

.user-info .role {
  font-size: 0.75rem;
  opacity: 0.85;
}

/* === NAVIGATION === */
.main-nav {
  background-color: var(--white);
  border-bottom: 1px solid var(--border-color);
  padding: 0.5rem 0;
}

.main-nav nav ul {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
}
.nav-item-admin,
.nav-item-droite {
  margin-left: auto;
}

.main-nav .nav-link {
  padding: 0.5rem 0.25rem;
  font-weight: 500;
  color: var(--text-dark);
  transition: color 0.2s ease;
  position: relative;
}

.main-nav .nav-link:hover {
  color: var(--accent-color);
}

.main-nav .nav-link.active {
  color: var(--accent-color);
  font-weight: 600;
}

.main-nav .nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 3px;
  background-color: var(--accent-color);
  border-radius: 3px;
}

/* === CARDS & DASHBOARD === */
.card {
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

.stat-card {
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.25rem;
  font-size: 0.925rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--accent-color);
  color: white;
}

.btn-primary:hover {
  background-color: var(--accent-dark);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: #F1F5F9;
  color: var(--text-dark);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: #E2E8F0;
}

/* === FORMS (Login) === */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-dark);
  font-size: 0.9rem;
}

.form-group input {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 4px rgba(0, 169, 157, 0.15);
}

/* === TABLE === */
table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  background-color: #F8FAFC;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

tr:hover {
  background-color: #F8FAFC;
}

/* === FOOTER === */
footer {
  background-color: var(--primary-color);
  color: rgba(255,255,255,0.75);
  font-size: 0.8rem;
  padding: 1.25rem 0;
  margin-top: 3rem;
}

footer a {
  color: rgba(255,255,255,0.9);
}

/* === UTILITIES === */
.text-accent { color: var(--accent-color); }
.bg-accent { background-color: var(--accent-color); color: white; }
.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 1.25rem;
}

/* Layout plein écran (ex-header.php) */
.container {
  max-width: 100% !important;
  width: 100%;
  padding-left: 2.5rem;
  padding-right: 2.5rem;
  box-sizing: border-box;
}
.container-fluid {
  width: 100%;
  max-width: 100%;
  padding-left: 2.5rem;
  padding-right: 2.5rem;
  box-sizing: border-box;
}
.top-header { width: 100%; }
@media (min-width: 1600px) {
  .container, .container-fluid {
    padding-left: 3rem;
    padding-right: 3rem;
  }
}

.emulate-banner {
  background: #FEF3C7;
  color: #92400E;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #FCD34D;
}
.emulate-banner a {
  color: #92400E;
  font-weight: 600;
  text-decoration: underline;
}
.emulate-form {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 auto;
}
.emulate-form select {
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
  border-radius: 6px;
  border: 1px solid #EAB308;
  background-color: #FEF08A;
  color: #1E293B;
  min-width: 440px;
  max-width: 520px;
  font-weight: 500;
}
.emulate-form select:focus {
  outline: 2px solid #FACC15;
  border-color: #CA8A04;
}
.emulate-form button {
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  background-color: #FACC15 !important;
  color: #1E293B !important;
  border: 1px solid #EAB308 !important;
  border-radius: 6px;
  cursor: pointer;
}
.emulate-form button:hover { background-color: #EAB308 !important; }

.header-online {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  max-width: 320px;
}
.header-online-label {
  font-size: 0.7rem;
  color: #64748B;
  margin-right: 0.15rem;
  white-space: nowrap;
}
.header-online-pill-wrap { position: relative; display: inline-flex; }
.header-online-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
  border: 2px solid #E2E8F0;
  box-sizing: border-box;
  line-height: 1;
  cursor: default;
  text-decoration: none;
}
.header-online-pill-wrap:hover .header-online-pill {
  transform: scale(1.08);
  border-color: #0A2F5C;
}
.header-online-tip {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #0F172A;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.45rem 0.7rem;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 200;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  pointer-events: none;
  text-align: center;
  line-height: 1.35;
}
.header-online-tip::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-bottom-color: #0F172A;
}
.header-online-tip div + div {
  margin-top: 0.15rem;
  font-weight: 400;
  opacity: 0.9;
  font-size: 0.72rem;
}
.header-online-pill-wrap:hover .header-online-tip { display: block; }
.header-online-more {
  font-size: 0.75rem;
  color: #0A2F5C;
  font-weight: 600;
  text-decoration: none;
  margin-left: 0.15rem;
}
.header-online-more:hover { text-decoration: underline; }
@media (max-width: 1100px) {
  .header-online-label { display: none; }
  .emulate-form select { min-width: 220px; max-width: 280px; }
}

.nav-vue-fictifs {
  display: flex;
  align-items: center;
  gap: .3rem;
  margin-left: .5rem;
  flex-wrap: wrap;
}
.nav-vue-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #94A3B8;
  margin-right: .15rem;
  white-space: nowrap;
}
.nav-vue-btn {
  display: inline-block;
  padding: .18rem .55rem;
  border-radius: 999px;
  font-size: .75rem;
  line-height: 1.2;
  text-decoration: none;
  border: 1px solid #334155;
  color: #CBD5E1;
  background: transparent;
  white-space: nowrap;
}
.nav-vue-btn.on {
  background: #0A2F5C;
  border-color: #93C5FD;
  color: #fff;
}
.nav-vue-btn:hover {
  border-color: #93C5FD;
  color: #fff;
}

.tag-btn {
  border: 1px solid #CBD5E1;
  background: #fff;
  color: #334155;
  border-radius: 999px;
  padding: .2rem .65rem;
  font-size: .75rem;
  cursor: pointer;
}
.tag-btn.on {
  outline: 2px solid #0A2F5C;
  background: #EFF6FF;
  color: #0A2F5C;
}