@import url("variables.css");

body {
  background:
    radial-gradient(circle at top right, rgba(47,111,237,.12), transparent 26%),
    linear-gradient(180deg, #eef4ff 0%, #f7f9fc 45%, #ffffff 100%);
  font-family: var(--font-sans);
  color: var(--app-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.form-label .text-danger,
label .text-danger {
  color: var(--men-blue-600) !important;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.btn-icon--danger:hover {
  color: var(--status-danger);
  border-color: var(--status-danger-border);
  background: var(--status-danger-bg);
}

.app-shell {
  max-width: 1440px;
}

.header {
  /* Layout & thème détaillés dans header.css */
}

.header-badge {
  flex: 0 1 320px;
  display: grid;
  gap: 10px;
  padding: 18px 18px;
  border-radius: 24px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}

.header-badge-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.72);
}

.header-badge-main {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.15;
}

.header-badge-copy {
  font-size: 13px;
  color: rgba(255,255,255,.78);
  line-height: 1.45;
}

.header-badge-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.header-stat {
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
}

.header-stat-label {
  display: block;
  font-size: 11px;
  color: rgba(255,255,255,.72);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 4px;
  font-weight: 700;
}

.header-stat-value {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
}

.done { text-decoration: line-through; color: green; }
.retard { color: #dc3545; font-weight: 700; }

.kpi-card {
  border: 1px solid rgba(255,255,255,0.75);
  border-radius: 22px;
  box-shadow: var(--app-shadow);
  transition: transform .2s ease, box-shadow .2s ease;
  overflow: hidden;
}

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 48px rgba(23, 58, 122, 0.16);
}

.kpi-card h6 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--app-muted);
  margin-bottom: 10px;
}

.kpi-card h3 {
  margin: 0;
  font-weight: 800;
  font-size: 2rem;
}

.kpi-card-modern {
  position: relative;
  min-height: 168px;
  padding: 18px !important;
  text-align: left !important;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.kpi-card-modern::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.45), rgba(255,255,255,0));
  pointer-events: none;
}

.kpi-card-modern > * {
  position: relative;
  z-index: 1;
}

.kpi-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.kpi-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(255,255,255,.75);
  font-size: 11px;
  font-weight: 800;
  color: #476081;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.kpi-icon {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: rgba(255,255,255,.74);
  border: 1px solid rgba(255,255,255,.85);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85);
}

.kpi-main {
  display: grid;
  gap: 6px;
}

.kpi-card-modern h3 {
  font-size: 2.1rem;
  letter-spacing: -.03em;
}

.kpi-caption {
  margin: 0;
  font-size: 13px;
  color: #5c6f8b;
  font-weight: 600;
}

.kpi-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.kpi-meta {
  font-size: 12px;
  color: #577092;
  font-weight: 700;
}

.status-flag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid transparent;
}

.status-flag::before,
.legend-chip::before,
.metric-pill.status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(255,255,255,.28);
}

.status-success { background: var(--status-success-bg); color: var(--status-success); border-color: var(--status-success-border); }
.status-warning { background: var(--status-warning-bg); color: var(--status-warning); border-color: var(--status-warning-border); }
.status-danger { background: var(--status-danger-bg); color: var(--status-danger); border-color: var(--status-danger-border); }
.status-secondary { background: var(--status-neutral-bg); color: var(--status-neutral); border-color: var(--status-neutral-border); }
.status-info { background: var(--status-info-bg); color: var(--status-info); border-color: var(--status-info-border); }
.status-primary { background: var(--status-primary-bg); color: var(--status-primary); border-color: var(--status-primary-border); }

.clickable-card { cursor: pointer; }

.section-card {
  border: 1px solid rgba(220, 230, 245, 0.95);
  border-radius: 22px;
  box-shadow: var(--app-shadow);
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(8px);
}

.dashboard-card {
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(247,250,255,.98));
}

.btn {
  border-radius: 14px;
  font-weight: 700;
  border-width: 1px;
}

.nav-pills-modern {
  display: inline-flex;
  gap: 10px;
  padding: 8px;
  background: rgba(255,255,255,.82);
  border: 1px solid var(--app-border);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(31,75,153,0.08);
}

.nav-pills-modern .btn {
  min-width: 140px;
}

.nav-pills-modern .btn.active {
  background: linear-gradient(135deg, #1b448d, #2f6fed);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 12px 24px rgba(47,111,237,.24);
}

.form-control,
.form-select {
  border-radius: 14px;
  border: 1px solid #d9e4f5;
  box-shadow: none;
  min-height: 46px;
}

.form-control:focus,
.form-select:focus {
  border-color: #4c86ff;
  box-shadow: 0 0 0 0.2rem rgba(76,134,255,.15);
}

.table-modern,
.table-modern thead,
.table-modern tbody,
.table-modern tr,
.table-modern td,
.table-modern th {
  border-color: #e7eef8 !important;
}

.table-modern thead {
  background: linear-gradient(180deg, #edf4ff, #dbe7ff);
}

.table-modern thead th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #4b5c78;
  vertical-align: middle;
}

.table-modern tbody td {
  vertical-align: middle;
}

.table-modern tbody tr:hover {
  background: #f7fbff;
}

.toolbar-card {
  background: linear-gradient(135deg, #f8fbff, #eef5ff);
  border: 1px solid #e1ebfb;
}

.main-action-row {
  background: linear-gradient(90deg, #f6f9ff, #eef4ff);
  font-weight: 700;
}

.sub-action-row {
  background: #fbfdff;
}

.sub-action-row td {
  border-top: 0;
}

.project-name-btn {
  font-weight: 800;
  color: #1f4b99;
}

.summary-metric {
  font-size: 12px;
  color: var(--app-muted);
  font-weight: 600;
}

.dashboard-sort-toolbar {
  background: #f6f9ff;
  border: 1px solid #e4ecfa;
  border-radius: 16px;
  padding: 12px;
}

.dashboard-hero {
  background: linear-gradient(135deg, rgba(16,43,95,.98), rgba(27,68,141,.96) 48%, rgba(47,111,237,.92) 100%);
  color: #fff;
  overflow: hidden;
}

.dashboard-hero::before {
  content: "";
  position: absolute;
  inset: auto -80px -80px auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.18), rgba(255,255,255,0));
}

.dashboard-hero,
.dashboard-hero > * {
  position: relative;
}

.dashboard-hero-grid {
  display: grid;
  grid-template-columns: 1.4fr .9fr;
  gap: 18px;
  align-items: center;
}

.dashboard-hero h4 {
  margin: 0 0 8px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.dashboard-hero p {
  margin: 0;
  color: rgba(255,255,255,.82);
}

.dashboard-legend {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.dashboard-table-wrap {
  overflow: auto;
  border-radius: 18px;
}

.dashboard-table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.metric-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid transparent;
  white-space: nowrap;
}

.metric-pill-total { background: var(--men-blue-100); color: var(--status-primary); border-color: #d8e6ff; }
.metric-pill-success { background: #ecfdf3; color: var(--status-success); border-color: #ccebd7; }
.metric-pill-warning { background: #fff7df; color: var(--status-warning); border-color: #ffebb2; }
.metric-pill-danger { background: #fff0f1; color: var(--status-danger); border-color: #ffd5d8; }
.metric-pill-secondary { background: #f3f5f7; color: var(--status-neutral); border-color: #e0e6eb; }
.metric-pill-info { background: #ebfbff; color: var(--status-info); border-color: #caeff8; }
.metric-pill-primary { background: var(--men-blue-100); color: var(--status-primary); border-color: #d8e6ff; }

.project-cell {
  display: grid;
  gap: 6px;
}

.project-chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.table-indicator-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #62748c;
  font-weight: 700;
}

.table-indicator-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2f6fed;
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.panel-title-row .small-note {
  margin: 0;
}

.critical-list-modern {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.critical-list-modern li {
  margin: 0 !important;
  padding: 12px 14px !important;
  border-radius: 16px;
  background: linear-gradient(180deg, #fff8f8, #fff1f1);
  border: 1px solid #ffd9dc;
}

.critical-list-modern li.text-success {
  background: linear-gradient(180deg, #f1fff6, #ebfbf1);
  border-color: #caebd5;
}

.meeting-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 6px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #1b448d, #2f6fed);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.subaction-summary {
  min-width: 280px;
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, #f8fbff, #eef5ff);
  border: 1px solid #dbe7fb;
}

.subaction-summary-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.subaction-summary-title {
  font-size: 12px;
  font-weight: 800;
  color: #1f4b99;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.subaction-summary-total {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #d6e4fb;
  font-size: 12px;
  font-weight: 700;
  color: #395277;
}

.subaction-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.subaction-kpi {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.82);
  border: 1px solid #dfebfc;
}

.subaction-kpi-label {
  font-size: 11px;
  color: #6b7a90;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 700;
}

.subaction-kpi-value {
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.subaction-kpi-value.success { color: #198754; }
.subaction-kpi-value.warning { color: #d39b00; }
.subaction-kpi-value.secondary { color: #6c757d; }
.subaction-kpi-value.danger { color: #dc3545; }

.subaction-progress-wrap {
  display: grid;
  gap: 6px;
}

.subaction-progress-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #4f6078;
}

.subaction-progress {
  height: 12px;
  border-radius: 999px;
  background: #dfe9f8;
  overflow: hidden;
}

.subaction-progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #22b573, #1c8f5c);
}

.subaction-mini-list {
  display: grid;
  gap: 8px;
}

.subaction-mini-item {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.92);
  border: 1px solid #e1ebfb;
}

.subaction-mini-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.subaction-parent {
  font-size: 11px;
  font-weight: 800;
  color: #1f4b99;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.subaction-label {
  font-weight: 600;
}

.subaction-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sub-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #d9e6fb;
  font-size: 12px;
  color: #52627d;
}

.subaction-more {
  font-size: 12px;
  color: #50627c;
  font-weight: 700;
}

#listeCritiques li {
  margin-bottom: 10px;
  padding-left: 4px;
}

.progress {
  height: 24px;
  border-radius: 999px;
  background: #e9eef8;
}

.progress-bar {
  font-weight: 800;
}

.badge-statut {
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 20px;
}

.kpi-blue { background: linear-gradient(135deg, #eef5ff, #dce9ff); }
.kpi-green { background: linear-gradient(135deg, #ebfbf2, #d7f5e3); }
.kpi-yellow { background: linear-gradient(135deg, #fff9e8, #ffefbf); }
.kpi-red { background: linear-gradient(135deg, #ffefef, #ffd7d7); }
.kpi-purple { background: linear-gradient(135deg, #f7f0ff, #e7d8ff); }
.kpi-cyan { background: linear-gradient(135deg, #ecfcff, #cff6ff); }

.small-note {
  font-size: 13px;
  color: #6c757d;
}

textarea { resize: vertical; }

.detail-box {
  background: #ffffff;
  border: 1px solid #dee6f2;
  border-radius: 16px;
  padding: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6);
}

#detailCompteRendu,
#detailActionsTexte {
  min-height: 100px;
  line-height: 1.5;
  white-space: pre-wrap;
}

@media (max-width: 991px) {
  .dashboard-sort-toolbar {
    width: 100%;
  }

  .header-content {
    align-items: flex-start;
  }

  .header-search-bar {
    max-width: 100%;
    margin-top: 4px;
  }

  .nav-pills-modern {
    display: flex;
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .nav-pills-modern .btn {
    min-width: 120px;
    flex-shrink: 0;
  }

  .header-user-panel {
    width: 100%;
    margin-top: 8px;
  }

  .dashboard-hero-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-legend {
    justify-content: flex-start;
  }

  .header-brand {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-logo {
    width: 210px;
  }

  .header-badge {
    width: 100%;
  }

  .header-badge-stats {
    grid-template-columns: 1fr;
  }
}

/* =============================================================================
   Recherche rapide globale
   ============================================================================= */

/* Recherche rapide — dropdown & résultats (barre dans header.css) */

.quick-search-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1040;
  background: rgba(8, 26, 59, 0.35);
}

.quick-search__dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 20px;
  right: 20px;
  max-height: min(70vh, 520px);
  overflow: auto;
  padding: 10px;
  border-radius: var(--radius-md);
  background: var(--app-card);
  border: 1px solid var(--app-border);
  box-shadow: var(--app-shadow);
  z-index: 1050;
}

.quick-search__section + .quick-search__section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--app-border);
}

.quick-search__section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--app-muted);
}

.quick-search__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.quick-search__item {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.quick-search__item:hover,
.quick-search__item:focus-visible {
  background: var(--men-blue-50);
  outline: none;
}

.quick-search__item-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--app-text);
}

.quick-search__item-meta {
  font-size: 12px;
  color: var(--app-muted);
}

.quick-search__hint,
.quick-search__empty {
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 20px;
  text-align: center;
  color: var(--app-muted);
}

.quick-search__shortcut {
  font-size: 12px;
}

@media (min-width: 768px) {
  .quick-search__kbd {
    display: inline-flex;
  }
}

@media (max-width: 767px) {
  .quick-search--open .quick-search__dropdown {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 75vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
}
