:root {
  --bg: #f1f5f9;
  --bg-subtle: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --border-soft: rgba(226, 232, 240, 0.85);
  --primary: #0d9488;
  --primary-dark: #0f766e;
  --accent: #f97316;
  --accent-soft: #fff7ed;
  --danger: #dc2626;
  --warning: #d97706;
  --success: #16a34a;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-hover: 0 2px 4px rgba(15, 23, 42, 0.05), 0 14px 32px rgba(15, 23, 42, 0.09);
  --font-display: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --font-body: "DM Sans", "Segoe UI", system-ui, sans-serif;
  --header-h: 4.25rem;
  --bottom-nav-h: 4.25rem;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  background-image: var(--bg-subtle);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 0.9375rem;
}

h1, h2, h3, h4, .btn, .nav-link, .brand-tagline {
  font-family: var(--font-display);
}

h1, h2, h3 {
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: max(1rem, var(--safe-left));
  padding-right: max(1rem, var(--safe-right));
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  color: white;
  padding: 0.65rem 0;
  padding-top: calc(0.65rem + var(--safe-top));
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  color: white;
  text-decoration: none;
  min-width: 0;
}

.brand-mark {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  min-width: 0;
}

.brand-logo {
  display: block;
  height: 2.75rem;
  width: auto;
  max-width: 8.5rem;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.18));
}

.brand-tagline {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  line-height: 1.15;
  opacity: 0.92;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.75rem;
  height: 2.75rem;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  width: 1.25rem;
  height: 2px;
  margin: 0 auto;
  background: white;
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.nav-backdrop {
  display: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-drawer-head,
.nav-drawer-foot {
  display: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.nav-link {
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  font-size: 0.92rem;
  min-height: 2.5rem;
  display: inline-flex;
  align-items: center;
}

.nav-link:hover, .nav-link.active { background: rgba(255,255,255,0.15); color: white; }

.nav-user {
  color: rgba(255,255,255,0.85);
  font-size: 0.82rem;
  padding: 0.4rem 0.5rem;
  white-space: nowrap;
}

.bottom-nav {
  display: none;
}

.main-content {
  flex: 1;
  padding: 1.75rem 0 3.25rem;
  width: 100%;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1rem 0;
  color: var(--muted);
  font-size: 0.85rem;
  background: var(--surface);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.58rem 1.05rem;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  min-height: 2.75rem;
  touch-action: manipulation;
}

.btn-block { width: 100%; }

.btn:hover { transform: translateY(-1px); }

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 12px rgba(13,148,136,0.35); }

.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: #fee2e2; color: var(--danger); }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.85rem; }

.flashes { margin-top: 1rem; }
.flash {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}
.flash-success { background: #dcfce7; color: #166534; }
.flash-error { background: #fee2e2; color: #991b1b; }

.page-header { margin-bottom: 2rem; }

.page-header h1 {
  font-size: clamp(1.5rem, 2.5vw, 1.875rem);
  font-weight: 700;
  margin-bottom: 0.45rem;
  color: var(--text);
}

.page-header p {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 42rem;
  line-height: 1.55;
}

.page-header .breadcrumb {
  font-size: 0.82rem;
  margin-bottom: 0.65rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-soft);
}

.stat-card-link {
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.stat-card-link:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(13, 148, 136, 0.18);
}

.dashboard-stats .stat-card-link {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.stat-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.65rem;
  height: 2.65rem;
  border-radius: 12px;
  flex-shrink: 0;
}

.stat-card-icon svg {
  width: 1.35rem;
  height: 1.35rem;
}

.stat-card-body { min-width: 0; }

.stat-card-accent-teal .stat-card-icon { background: #ecfdf5; color: #0f766e; }
.stat-card-accent-amber .stat-card-icon { background: #fff7ed; color: #c2410c; }
.stat-card-accent-violet .stat-card-icon { background: #f5f3ff; color: #6d28d9; }
.stat-card-accent-rose .stat-card-icon { background: #fff1f2; color: #e11d48; }
.stat-card-accent-blue .stat-card-icon { background: #eff6ff; color: #2563eb; }
.stat-card-accent-slate .stat-card-icon { background: #f1f5f9; color: #475569; }

/* Dashboard */
.dashboard-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-soft);
}

.dashboard-hero-kicker {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary-dark);
  margin-bottom: 0.45rem;
}

.dashboard-hero h1 {
  font-size: clamp(1.65rem, 3vw, 2.125rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.03em;
}

.dashboard-hero-greeting {
  color: var(--muted);
  font-weight: 600;
}

.dashboard-hero-lead {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 36rem;
  line-height: 1.55;
}

.dashboard-hero-date {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  font-size: 0.88rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 0.65rem 1rem;
  box-shadow: var(--shadow);
}

.dashboard-hero-date-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.dashboard-hero-date strong {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text);
}

.dashboard-stats { margin-bottom: 1.5rem; }

/* Recherche globale (accueil) */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.dashboard-search-wrap {
  margin-bottom: 1.75rem;
  position: relative;
}

.dashboard-search-form {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: calc(var(--radius) + 4px);
  padding: 1rem 1.1rem 0.85rem;
  box-shadow: var(--shadow);
}

.dashboard-search-field {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.dashboard-search-icon {
  display: inline-flex;
  color: var(--muted);
  flex-shrink: 0;
}

.dashboard-search-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.dashboard-search-field input[type="search"] {
  flex: 1 1 14rem;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.7rem 1rem;
  font-size: 1rem;
  background: #fafbfc;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.dashboard-search-field input[type="search"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
  background: white;
}

.dashboard-search-clear {
  border: none;
  background: #e2e8f0;
  color: #475569;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  flex-shrink: 0;
}

.dashboard-search-clear:hover {
  background: #cbd5e1;
}

.dashboard-search-submit {
  flex-shrink: 0;
  border-radius: 999px;
  padding-left: 1.15rem;
  padding-right: 1.15rem;
}

.dashboard-search-hint {
  margin: 0.65rem 0 0 0.15rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.dashboard-search-live {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% - 0.35rem);
  z-index: 40;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
  max-height: min(24rem, 60vh);
  overflow: auto;
}

.dashboard-search-live-group + .dashboard-search-live-group {
  border-top: 1px solid var(--border-soft);
}

.dashboard-search-live-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.9rem 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.dashboard-search-live-head a {
  font-size: 0.75rem;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}

.dashboard-search-live-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  padding: 0.65rem 0.9rem;
  text-decoration: none;
  color: inherit;
  border-top: 1px solid var(--border-soft);
}

.dashboard-search-live-item:hover,
.dashboard-search-live-item.active {
  background: rgba(13, 148, 136, 0.08);
}

.dashboard-search-live-item strong {
  display: block;
  font-size: 0.92rem;
}

.dashboard-search-live-item span {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
}

.dashboard-search-live-empty,
.dashboard-search-live-loading {
  padding: 1rem 0.9rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.dashboard-search-results {
  margin-bottom: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow);
}

.dashboard-search-results-head h2 {
  font-size: 1.05rem;
  margin-bottom: 1rem;
}

.dashboard-search-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.dashboard-search-group {
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 0.85rem;
  background: #fafbfc;
}

.dashboard-search-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.55rem;
}

.dashboard-search-group-head h3 {
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.dashboard-search-more {
  font-size: 0.8rem;
}

.dashboard-search-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dashboard-search-item {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.55rem 0;
  text-decoration: none;
  color: inherit;
  border-top: 1px solid var(--border-soft);
}

.dashboard-search-item:first-child {
  border-top: none;
  padding-top: 0;
}

.dashboard-search-item:hover strong {
  color: var(--primary-dark);
}

.dashboard-search-item-body strong {
  display: block;
  font-size: 0.92rem;
}

.dashboard-search-item-body span {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
}

.dashboard-search-item-kind {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  margin-top: 0.45rem;
  flex-shrink: 0;
  background: var(--primary);
}

.dashboard-search-item-kind[data-kind="fournisseur"] { background: #d97706; }
.dashboard-search-item-kind[data-kind="documentation"],
.dashboard-search-item-kind[data-kind="documentation-resource"] { background: #2563eb; }
.dashboard-search-item-kind[data-kind="todo"] { background: #7c3aed; }
.dashboard-search-item-kind[data-kind="event"] { background: #e11d48; }
.dashboard-search-item-kind[data-kind="project"] { background: #475569; }

.dashboard-alert {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.dashboard-alert-icon {
  display: flex;
  flex-shrink: 0;
  color: #ea580c;
}

.dashboard-alert-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.dashboard-alert a { color: #c2410c; font-weight: 600; }

.dashboard-shortcuts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.shortcut-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.15rem 1.1rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.shortcut-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(13, 148, 136, 0.22);
}

.shortcut-card strong {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.shortcut-meta {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

.shortcut-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 14px;
  margin-bottom: 0.35rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.shortcut-icon-wrap svg {
  width: 1.35rem;
  height: 1.35rem;
}

.shortcut-icon-teal { background: linear-gradient(135deg, #ccfbf1, #99f6e4); color: #0f766e; }
.shortcut-icon-violet { background: linear-gradient(135deg, #ede9fe, #ddd6fe); color: #6d28d9; }
.shortcut-icon-amber { background: linear-gradient(135deg, #ffedd5, #fed7aa); color: #c2410c; }
.shortcut-icon-emerald { background: linear-gradient(135deg, #d1fae5, #a7f3d0); color: #047857; }
.shortcut-icon-rose { background: linear-gradient(135deg, #ffe4e6, #fecdd3); color: #e11d48; }
.shortcut-icon-blue { background: linear-gradient(135deg, #dbeafe, #bfdbfe); color: #2563eb; }

.dashboard-panels {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.dashboard-panel {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow);
}

.dashboard-panel-wide { margin-top: 1.25rem; }

.dashboard-panel-title {
  font-size: 1.05rem;
  margin-bottom: 0.85rem;
}

.dashboard-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-soft);
}

.dashboard-panel-head h2 {
  font-size: 1.05rem;
  font-weight: 700;
}

.dashboard-panel-action { margin-top: 0.85rem; }

.dashboard-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.dashboard-list-item {
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}

.dashboard-list-item:last-child { border-bottom: none; padding-bottom: 0; }

.dashboard-list-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem;
}

.dashboard-list-main a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.dashboard-list-main a:hover { color: var(--primary); }

.dashboard-list-meta {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.text-overdue { color: var(--danger); font-weight: 600; }

.dashboard-groupes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.dashboard-groupe-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  text-decoration: none;
  color: inherit;
  font-size: 0.85rem;
}

.dashboard-groupe-chip:hover { border-color: var(--primary); }
.dashboard-groupe-chip strong { color: var(--primary); }

@media (max-width: 800px) {
  .dashboard-panels { grid-template-columns: 1fr; }
}

.stat-card .value {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.stat-card .label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.2rem;
  letter-spacing: 0.01em;
}

.filters {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  align-items: center;
}

.filters input, .filters select {
  padding: 0.58rem 0.9rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: var(--font-body);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.filters input { flex: 1; min-width: 200px; }

.structures-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 1.25rem;
}

.structure-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  text-decoration: none;
  color: inherit;
}

.structure-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(13, 148, 136, 0.16);
}

.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; }

.card-top h2 {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-groupe { background: #e0f2fe; color: #0369a1; }
.badge-good { background: #dcfce7; color: #166534; }
.badge-medium { background: #fef9c3; color: #854d0e; }
.badge-low { background: #ffedd5; color: #9a3412; }
.badge-critical { background: #fee2e2; color: #991b1b; }
.badge-urgence { background: #fee2e2; color: var(--danger); }
.badge-done { background: #dcfce7; color: #166534; }

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  min-height: 2.5rem;
}

.checkbox-label input { width: 1rem; height: 1rem; }

.card-meta { font-size: 0.85rem; color: var(--muted); }
.card-meta strong { color: var(--text); font-weight: 600; }

.card-resume {
  font-size: 0.85rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.problemes-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tag {
  background: var(--accent-soft);
  color: #c2410c;
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

.detail-header {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.detail-header h1 { font-size: 1.6rem; margin-bottom: 0.5rem; }
.detail-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.info-item { font-size: 0.9rem; }
.info-item .label { color: var(--muted); font-size: 0.8rem; }
.info-item .value { font-weight: 500; }

.urgence-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  color: #991b1b;
}

.urgence-box h3 { font-size: 0.95rem; margin-bottom: 0.35rem; }

.sections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 1.25rem;
}

.section-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.section-card h3 {
  font-size: 1rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary);
  color: var(--primary-dark);
}

.field-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0.5rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.88rem;
}

.field-row:last-child { border-bottom: none; }
.field-label { color: var(--muted); font-size: 0.82rem; }
.field-value { word-break: break-word; }

.empty-section { color: var(--muted); font-size: 0.85rem; font-style: italic; }

.form-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-soft);
  margin-bottom: 1.5rem;
}

.form-card h2 {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.form-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.form-card-head h2 { margin-bottom: 0; }

.form-hint {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.contacts-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-row {
  padding: 1rem;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: #f8fafc;
}

.contact-row .form-grid { margin-bottom: 0.75rem; }

.contact-remove-btn { margin-left: auto; }

.contacts-extra-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.35rem;
}

.contact-extra-item {
  padding: 0.55rem 0.65rem;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 0.85rem;
}

.contact-extra-role { color: var(--muted); font-weight: normal; }

.attachment-existing { margin-bottom: 0.5rem; }

.attachment-existing-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.65rem;
}

.attachment-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.attachment-gallery-compact {
  margin-top: 0.55rem;
  gap: 0.45rem;
}

.attachment-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 140px;
}

.attachment-thumb {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.attachment-thumb:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
}

.attachment-thumb img {
  display: block;
  width: 120px;
  height: 90px;
  object-fit: cover;
}

.attachment-gallery-compact .attachment-thumb img {
  width: 72px;
  height: 54px;
}

.attachment-file {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
  font-size: 0.82rem;
  max-width: 220px;
}

.attachment-file-compact {
  padding: 0.35rem 0.55rem;
  font-size: 0.75rem;
  max-width: 180px;
}

.attachment-file-icon { flex-shrink: 0; }

.attachment-file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-delete {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.cal-attachment-badge {
  margin-left: 0.25rem;
  font-size: 0.72rem;
  opacity: 0.85;
}

.upcoming-item {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.upcoming-item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.lightbox {
  position: relative;
  width: min(92vw, 960px);
  max-height: 92vh;
  padding: 0;
  border: none;
  border-radius: 14px;
  background: #0f172a;
  color: #fff;
  overflow: hidden;
}

.lightbox::backdrop {
  background: rgba(15, 23, 42, 0.82);
}

.lightbox-image {
  display: block;
  width: 100%;
  max-height: calc(92vh - 3rem);
  object-fit: contain;
  background: #020617;
}

.lightbox-caption {
  margin: 0;
  padding: 0.75rem 1rem 1rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
  z-index: 2;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox[open] {
  position: fixed;
  inset: auto;
  margin: auto;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.form-group { display: flex; flex-direction: column; gap: 0.3rem; }
.form-group.full { grid-column: 1 / -1; }

.form-group label { font-size: 0.82rem; font-weight: 600; color: var(--muted); }

.form-group input,
.form-group select,
.form-group textarea {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
}

.form-group textarea { min-height: 80px; resize: vertical; }

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.table-wrap {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { padding: 0.85rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
th { background: #f8fafc; font-weight: 600; color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fafc; }

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}

.admin-bar {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
  font-size: 0.85rem;
  color: var(--muted);
}

.nav-user {
  color: rgba(255,255,255,0.85);
  font-size: 0.85rem;
  padding: 0.4rem 0.5rem;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0d9488 0%, #134e4a 50%, #1e293b 100%);
  padding: 1.5rem;
}

.login-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.65);
}

.login-brand {
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-logo {
  display: block;
  margin: 0 auto 0.65rem;
  width: auto;
  max-width: min(180px, 72%);
  height: auto;
  max-height: 150px;
  object-fit: contain;
}

.login-tagline {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary-dark);
}

.login-brand h1 {
  font-size: 1.25rem;
  margin: 0.5rem 0;
  color: var(--text);
}

.login-brand p {
  color: var(--muted);
  font-size: 0.9rem;
}

.login-form .form-group {
  margin-bottom: 1rem;
}

.login-btn {
  width: 100%;
  justify-content: center;
  margin-top: 0.5rem;
  padding: 0.7rem;
}

/* Calendrier */
.calendar-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.calendar-month {
  font-size: 1.25rem;
  flex: 1;
  text-align: center;
  min-width: 180px;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.legend-item { display: flex; align-items: center; gap: 0.35rem; }
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.calendar-wrap {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.calendar-head {
  background: #f8fafc;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
}

.calendar-head > div,
.calendar-day {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  min-height: 100px;
  padding: 0.4rem;
}

.calendar-head > div { min-height: auto; padding: 0.6rem; text-align: center; }
.calendar-day:nth-child(7n) { border-right: none; }

.calendar-day.other-month { background: #fafbfc; opacity: 0.55; }
.calendar-day.today { background: #ecfdf5; }
.calendar-day.today .day-num { color: var(--primary-dark); font-weight: 700; }

.day-num { font-size: 0.82rem; font-weight: 600; margin-bottom: 0.25rem; }
.day-items { display: flex; flex-direction: column; gap: 0.2rem; }

.cal-item {
  font-size: 0.68rem;
  line-height: 1.25;
  padding: 0.15rem 0.3rem;
  border-radius: 4px;
  border-left: 3px solid transparent;
  background: #f1f5f9;
}

.cal-item-row {
  display: flex;
  align-items: flex-start;
  gap: 0.2rem;
}

.cal-item-content {
  flex: 1;
  min-width: 0;
}

.cal-event-toggle { margin: 0; flex-shrink: 0; }

.cal-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1;
  cursor: pointer;
}

.cal-toggle-btn:hover { border-color: var(--primary); color: var(--primary-dark); }

.cal-item-done {
  opacity: 0.72;
  background: #ecfdf5 !important;
  border-left-color: #16a34a !important;
}

.cal-item-done .cal-item-content > a,
.cal-item-done .cal-item-content {
  text-decoration: line-through;
  color: var(--muted);
}

.cal-done-badge {
  display: inline-block;
  margin-left: 0.15rem;
  padding: 0.05rem 0.25rem;
  font-size: 0.55rem;
  vertical-align: middle;
}

.cal-project {
  display: block;
  color: #0369a1 !important;
  font-weight: 600;
}

.event-done-dot { background: #16a34a; }

.cal-item a { color: inherit; text-decoration: none; }
.cal-item a:hover { text-decoration: underline; }
.cal-item small { display: block; color: var(--muted); font-size: 0.62rem; }

.event-maintenance { border-left-color: #0d9488; background: #ecfdf5; }
.event-contrat { border-left-color: #d97706; background: #fff7ed; }
.event-intervention { border-left-color: #dc2626; background: #fef2f2; }
.event-autre { border-left-color: #64748b; background: #f1f5f9; }
.todo-dot { background: #8b5cf6; }
.todo-dot-item { border-left-color: #8b5cf6; background: #f5f3ff; }
.todo-dot-item.done { opacity: 0.5; text-decoration: line-through; }

.upcoming-list { list-style: none; }
.upcoming-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

/* Projets */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.breadcrumb a { color: var(--primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.project-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-soft);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.project-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(13, 148, 136, 0.16);
}

.project-card-head h2 {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}

.project-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.project-status-en_cours { background: #dbeafe; color: #1d4ed8; }
.project-status-planifie { background: #fef3c7; color: #b45309; }
.project-status-termine { background: #dcfce7; color: #15803d; }

.census-banner {
  margin-top: 0.75rem;
  padding: 0.65rem 0.9rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  font-size: 0.88rem;
  color: #1e40af;
}

.census-banner a { color: #1d4ed8; font-weight: 600; }

.stats-grid-compact {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin-bottom: 1.25rem;
}

@media (max-width: 640px) {
  .stats-grid-compact { grid-template-columns: 1fr; }
}

.project-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 1rem;
  position: relative;
}

.project-timeline-item {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.project-timeline-item:last-child { border-bottom: none; }

.project-timeline-item::before {
  content: "";
  position: absolute;
  left: 3.65rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.project-timeline-item:last-child::before { bottom: 50%; }
.project-timeline-item:first-child::before { top: 1.25rem; }

.project-timeline-marker {
  position: relative;
  z-index: 1;
  padding-top: 0.15rem;
}

.project-timeline-date {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary-dark);
  background: #ecfdf5;
  border: 1px solid #99f6e4;
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  line-height: 1.2;
}

.project-timeline-body { min-width: 0; }

.project-timeline-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.project-timeline-title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.project-timeline-title a {
  color: var(--text);
  text-decoration: none;
}

.project-timeline-title a:hover { color: var(--primary-dark); text-decoration: underline; }

.project-timeline-desc {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
  color: var(--muted);
  white-space: pre-wrap;
}

.project-timeline-item.is-done .project-timeline-title,
.project-timeline-item.is-done .project-timeline-title a {
  color: var(--muted);
  text-decoration: line-through;
}

.project-timeline-todo .project-timeline-date { background: #f5f3ff; border-color: #ddd6fe; color: #5b21b6; }
.project-timeline-event .project-timeline-date { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }

@media (max-width: 640px) {
  .project-timeline-item {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .project-timeline-item::before { display: none; }
}

/* To-do */
.todo-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
}

.todo-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.todo-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.todo-project-filter select {
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 0.88rem;
}

.todo-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

.todo-column {
  background: #f8fafc;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  min-height: 200px;
  min-width: 0;
  overflow: hidden;
}

.todo-column-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.88rem;
  border-bottom: 2px solid var(--border);
}

.todo-column-head.priority-high { border-bottom-color: var(--danger); color: #b91c1c; }
.todo-column-head.priority-medium { border-bottom-color: var(--primary); color: #1d4ed8; }
.todo-column-head.priority-low { border-bottom-color: #94a3b8; color: #475569; }

.todo-column-count {
  background: var(--surface);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-size: 0.78rem;
}

.todo-column-body {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.todo-column-empty {
  font-size: 0.82rem;
  color: var(--muted);
  font-style: italic;
  text-align: center;
  padding: 1rem 0.5rem;
}

.todo-list { display: flex; flex-direction: column; gap: 0.75rem; }

.todo-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
}

.todo-column .todo-card {
  box-shadow: none;
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  grid-template-areas:
    "check body"
    "actions actions";
  gap: 0.45rem 0.55rem;
  align-items: start;
  padding: 0.85rem;
}

.todo-column .todo-check { grid-area: check; }
.todo-column .todo-body { grid-area: body; min-width: 0; }

.todo-column .todo-card .todo-actions {
  grid-area: actions;
  width: 100%;
  flex-direction: row;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.35rem;
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
  margin-top: 0.15rem;
}

.todo-column .todo-priority-dot,
.todo-column .tag-priority-high,
.todo-column .tag-priority-medium,
.todo-column .tag-priority-low {
  display: none;
}

.todo-card.priority-high { border-left-color: var(--danger); }
.todo-card.priority-low { border-left-color: #94a3b8; }
.todo-card.completed { opacity: 0.7; background: #f8fafc; }
.todo-card.completed .todo-title { text-decoration: line-through; color: var(--muted); }
.todo-card.overdue { background: #fff7ed; }

.todo-toggle {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 1rem;
  color: var(--primary);
  flex-shrink: 0;
}

.todo-toggle:hover { border-color: var(--primary); background: #ecfdf5; }

.todo-body { flex: 1; min-width: 0; }

.todo-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.todo-priority-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.todo-priority-dot.priority-high { background: var(--danger); }
.todo-priority-dot.priority-medium { background: var(--primary); }
.todo-priority-dot.priority-low { background: #94a3b8; }

.todo-title {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.todo-desc {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.35rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.todo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.todo-meta .badge,
.todo-meta .tag {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.todo-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex-shrink: 0;
}

.todo-actions form { margin: 0; }

.tag-priority-high { background: #fee2e2; color: #b91c1c; }
.tag-priority-medium { background: #dbeafe; color: #1d4ed8; }
.tag-priority-low { background: #f1f5f9; color: #475569; }

.dashboard-list-main .tag {
  flex-shrink: 0;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .todo-board { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .todo-list .todo-card { flex-wrap: wrap; }
  .todo-list .todo-actions { flex-direction: row; width: 100%; justify-content: flex-end; }
}

/* Documentation */
.doc-section-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.doc-section-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.2s, border-color 0.2s;
}

.doc-section-tab:hover {
  border-color: var(--primary);
  background: rgba(13, 148, 136, 0.06);
}

.doc-section-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.doc-section-tab-count {
  font-size: 0.78rem;
  opacity: 0.85;
  background: rgba(0,0,0,0.08);
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
}

.doc-section-tab.active .doc-section-tab-count {
  background: rgba(255,255,255,0.2);
}

.doc-section-desc {
  font-size: 0.85rem;
  color: var(--muted);
  margin: -0.5rem 0 1rem;
}

.detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.documentation-grid,
.applications-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.documentation-card,
.application-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.documentation-card:hover,
.application-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.1);
}

.documentation-card-head,
.application-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.documentation-card-head h2,
.application-card-head h2 { font-size: 1.05rem; }

.documentation-meta,
.application-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.docs-list { display: flex; flex-direction: column; gap: 1rem; }

.doc-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  background: #fafbfc;
}

.doc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.doc-body { font-size: 0.9rem; }
.doc-body a { color: var(--primary); word-break: break-all; }

.doc-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

/* Fournisseurs */
.fournisseurs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 1.25rem;
}

.fournisseur-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.fournisseur-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.fournisseur-card-head h2 {
  font-size: 1.05rem;
  line-height: 1.3;
}

.fournisseur-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem 1rem;
}

.fournisseur-field { font-size: 0.88rem; }
.fournisseur-field.full { grid-column: 1 / -1; }
.fournisseur-field .label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.15rem;
}
.fournisseur-field .value { word-break: break-word; }
.fournisseur-field .value a { color: var(--primary); }
.notes-block {
  display: block;
  background: #f8fafc;
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  font-size: 0.85rem;
  color: var(--muted);
  white-space: pre-wrap;
}

.fournisseur-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

@media (max-width: 600px) {
  .field-row { grid-template-columns: 1fr; }
  .structures-grid { grid-template-columns: 1fr; }
  .fournisseurs-grid { grid-template-columns: 1fr; }
  .fournisseur-fields { grid-template-columns: 1fr; }
  .calendar-day { min-height: 70px; }
  .cal-item { font-size: 0.6rem; }
}

/* ── Responsive global + navigation mobile / PWA ── */
@media (max-width: 900px) {
  .nav-user-inline,
  .nav-link-inline-logout,
  .nav-admin-btn {
    display: none !important;
  }

  .nav-toggle { display: flex; }

  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
    z-index: 210;
  }

  body.nav-open .nav-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .nav.nav-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(88vw, 320px);
    max-width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: calc(1rem + var(--safe-top)) max(1rem, var(--safe-right)) calc(1rem + var(--safe-bottom));
    background: linear-gradient(180deg, #0f766e 0%, #134e4a 100%);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.2);
    transform: translateX(100%);
    transition: transform 0.25s ease;
    z-index: 220;
    overflow-y: auto;
  }

  body.nav-open .nav.nav-drawer { transform: translateX(0); }

  body.nav-open .nav-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  body.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }

  body.nav-open .nav-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .nav-drawer-head,
  .nav-drawer-foot {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .nav-drawer-title {
    font-weight: 700;
    font-size: 1.05rem;
  }

  .nav-user-drawer {
    color: rgba(255, 255, 255, 0.8);
    padding: 0;
    font-size: 0.82rem;
  }

  .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    margin: 1rem 0;
    flex: 1;
  }

  .nav-links .nav-link {
    width: 100%;
    padding: 0.75rem 0.85rem;
    font-size: 1rem;
    border-radius: 10px;
  }

  .nav-drawer-foot {
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
  }

  .nav-link-logout {
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
  }

  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 190;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding-bottom: var(--safe-bottom);
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.08);
  }

  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    padding: 0.45rem 0.25rem;
    min-height: var(--bottom-nav-h);
    color: var(--muted);
    text-decoration: none;
    font-size: 0.68rem;
    font-weight: 600;
    border: none;
    background: transparent;
    cursor: pointer;
    touch-action: manipulation;
  }

  .bottom-nav-item.active {
    color: var(--primary);
  }

  .bottom-nav-icon {
    font-size: 1.15rem;
    line-height: 1;
  }

  .main-content {
    padding-bottom: calc(2rem + var(--bottom-nav-h) + var(--safe-bottom));
  }

  .site-footer {
    padding-bottom: calc(1rem + var(--bottom-nav-h) + var(--safe-bottom));
  }

  .page-header h1,
  .dashboard-hero h1 { font-size: 1.45rem; }

  .detail-header h1 { font-size: 1.35rem; }

  .dashboard-hero {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-search-submit {
    width: 100%;
  }

  .dashboard-search-live {
    position: static;
    margin-top: 0.5rem;
  }

  .dashboard-hero-date {
    align-items: flex-start;
  }

  .dashboard-shortcuts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .documentation-grid,
  .applications-grid {
    grid-template-columns: 1fr;
  }

  .todo-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .todo-project-filter select {
    width: 100%;
  }

  .calendar-toolbar {
    justify-content: center;
  }

  .calendar-month {
    order: -1;
    width: 100%;
    text-align: center;
    margin-bottom: 0.25rem;
  }

  .form-actions .btn {
    flex: 1;
    min-width: calc(50% - 0.5rem);
  }
}

@media (max-width: 480px) {
  .brand-logo { height: 2.35rem; max-width: 7rem; }
  .brand-tagline { font-size: 0.55rem; letter-spacing: 0.05em; }

  .stats-grid,
  .dashboard-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-shortcuts {
    grid-template-columns: 1fr;
  }

  .stat-card .value { font-size: 1.45rem; }

  .form-card,
  .detail-header {
    padding: 1.15rem;
  }

  th, td {
    padding: 0.65rem 0.75rem;
    font-size: 0.82rem;
  }

  .filters input {
    min-width: 0;
    width: 100%;
  }

  .filters {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (min-width: 901px) {
  .main-content { padding: 2rem 0 3rem; }

  .header-inner {
    flex-wrap: nowrap;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .nav-admin-btn {
    margin-left: 0.25rem;
  }
}

@media (hover: none) {
  .btn:hover,
  .structure-card:hover,
  .project-card:hover,
  .shortcut-card:hover,
  .stat-card-link:hover {
    transform: none;
  }
}
