  :root {
      --dark-bg: #121212;
      --darker-bg: #0a0a0a;
      --card-bg: #1e1e1e;
      --text-primary: #e0e0e0;
      --text-secondary: #a0a0a0;
      --accent: #4a6fa5;
      --positive: #4caf50;
      --negative: #f44336;
      --neutral: #9e9e9e;
  }

  * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
      font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  }

  body {
      background-color: var(--dark-bg);
      color: var(--text-primary);
      height: 100vh;
      overflow: hidden;
  }

  .container {
      max-width: 100%;
      height: 100vh;
      display: flex;
      flex-direction: column;
      padding: 0;
      position: relative;
  }

  /* Navigation */
  .nav-tabs {
      display: flex;
      background-color: var(--darker-bg);
      border-bottom: 1px solid #333;
      position: sticky;
      top: 0;
      z-index: 10;
  }

  .nav-tab {
      flex: 1;
      padding: 12px 0;
      text-align: center;
      font-size: 14px;
      color: var(--text-secondary);
      border-bottom: 2px solid transparent;
      transition: all 0.3s;
  }

  .nav-tab.active {
      color: var(--text-primary);
      border-bottom: 2px solid var(--accent);
  }

  .nav-tab i {
      display: block;
      font-size: 20px;
      margin-bottom: 4px;
  }

  /* Pages */
  .page {
      display: none;
      flex: 1;
      overflow-y: auto;
      padding: 16px;
      padding-bottom: 70px;
  }

  .page.active {
      display: block;
  }

  /* Header */
  .header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 16px;
      background-color: var(--darker-bg);
      position: sticky;
      top: 0;
      z-index: 20;
  }

  .header h1 {
      font-size: 20px;
      font-weight: 600;
  }

  .header-actions {
      display: flex;
      gap: 10px;
  }

  /* Boutons */
  .btn {
      background-color: var(--accent);
      color: white;
      border: none;
      padding: 8px 16px;
      border-radius: 20px;
      font-size: 14px;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
  }

  .btn i {
      margin-right: 6px;
  }

  .btn-circle {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      padding: 0;
      justify-content: center;
  }

  .btn-danger {
      background-color: var(--negative);
  }

  .btn-success {
      background-color: var(--positive);
  }

  .btn-neutral {
      background-color: var(--neutral);
  }

  /* Liste des contacts */
  .contact-list {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
      gap: 12px;
      margin-top: 16px;
  }

  .contact-card {
      background-color: var(--card-bg);
      border-radius: 12px;
      padding: 16px;
      display: flex;
      align-items: center;
      transition: transform 0.2s;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  }

  .contact-card:active {
      transform: scale(0.98);
  }

  .contact-avatar {
      width: 50px;
      height: 50px;
      border-radius: 50%;
      background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 20px;
      font-weight: bold;
      color: white;
      margin-right: 16px;
  }

  .contact-info {
      flex: 1;
  }

  .contact-name {
      font-size: 16px;
      font-weight: 500;
      margin-bottom: 4px;
  }

  .contact-score {
      font-size: 14px;
      display: flex;
      align-items: center;
  }

  .score-value {
      font-weight: bold;
      margin-right: 8px;
  }

  .score-positive {
      color: var(--positive);
  }

  .score-negative {
      color: var(--negative);
  }

  .score-neutral {
      color: var(--neutral);
  }

  /* Page détail contact */
  .contact-detail {
      text-align: center;
      padding: 20px 0;
  }

  .detail-avatar {
      width: 100px;
      height: 100px;
      border-radius: 50%;
      background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
      margin: 0 auto 20px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 40px;
      font-weight: bold;
      color: white;
  }

  .detail-name {
      font-size: 24px;
      font-weight: 600;
      margin-bottom: 8px;
  }

  /* Jauge demi-circulaire */
  .score-dial {
      position: relative;
      width: 300px;
      height: 160px;
      margin: 0 auto;

  }

  .dial-outline {
      position: absolute;
      top: 0;
      left: 0;
      width: 300px;
      height: 300px;
      border-radius: 50%;
      background:
          conic-gradient(from 0deg,
              var(--negative) 110deg,
              var(--neutral) 190deg,
              var(--positive) 230deg);
      mask: radial-gradient(transparent 134.5px, black 135px);
      -webkit-mask: radial-gradient(transparent 134.5px, black 135px);
      transform: rotate(180deg);
      clip-path: inset(50% 0 0 0);
      -webkit-clip-path: inset(50% 0 0 0);
  }

  .dial-marker {
      position: absolute;
      bottom: 0;
      left: 50%;
      width: 20px;
      height: 20px;
      background-color: white;
      border-radius: 50%;
      transform: translateX(-50%);
      z-index: 10;
      box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  }

  .dial-min {
      position: absolute;
      bottom: 20px;
      left: 30px;
      font-size: 14px;
      text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  }

  .dial-max {
      position: absolute;
      bottom: 20px;
      right: 30px;
      font-size: 14px;
      text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  }

  .dial-center {
      position: absolute;
      bottom: 0;
      left: 50%;
      transform: translateX(-50%);
      width: 150px;
      height: 75px;
      display: flex;
      flex-direction: column;
      justify-content: flex-end;
      align-items: center;
      z-index: 5;
      padding-bottom: 40px;
  }

  .dial-container {
      position: relative;
      width: 300px;
      height: 160px;
  }

  .dial-container::before {
      content: '';
      position: absolute;
      top: 142.5px;
      left: 0;
      width: 15px;
      height: 15px;
      background-color: var(--negative);
      border-radius: 50%;
  }

  .dial-container::after {
      content: '';
      position: absolute;
      top: 142.5px;
      right: 0;
      width: 15px;
      height: 15px;
      background-color: var(--positive);
      border-radius: 50%;
  }

  .detail-score {
      font-size: 48px;
      font-weight: 700;
      transition: all 0.3s;
      line-height: 1;
      text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  }

  .social-credit-label {
      font-size: 14px;
      margin-top: 5px;
      color: rgba(255, 255, 255, 0.7);
      font-weight: 500;
      text-transform: uppercase;
      letter-spacing: 1px;
      text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  }

  .score-change {
      position: absolute;
      top: 0;
      right: 20px;
      font-size: 24px;
      font-weight: bold;
      opacity: 0;
      transition: all 0.5s;
  }

  .score-change.positive {
      color: var(--positive);
      opacity: 1;
  }

  .score-change.negative {
      color: var(--negative);
      opacity: 1;
  }

  /* Actions sur le score */
  .score-actions {
      display: flex;
      justify-content: center;
      gap: 20px;
      margin: 30px 0;
  }

  .score-btn {
      width: 80px;
      height: 80px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 24px;
      color: white;
      cursor: pointer;
      transition: transform 0.2s;
      border: none;
  }

  .score-btn:active {
      transform: scale(0.95);
  }

  .increase-btn {
      background: linear-gradient(135deg, var(--positive), #2e7d32);
      box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
  }

  .decrease-btn {
      background: linear-gradient(135deg, var(--negative), #c62828);
      box-shadow: 0 4px 15px rgba(244, 67, 54, 0.3);
  }

  /* Bonus/Malus */
  .bonus-section {
      margin-top: 40px;
      padding: 0 20px;
  }

  .bonus-list {
      margin-top: -20px;
  }

  .bonus-subsection+.bonus-subsection {
      margin-top: 18px;
  }

  .bonus-subtitle-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-top: 16px;
  }

  .bonus-subtitle-row h4 {
      margin: 0;
      font-size: 14px;
      color: var(--text-secondary);
      text-transform: uppercase;
      letter-spacing: 0.04em;
  }

  .bonus-item {
      background-color: transparent;
      padding: 8px 8px;
      margin-bottom: 0;
      display: flex;
      align-items: center;
  }

  .bonus-item:last-child {
      border-bottom: none;
  }

  .bonus-item.clickable {
      cursor: pointer;
  }

  .bonus-item.future {
      opacity: 0.7;
  }

  .bonus-icon {
      font-size: 16px;
      margin-right: 12px;
      width: 32px;
      height: 32px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
  }

  .bonus-icon.bonus {
      background-color: rgba(76, 175, 80, 0.2);
      color: var(--positive);
  }

  .bonus-icon.malus {
      background-color: rgba(244, 67, 54, 0.2);
      color: var(--negative);
  }

  .bonus-content {
      flex: 1;
  }

  .bonus-title {
      font-size: 15px;
      font-weight: 500;
      margin-bottom: 2px;
      color: #fff;
  }

  .bonus-threshold {
      font-size: 12px;
      color: rgba(255, 255, 255, 0.5);
  }

  .bonus-description {
      font-size: 13px;
      margin-top: 4px;
      color: rgba(255, 255, 255, 0.7);
  }

  .bonus-meta {
      margin-top: 8px;
      font-size: 12px;
      color: var(--text-secondary);
  }

  .bonus-mode-badge {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      margin-left: 8px;
      padding: 4px 8px;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.08);
      color: var(--text-secondary);
      font-size: 11px;
      text-transform: uppercase;
  }

  .bonus-warning-badge {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 20px;
      height: 20px;
      margin-left: 8px;
      border-radius: 999px;
      border: none;
      background: rgba(255, 193, 7, 0.18);
      color: #ffca28;
      font-size: 12px;
      font-weight: 700;
      cursor: pointer;
      vertical-align: middle;
  }

  .bonus-empty {
      color: var(--text-secondary);
      font-size: 14px;
      margin-top: 12px;
  }

  .bonus-more-btn {
      margin-top: 6px;
  }

  /* Actions prédéfinies */
  .actions-container {
      display: flex;
      overflow-x: auto;
      padding: 10px 0;
      gap: 12px;
      margin-top: 16px;
      -webkit-overflow-scrolling: touch;
  }

  .action-card {
      background-color: var(--card-bg);
      border-radius: 12px;
      padding: 16px;
      text-align: center;
      cursor: pointer;
      transition: transform 0.2s;
      position: relative;
  }

  .action-card.clickable {
      cursor: pointer;
  }

  .action-card:active {
      transform: scale(0.98);
  }

  .action-icon {
      font-size: 24px;
      margin-bottom: 8px;
  }

  .action-icon.positive {
      color: var(--positive);
  }

  .action-icon.negative {
      color: var(--negative);
  }

  .action-title {
      font-size: 14px;
      margin-bottom: 4px;
      white-space: normal;
  }

  .action-points {
      font-size: 12px;
      font-weight: bold;
  }

  .action-points.positive {
      color: var(--positive);
  }

  .delete-action {
      position: absolute;
      top: 8px;
      right: 8px;
      background-color: var(--negative);
      color: white;
      width: 24px;
      height: 24px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 12px;
      cursor: pointer;
  }

  .action-points.negative {
      color: var(--negative);
  }

  /* Panneau d'actions */
  .actions-panel {
      position: fixed;
      bottom: 0;
      left: 0;
      width: 100%;
      background-color: var(--darker-bg);
      border-top: 1px solid #333;
      padding: 16px;
      transform: translateY(100%);
      transition: transform 0.3s ease;
      z-index: 100;
  }

  .actions-panel.active {
      transform: translateY(0);
  }

  .actions-panel-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 16px;
  }

  .actions-panel-title {
      font-size: 18px;
      font-weight: 500;
  }

  .actions-panel-close {
      background: none;
      border: none;
      color: var(--text-secondary);
      font-size: 24px;
      cursor: pointer;
  }

  .history-icon.neutral {
      background-color: #9e9e9e;
      color: white;
  }

  .manual-change {
      margin-top: 16px;
  }

  .manual-change-btn {
      width: 100%;
      padding: 12px;
      background-color: var(--card-bg);
      border: none;
      border-radius: 8px;
      color: var(--text-primary);
      font-size: 16px;
      cursor: pointer;
      text-align: center;
  }

  /* Modals */
  .modal {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-color: rgba(0, 0, 0, 0.7);
      z-index: 100;
      align-items: center;
      justify-content: center;
  }

  .modal.active {
      display: flex;
  }

  .modal-content {
      background-color: var(--darker-bg);
      border-radius: 16px;
      width: 90%;
      max-width: 400px;
      max-height: 90vh;
      overflow-y: auto;
      padding: 24px;
      position: relative;
  }

  .modal-close {
      position: absolute;
      top: 16px;
      right: 16px;
      background: none;
      border: none;
      color: var(--text-secondary);
      font-size: 24px;
      cursor: pointer;
  }

  .modal-title {
      font-size: 20px;
      margin-bottom: 20px;
      text-align: center;
  }

  .form-group {
      margin-bottom: 16px;
  }

  .form-group label {
      display: block;
      margin-bottom: 8px;
      font-size: 14px;
      color: var(--text-secondary);
  }

  .form-control {
      width: 100%;
      padding: 12px;
      background-color: #333;
      border: 1px solid #444;
      border-radius: 8px;
      color: var(--text-primary);
      font-size: 16px;
  }

  .modal-footer {
      display: flex;
      gap: 10px;
      margin-top: 20px;
  }

  .btn-secondary {
      background-color: #333;
      color: var(--text-primary);
  }

  /* Historique */
  .history-section {
      margin-top: 40px;
      padding: 0 20px;
  }

  .history-list {
      max-height: 250px;
      overflow-y: auto;
      margin-top: 16px;
  }

  .history-item {
      background-color: transparent;
      border-bottom: 1px solid rgba(255, 255, 255, 0.1);
      padding: 12px 8px;
      margin-bottom: 0;
      display: flex;
      align-items: center;
  }

  .history-item:last-child {
      border-bottom: none;
  }

  .history-icon {
      width: 32px;
      height: 32px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      margin-right: 12px;
      font-size: 14px;
      flex-shrink: 0;
  }

  .history-icon.positive {
      background-color: rgba(76, 175, 80, 0.2);
      color: var(--positive);
  }

  .history-icon.negative {
      background-color: rgba(244, 67, 54, 0.2);
      color: var(--negative);
  }

  .history-content {
      flex: 1;
  }

  .history-reason {
      font-size: 14px;
      margin-bottom: 2px;
      color: #fff;
      font-weight: 500;
  }

  .history-details {
      display: flex;
      justify-content: space-between;
      font-size: 12px;
      color: rgba(255, 255, 255, 0.6);
  }

  /* Empty state */
  .empty-state {
      text-align: center;
      padding: 40px 20px;
      color: var(--text-secondary);
  }

  .empty-state i {
      font-size: 48px;
      margin-bottom: 16px;
      opacity: 0.5;
  }

  /* Tri */
  .sort-options {
      position: absolute;
      top: 60px;
      right: 16px;
      background-color: var(--darker-bg);
      border-radius: 8px;
      padding: 8px 0;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
      z-index: 10;
      display: none;
  }

  .sort-options.active {
      display: block;
  }

  .sort-option {
      padding: 10px 16px;
      cursor: pointer;
      display: flex;
      align-items: center;
  }

  .sort-option:hover {
      background-color: var(--card-bg);
  }

  .sort-option i {
      margin-right: 8px;
      width: 20px;
      text-align: center;
  }

  .actions-tainer {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 12px;
      margin-top: 16px;
  }

  .actions-container .action-card {
      flex: 0 0 auto;
      width: 140px;
      /* Largeur fixe seulement dans la barre */
  }


  /* Menu choix de couleur */
  .gradient-menu {
      position: fixed;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      background: #1e1e1e;
      padding: 15px;
      border-radius: 12px;
      display: none;
      flex-wrap: wrap;
      gap: 10px;
      z-index: 2000;
  }

  .gradient-menu.show {
      display: flex;
  }

  .gradient-option {
      width: 50px;
      height: 50px;
      border-radius: 50%;
      cursor: pointer;
      border: 2px solid white;
  }

  /* Admin-specific bonus list rules (fixes bug where admin page rules look like user rules) */
  #bonus-list {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
      gap: 12px;
      margin-top: 16px;
  }

  #bonus-list .bonus-item {
      background-color: var(--card-bg) !important;
      border: 1px solid var(--border-color) !important;
      border-radius: 12px !important;
      padding: 16px !important;
      margin-bottom: 0 !important;
      display: flex !important;
      align-items: center !important;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
      cursor: pointer;
  }

  #bonus-list .bonus-item:last-child {
      border-bottom: 1px solid var(--border-color) !important;
  }

  #bonus-list .bonus-content {
      flex: 1;
  }

  #bonus-list .bonus-title {
      font-size: 16px;
      font-weight: 500;
      color: #fff;
      margin-bottom: 4px;
  }

  #bonus-list .bonus-threshold {
      font-size: 13px;
      color: #aaa;
      margin-bottom: 4px;
  }

  #bonus-list .bonus-description {
      font-size: 14px;
      color: #ccc;
      margin-bottom: 4px;
  }

  #bonus-list .bonus-meta {
      font-size: 12px;
      color: #888;
  }

  #bonus-list .delete-bonus {
      background-color: rgba(244, 67, 54, 0.2) !important;
      color: var(--negative) !important;
      border: 1px solid rgba(244, 67, 54, 0.3) !important;
      padding: 8px 12px !important;
      border-radius: 8px !important;
      transition: background-color 0.2s, transform 0.2s !important;
      cursor: pointer;
  }

  #bonus-list .delete-bonus:hover {
      background-color: rgba(244, 67, 54, 0.4) !important;
      transform: scale(1.05) !important;
  }