/* Dinia.ai — Design System Harmonisé pour Ariane */
:root {
  --color-dinia-ikb: #002FA7;
  --color-dinia-sky: #60A5FA;
  --color-dinia-slate: #1D283A;
  --bg-light: #F8FAFC;
  --bg-dark: #030712;
  --surface-light: #FFFFFF;
  --surface-dark: #0F172A;
  --surface-dark-subtle: #1E293B;
  --border-light: #E2E8F0;
  --border-dark: #1E293B;
  --text-main-light: #0F172A;
  --text-muted-light: #64748B;
  --text-main-dark: #F8FAFC;
  --text-muted-dark: #94A3B8;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --shadow-subtle: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 12px 30px -4px rgba(0, 0, 0, 0.12);
  --shadow-jira: 0 10px 30px -5px rgba(0, 47, 167, 0.15);
}

/* Règle d'or anti-bande blanche */
html {
  min-height: 100%;
  background-color: var(--bg-light);
}

html.dark {
  background-color: var(--bg-dark) !important;
  color-scheme: dark;
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-light);
  color: var(--text-main-light);
  transition: background-color 0.2s ease, color 0.2s ease;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

html.dark body {
  background-color: var(--bg-dark) !important;
  color: var(--text-main-dark);
}

/* Typographie */
.font-display {
  font-family: 'Montserrat', system-ui, sans-serif;
  letter-spacing: -0.02em;
}

.font-mono {
  font-family: 'JetBrains Mono', monospace;
}

/* Header & Navigation */
.header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background-color: rgba(248, 250, 252, 0.85);
  border-bottom: 1px solid var(--border-light);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

html.dark .header {
  background-color: rgba(3, 7, 18, 0.85);
  border-bottom-color: var(--border-dark);
}

.header-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.brand-chevron-box {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: rgba(234, 88, 12, 0.12);
  border: 1px solid rgba(234, 88, 12, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.brand-logo-link:hover .brand-chevron-box {
  transform: scale(1.05);
}

.brand-title-wrap {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.brand-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  background-color: rgba(234, 88, 12, 0.15);
  color: #EA580C;
  border: 1px solid rgba(234, 88, 12, 0.3);
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted-light);
}

html.dark .brand-subtitle {
  color: var(--text-muted-dark);
}

/* --- SECTION DROITE DU HEADER (Harmonisé Iris / Dinia) --- */
.header-right-section {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

/* Badge Sécurité Souveraine */
.security-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #10B981;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
  user-select: none;
}

html.dark .security-badge {
  color: #86EFAC;
}

.security-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #10B981;
  box-shadow: 0 0 8px #10B981;
}

/* Badge Tenant / Organisation */
.tenant-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--surface-light);
  border: 1px solid var(--border-light);
  color: var(--text-muted-light);
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

html.dark .tenant-badge {
  background: var(--surface-dark);
  border-color: var(--border-dark);
  color: var(--text-muted-dark);
}

/* Badge Compteur Tokens / MCP */
.tokens-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--surface-light);
  border: 1px solid var(--border-light);
  color: var(--text-main-light);
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

html.dark .tokens-badge {
  background: var(--surface-dark);
  border-color: var(--border-dark);
  color: var(--text-main-dark);
}

/* Bouton Bascule Dark / Light */
.btn-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: var(--surface-light);
  color: var(--text-muted-light);
  cursor: pointer;
  transition: all 0.15s ease;
}

html.dark .btn-theme-toggle {
  border-color: var(--border-dark);
  background: var(--surface-dark);
  color: var(--text-muted-dark);
}

.btn-theme-toggle:hover {
  color: var(--text-main-light);
  background: rgba(0, 0, 0, 0.04);
  border-color: #94A3B8;
}

html.dark .btn-theme-toggle:hover {
  color: var(--text-main-dark);
  background: rgba(255, 255, 255, 0.06);
  border-color: #64748B;
}

/* ==========================================================================
   Menu Gaufre / App Switcher 9 Points (Identique Iris / Section 4.1 Directives)
   ========================================================================== */
.app-switcher-container {
  position: relative;
}

.btn-app-switcher {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: var(--surface-light);
  color: var(--text-muted-light);
  cursor: pointer;
  transition: all 0.15s ease;
}

html.dark .btn-app-switcher {
  border-color: var(--border-dark);
  background: var(--surface-dark);
  color: var(--text-muted-dark);
}

.btn-app-switcher:hover,
.btn-app-switcher.active {
  color: var(--text-main-light);
  background: rgba(0, 0, 0, 0.04);
  border-color: #002FA7;
}

html.dark .btn-app-switcher:hover,
html.dark .btn-app-switcher.active {
  color: var(--text-main-dark);
  background: rgba(255, 255, 255, 0.06);
  border-color: #60A5FA;
}

/* Panneau Déroulant Gaufre */
.app-switcher-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 380px;
  max-width: calc(100vw - 24px);
  box-sizing: border-box;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  box-shadow: 0 10px 30px -5px rgba(0, 47, 167, 0.15), 0 20px 40px -10px rgba(0, 0, 0, 0.1);
  padding: 12px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: appSwitcherFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

html.dark .app-switcher-dropdown {
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6);
}

.app-switcher-dropdown.hidden {
  display: none !important;
}

@keyframes appSwitcherFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.app-switcher-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 4px 6px 8px 6px;
  border-bottom: 1px solid var(--border-light);
}

html.dark .app-switcher-header {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.app-switcher-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-main-light);
  letter-spacing: -0.01em;
}

html.dark .app-switcher-title {
  color: var(--text-main-dark);
}

.app-switcher-subtitle {
  font-size: 0.68rem;
  color: var(--text-muted-light);
  font-weight: 500;
}

html.dark .app-switcher-subtitle {
  color: var(--text-muted-dark);
}

.app-switcher-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding-top: 4px;
}

.app-switcher-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  text-decoration: none;
  transition: all 0.15s ease;
  background: transparent;
  min-width: 0;
  box-sizing: border-box;
  outline: none;
}

.app-switcher-item:hover,
.app-switcher-item:focus-visible {
  background: rgba(0, 47, 167, 0.04);
  border-color: var(--border-light);
  transform: translateY(-1px);
}

html.dark .app-switcher-item:hover,
html.dark .app-switcher-item:focus-visible {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.app-switcher-item.active {
  background: rgba(234, 88, 12, 0.08);
  border-color: #EA580C;
}

html.dark .app-switcher-item.active {
  background: rgba(234, 88, 12, 0.12);
  border-color: #EA580C;
}

.app-switcher-icon-box {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.app-switcher-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.app-switcher-item-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  flex: 1;
}

.app-switcher-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.app-switcher-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html.dark .app-switcher-name {
  color: var(--text-main-dark);
}

.app-switcher-active-tag {
  font-size: 0.6rem;
  font-weight: 700;
  color: #FFFFFF;
  background: #EA580C;
  padding: 1px 5px;
  border-radius: 4px;
  text-transform: uppercase;
  line-height: 1;
  flex-shrink: 0;
}

.app-switcher-desc {
  font-size: 0.68rem;
  color: var(--text-muted-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html.dark .app-switcher-desc {
  color: var(--text-muted-dark);
}

.app-switcher-item-hub {
  grid-column: span 2;
  border-top: 1px solid var(--border-light);
  margin-top: 4px;
  padding-top: 10px;
}

html.dark .app-switcher-item-hub {
  border-top-color: rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   Dinia Account Menu (Google Account Style / Identique Iris)
   ========================================================================== */
.account-menu-container {
  position: relative;
  display: inline-block;
}

.btn-auth-header {
  background: var(--surface-light);
  border: 1px solid var(--border-light);
  color: var(--text-main-light);
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

html.dark .btn-auth-header {
  background: var(--surface-dark);
  border-color: var(--border-dark);
  color: var(--text-main-dark);
}

.btn-auth-header:hover {
  background: rgba(0, 47, 167, 0.08);
  border-color: #002FA7;
  color: #002FA7;
}

html.dark .btn-auth-header:hover {
  background: rgba(96, 165, 250, 0.1);
  border-color: #60A5FA;
  color: #60A5FA;
}

.btn-auth-header.hidden,
.account-avatar-btn.hidden {
  display: none !important;
}

.account-avatar-btn {
  background: none;
  border: 2px solid transparent;
  border-radius: 50%;
  padding: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.account-avatar-btn:hover,
.account-avatar-btn:focus-visible {
  border-color: #EA580C;
  transform: scale(1.05);
}

.account-avatar-btn .avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  padding: 5px;
}

.avatar-picto-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Account Dropdown */
.account-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  background-color: var(--surface-light);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px -8px rgba(0, 0, 0, 0.25);
  padding: 1.25rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transform-origin: top right;
  animation: accountMenuIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

html.dark .account-dropdown {
  background-color: var(--surface-dark);
  border-color: var(--border-dark);
}

.account-dropdown.hidden {
  display: none !important;
}

@keyframes accountMenuIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-4px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.account-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.4rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

html.dark .account-header {
  border-bottom-color: var(--border-dark);
}

.account-large-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #EA580C 0%, #002FA7 100%);
  color: #ffffff;
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.35);
  margin-bottom: 0.25rem;
}

.account-user-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main-light);
  line-height: 1.2;
}

html.dark .account-user-name {
  color: var(--text-main-dark);
}

.account-user-email {
  font-size: 0.8rem;
  color: var(--text-muted-light);
  word-break: break-all;
}

html.dark .account-user-email {
  color: var(--text-muted-dark);
}

.account-org-badge {
  font-size: 0.72rem;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--border-light);
  color: var(--text-muted-light);
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-weight: 500;
  margin-top: 0.2rem;
}

html.dark .account-org-badge {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-dark);
  color: var(--text-muted-dark);
}

/* Statut Licence */
.account-license-box {
  background: rgba(234, 88, 12, 0.08);
  border: 1px solid rgba(234, 88, 12, 0.2);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.account-license-box.active {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.25);
}

.license-info-left {
  display: flex;
  flex-direction: column;
}

.license-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted-light);
  font-weight: 600;
}

html.dark .license-label {
  color: var(--text-muted-dark);
}

.license-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main-light);
}

html.dark .license-name {
  color: var(--text-main-dark);
}

.license-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.2);
  color: #10B981;
}

.license-status-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* Tokens Box */
.account-tokens-box {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

html.dark .account-tokens-box {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border-dark);
}

.tokens-info-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
}

.tokens-info-header .tokens-label {
  color: var(--text-muted-light);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

html.dark .tokens-info-header .tokens-label {
  color: var(--text-muted-dark);
}

.tokens-info-header .tokens-value {
  font-weight: 700;
  color: #EA580C;
}

.tokens-progress-bg {
  width: 100%;
  height: 5px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

html.dark .tokens-progress-bg {
  background: rgba(255, 255, 255, 0.08);
}

.tokens-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #EA580C 0%, #a855f7 60%, #002FA7 100%);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.tokens-axes-hint {
  font-size: 0.65rem;
  color: var(--text-muted-light);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  opacity: 0.85;
}

html.dark .tokens-axes-hint {
  color: var(--text-muted-dark);
}

/* Actions in Dropdown */
.account-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.btn-dinia-manage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  box-sizing: border-box;
  padding: 0.6rem 1rem;
  border-radius: 9999px;
  border: 1px solid var(--border-light);
  background: var(--surface-light);
  color: var(--text-main-light);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

html.dark .btn-dinia-manage {
  border-color: var(--border-dark);
  background: var(--surface-dark-subtle);
  color: var(--text-main-dark);
}

.btn-dinia-manage:hover {
  border-color: #002FA7;
  color: #002FA7;
  background: rgba(0, 47, 167, 0.06);
}

html.dark .btn-dinia-manage:hover {
  border-color: #60A5FA;
  color: #60A5FA;
  background: rgba(96, 165, 250, 0.1);
}

.btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  border: none;
  background: none;
  color: #EF4444;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
  font-family: inherit;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* Badge Statut MCP */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  background-color: rgba(16, 185, 129, 0.1);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #10B981;
  box-shadow: 0 0 8px #10B981;
  animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

/* Hero Section */
.hero {
  padding: 3rem 1.5rem 2rem;
  max-width: 1320px;
  margin: 0 auto;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #EA580C;
  background: rgba(234, 88, 12, 0.1);
  border: 1px solid rgba(234, 88, 12, 0.25);
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 900;
  line-height: 1.15;
  margin: 0 0 1rem;
  max-width: 900px;
}

.gradient-text {
  background: linear-gradient(135deg, #EA580C 0%, #FF8A00 50%, #002FA7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

html.dark .gradient-text {
  background: linear-gradient(135deg, #FB923C 0%, #F97316 50%, #60A5FA 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-description {
  font-size: 1.05rem;
  color: var(--text-muted-light);
  max-width: 780px;
  margin: 0 0 2rem;
  line-height: 1.6;
}

html.dark .hero-description {
  color: var(--text-muted-dark);
}

/* Filtres & Recherche */
.filter-section {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
}

.search-bar-wrap {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.search-input-box {
  flex: 1;
  min-width: 280px;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted-light);
  pointer-events: none;
}

html.dark .search-icon {
  color: var(--text-muted-dark);
}

.search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.85rem 1rem 0.85rem 2.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background-color: var(--surface-light);
  color: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s ease;
}

html.dark .search-input {
  border-color: var(--border-dark);
  background-color: var(--surface-dark);
}

.search-input:focus {
  border-color: #EA580C;
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.15);
}

/* Barre d'outils Dinia (Tool Filter Pills) */
.tools-filter-strip {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
  scrollbar-width: thin;
}

.tool-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background-color: var(--surface-light);
  color: var(--text-muted-light);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

html.dark .tool-chip {
  border-color: var(--border-dark);
  background-color: var(--surface-dark);
  color: var(--text-muted-dark);
}

.tool-chip:hover {
  border-color: currentColor;
  transform: translateY(-1px);
}

.tool-chip.active {
  background-color: var(--color-dinia-slate);
  color: #FFFFFF !important;
  border-color: transparent;
  box-shadow: var(--shadow-subtle);
}

html.dark .tool-chip.active {
  background-color: #FFFFFF;
  color: #030712 !important;
}

.tool-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* Secondary Tag Filter Pills */
.tags-filter-strip {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.tag-pill {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid var(--border-light);
  background-color: transparent;
  color: var(--text-muted-light);
  cursor: pointer;
  transition: all 0.15s ease;
}

html.dark .tag-pill {
  border-color: var(--border-dark);
  color: var(--text-muted-dark);
}

.tag-pill:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

html.dark .tag-pill:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.tag-pill.active {
  background-color: rgba(234, 88, 12, 0.15);
  color: #EA580C;
  border-color: rgba(234, 88, 12, 0.4);
  font-weight: 700;
}

/* Grille des Actualités */
.feed-section {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.feed-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.feed-count-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.feed-count {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main-light);
}

html.dark .feed-count {
  color: var(--text-main-dark);
}

.feed-endpoint-hint {
  color: var(--text-muted-light);
  font-size: 0.75rem;
}

html.dark .feed-endpoint-hint {
  color: var(--text-muted-dark);
}

/* Sélecteur de lecture (Grille / Liste) */
.view-mode-toggle {
  display: inline-flex;
  align-items: center;
  background-color: var(--surface-light);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 3px;
  box-shadow: var(--shadow-subtle);
}

html.dark .view-mode-toggle {
  background-color: var(--surface-dark);
  border-color: var(--border-dark);
}

.view-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: calc(var(--radius-md) - 3px);
  border: none;
  background: transparent;
  color: var(--text-muted-light);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

html.dark .view-mode-btn {
  color: var(--text-muted-dark);
}

.view-mode-btn:hover {
  color: var(--text-main-light);
}

html.dark .view-mode-btn:hover {
  color: var(--text-main-dark);
}

.view-mode-btn.active {
  background-color: #EA580C;
  color: #FFFFFF !important;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.3);
}

/* Grille des Actualités (Mode Grille par défaut) */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 1.5rem;
}

@media (max-width: 640px) {
  .news-grid {
    grid-template-columns: 1fr;
  }
}

/* Mode Liste (Sélecteur de lecture rapide) */
.news-grid.view-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.news-grid.view-list .news-card {
  padding: 1.15rem 1.4rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-subtle);
  display: flex;
  flex-direction: column;
}

@media (min-width: 860px) {
  .news-grid.view-list .news-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    column-gap: 1.5rem;
    row-gap: 0.5rem;
    align-items: start;
  }

  .news-grid.view-list .news-card-meta {
    grid-column: 1 / -1;
    margin-bottom: 0.35rem;
  }

  .news-grid.view-list .news-card-body {
    grid-column: 1;
  }

  .news-grid.view-list .news-title {
    font-size: 1.05rem;
    margin-bottom: 0.35rem;
  }

  .news-grid.view-list .news-summary {
    font-size: 0.84rem;
    margin-bottom: 0.4rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .news-grid.view-list .news-tags-wrap {
    margin-bottom: 0;
  }

  .news-grid.view-list .news-card-footer {
    grid-column: 2;
    grid-row: 2;
    border-top: none;
    padding-top: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 0.6rem;
  }
}

/* Carte d'actualité synthétique */
.news-card {
  background-color: var(--surface-light);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-subtle);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

html.dark .news-card {
  background-color: var(--surface-dark);
  border-color: var(--border-dark);
}

.news-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
  border-color: rgba(234, 88, 12, 0.4);
}

.news-card.featured-card {
  border-left: 4px solid #EA580C;
}

.news-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.news-tools-wrap {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.dinia-tool-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.dinia-tool-badge:hover {
  opacity: 0.85;
}

.news-time-read {
  font-size: 0.72rem;
  color: var(--text-muted-light);
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
}

html.dark .news-time-read {
  color: var(--text-muted-dark);
}

.news-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 0.85rem;
  cursor: pointer;
  transition: color 0.15s ease;
}

.news-title:hover {
  color: #EA580C;
}

.news-summary {
  font-size: 0.875rem;
  color: var(--text-muted-light);
  line-height: 1.6;
  margin: 0 0 1.25rem;
  flex: 1;
}

html.dark .news-summary {
  color: var(--text-muted-dark);
}

.news-tags-wrap {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.mini-tag {
  font-size: 0.68rem;
  font-family: 'JetBrains Mono', monospace;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background-color: rgba(0, 0, 0, 0.04);
  color: var(--text-muted-light);
  border: 1px solid var(--border-light);
}

html.dark .mini-tag {
  background-color: rgba(255, 255, 255, 0.04);
  color: var(--text-muted-dark);
  border-color: var(--border-dark);
}

.news-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.75rem;
}

html.dark .news-card-footer {
  border-top-color: var(--border-dark);
}

.news-source-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-muted-light);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

html.dark .news-source-link {
  color: var(--text-muted-dark);
}

.news-source-link:hover {
  color: var(--color-dinia-sky);
}

.read-details-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: none;
  color: #EA580C;
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.read-details-btn:hover {
  background: rgba(234, 88, 12, 0.1);
}

/* Modale de Détail */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background-color: rgba(3, 7, 18, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background-color: var(--surface-light);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  padding: 2rem;
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

html.dark .modal-content {
  background-color: var(--surface-dark);
  border-color: var(--border-dark);
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted-light);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  transition: color 0.15s;
}

html.dark .modal-close-btn {
  color: var(--text-muted-dark);
}

.modal-close-btn:hover {
  color: var(--text-main-light);
}

html.dark .modal-close-btn:hover {
  color: var(--text-main-dark);
}

.modal-impact-box {
  padding: 1rem;
  border-radius: var(--radius-md);
  background: rgba(0, 47, 167, 0.06);
  border: 1px solid rgba(0, 47, 167, 0.2);
  margin: 1.5rem 0;
}

html.dark .modal-impact-box {
  background: rgba(96, 165, 250, 0.08);
  border-color: rgba(96, 165, 250, 0.2);
}

.modal-code-snippet {
  background-color: #030712;
  color: #F8FAFC;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  overflow-x: auto;
  border: 1px solid #1E293B;
  margin: 1rem 0;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border-light);
  padding: 2.5rem 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted-light);
}

html.dark .footer {
  border-top-color: var(--border-dark);
  color: var(--text-muted-dark);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.footer-links a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s;
}

.footer-links a:hover {
  color: #EA580C;
}
