:root {
  --bg: #0f1117;
  --sidebar: #12151d;
  --surface: #171b24;
  --surface-2: #1d222d;
  --surface-3: #242a36;
  --border: #2c3340;
  --text: #f4f6fa;
  --muted: #9ca6b6;
  --primary: #6d7cff;
  --primary-strong: #8190ff;
  --green: #35c27f;
  --red: #ff6b6b;
  --yellow: #e5b95c;
  --blue-soft: #243452;
  --green-soft: #17392d;
  --red-soft: #402326;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}


* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

.hidden {
  display: none !important;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 26px 18px;
  background: var(--sidebar);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
}

.logo {
  padding: 0 10px 26px;
}

.logo h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.4px;
}

.logo span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 2px;
}

.navigation {
  display: grid;
  gap: 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  transition: 0.16s ease;
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface-2);
}

.nav-link.active {
  color: white;
  background: #22294a;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 18px;
  display: grid;
  gap: 10px;
}

/* Profil et thème en bas de la sidebar */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.4px;
}

.sidebar-user-info {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.sidebar-user-info strong {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-info span {
  color: var(--muted);
  font-size: 10px;
}


.main-content {
  min-width: 0;
}

.top-header {
  height: 70px;
  display: flex;
  align-items: center;
  padding: 0 30px;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 17, 23, 0.9);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.top-header h2 {
  margin: 0;
  font-size: 18px;
}

#page-content {
  padding: 28px 30px 50px;
}

.page {
  display: none;
}

.page.active-page {
  display: block;
}

.page-intro,
.panel-heading,
.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.page-intro {
  margin-bottom: 24px;
}

.page-intro h3,
.section-heading h3,
.panel-heading h3 {
  margin: 0 0 6px;
}

.page-intro p,
.section-heading p,
.panel-heading p {
  margin: 0;
  color: var(--muted);
}

.primary-button,
.secondary-button,
.danger-button {
  border: 0;
  border-radius: 9px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 650;
  transition: 0.15s ease;
}

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

.primary-button:hover {
  background: var(--primary-strong);
}

.secondary-button {
  background: var(--surface-3);
  color: var(--text);
  border: 1px solid var(--border);
}

.secondary-button:hover {
  border-color: #465062;
}

.danger-button {
  background: var(--red-soft);
  color: #ff9b9b;
  border: 1px solid #67373b;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.card,
.panel,
.stock-summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.card {
  min-width: 0;
  padding: 20px;
}

.card h3 {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.card p {
  margin: 0;
  font-size: 25px;
  font-weight: 750;
  letter-spacing: -0.5px;
}

.panel {
  padding: 20px;
}

.panel > h3 {
  margin: 0 0 18px;
  font-size: 15px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.summary-line,
.product-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.summary-line {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.summary-line:last-child {
  border-bottom: 0;
}

.summary-line span {
  color: var(--muted);
}

.activity-row,
.ranking-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.activity-row:last-child,
.ranking-row:last-child {
  border-bottom: 0;
}

.activity-row small,
.ranking-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.muted-text {
  color: var(--muted);
}

/* Articles */
.article-form-container {
  margin-bottom: 22px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.form-group {
  display: grid;
  gap: 7px;
}

.form-group label {
  font-size: 13px;
  font-weight: 650;
}

.form-group small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

input,
select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border-radius: 9px;
  border: 1px solid var(--border);
  outline: none;
  color: var(--text);
  background: var(--surface-2);
}

input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(109, 124, 255, 0.14);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.stock-summary {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 14px !important;
  width: 100% !important;
  margin-bottom: 18px;
}

.stock-summary-card {
  display: block;
  text-align: left;
  padding: 18px;
  cursor: pointer;
  transition: 0.16s ease;
}

.stock-summary-card:hover {
  transform: translateY(-2px);
  border-color: #485266;
}

.stock-summary-title {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.stock-summary-card strong {
  display: block;
  font-size: 25px;
  white-space: nowrap;
}

.stock-summary-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 180px 220px;
  gap: 10px;
  margin-bottom: 14px;
}

.stock-panel {
  padding: 0;
  overflow: hidden;
}

.stock-table-container,
.table-scroll {
  overflow-x: auto;
}

.stock-table,
.monthly-statistics-table {
  width: 100%;
  border-collapse: collapse;
}

.stock-table th,
.stock-table td,
.monthly-statistics-table th,
.monthly-statistics-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.stock-table th,
.monthly-statistics-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  background: rgba(255, 255, 255, 0.01);
}

.stock-table tbody tr {
  transition: background 0.12s ease;
}

.stock-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

.article-row {
  cursor: pointer;
}

.article-name-cell {
  min-width: 150px;
}

.actions-column,
.actions-cell {
  width: 52px;
  text-align: center !important;
}

.more-button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 20px;
}

.more-button:hover {
  background: var(--surface-3);
  color: var(--text);
}

.status {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
}

.stock-status {
  color: #84e2b3;
  background: var(--green-soft);
}

.sold-status {
  color: #a8c7ff;
  background: var(--blue-soft);
}

.article-status-wrapper {
  display: flex;
  align-items: center;
  gap: 7px;
}

.stock-age {
  color: var(--muted);
  font-size: 11px;
}

.stock-age.old {
  color: #f2c56a;
}

.profit-positive {
  color: var(--green) !important;
}

.profit-negative {
  color: var(--red) !important;
}

.no-results {
  text-align: center !important;
  color: var(--muted);
  padding: 30px !important;
}

.empty-state {
  padding: 48px 24px;
  text-align: center;
}

.empty-icon {
  font-size: 38px;
}

.empty-state h3 {
  margin-bottom: 7px;
}

.empty-state p {
  color: var(--muted);
}

/* Menu actions */
.article-menu {
  position: fixed;
  z-index: 1200;
  width: 210px;
  padding: 7px;
  background: #1b202a;
  border: 1px solid var(--border);
  border-radius: 11px;
  box-shadow: var(--shadow);
}

.article-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  padding: 10px 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.article-menu button:hover {
  background: var(--surface-3);
}

.article-menu .danger-action {
  color: #ff8b8b;
}

.menu-separator {
  height: 1px;
  margin: 5px 4px;
  background: var(--border);
}

/* Modales */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(5px);
  overflow: auto;
}

.modal-content {
  position: relative;
  width: min(920px, 100%);
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #f7f8fb;
  color: #18202c;
  box-shadow: var(--shadow);
}

.sale-modal-content {
  width: min(480px, 100%);
  background: var(--surface);
  color: var(--text);
}

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

.modal-header h3,
.modal-header p {
  margin: 0;
}

.modal-header p {
  margin-top: 5px;
  color: var(--muted);
}

.modal-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 24px;
}

.modal-close:hover {
  background: rgba(127, 127, 127, 0.12);
}

.floating-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
}

/* Fiche article */
.product-sheet {
  width: 100%;
  padding: 5px;
}

.product-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 28px;
  padding: 10px 46px 24px 0;
  border-bottom: 1px solid #dfe3ea;
}

.product-sheet-id {
  margin-bottom: 6px;
  color: #7c8796;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.9px;
}

.product-sheet-title {
  margin: 0;
  color: #151b25;
  font-size: 30px;
  line-height: 1.1;
}

.product-sheet-brand {
  margin-top: 7px;
  color: #6f7988;
}

.product-sheet-status {
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.product-status-stock {
  color: #16774a;
  background: #dff3e9;
}

.product-status-sold {
  color: #345f9d;
  background: #e1eafb;
}

.product-money-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0 28px;
}

.product-money-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid #dfe3ea;
  border-radius: 13px;
  background: white;
}

.product-money-label {
  display: block;
  margin-bottom: 10px;
  color: #788393;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.7px;
}

.product-money-value {
  display: block;
  color: #17202b;
  font-size: clamp(19px, 2.1vw, 25px);
  font-weight: 800;
  white-space: nowrap;
}

.product-money-card small {
  display: block;
  margin-top: 7px;
  color: #8791a0;
  font-size: 11px;
}

.product-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 35px;
  margin-bottom: 24px;
}

.product-info-section h3,
.product-sale-section h3 {
  margin: 0;
  padding-bottom: 9px;
  border-bottom: 1px solid #dfe3ea;
  color: #343d4b;
  font-size: 13px;
}

.product-info-row {
  padding: 9px 0;
  border-bottom: 1px solid #e9ecf1;
  font-size: 13px;
}

.product-info-row span {
  color: #778190;
}

.product-info-row strong {
  color: #1e2734;
  text-align: right;
}

.total-row strong {
  font-size: 14px;
}

.product-sale-section {
  margin-bottom: 24px;
}

.product-sheet-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding-top: 18px;
  border-top: 1px solid #dfe3ea;
}

/* Statistiques */
.statistics-intro {
  align-items: flex-end;
}

.period-control {
  min-width: 170px;
}

.period-control label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.statistics-section {
  margin-top: 28px;
}

.statistics-section:first-of-type {
  margin-top: 0;
}

.section-heading {
  margin-bottom: 14px;
}

.section-heading h3 {
  font-size: 17px;
}

.section-heading p {
  font-size: 13px;
}

.chart-wrapper {
  height: 290px;
}

.ranking-list {
  display: grid;
}

.ranking-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ranking-medal {
  font-size: 18px;
}

.ranking-button {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.ranking-button:hover {
  background: rgba(255, 255, 255, 0.025);
}

.monthly-heading {
  align-items: flex-end;
}

.compact-control {
  min-width: 120px;
}

.monthly-panel {
  padding: 0;
  overflow: hidden;
}

.monthly-statistics-table td:nth-child(n + 2),
.monthly-statistics-table th:nth-child(n + 2) {
  text-align: right;
}

.coming-soon {
  text-align: center;
  padding: 55px 30px;
}

.coming-soon > span {
  font-size: 38px;
}

.coming-soon p {
  color: var(--muted);
}

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

  .toolbar input {
    grid-column: 1 / -1;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
  }

  .navigation {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .top-header {
    position: static;
  }

  #page-content {
    padding: 20px 16px 35px;
  }

  .page-intro,
  .section-heading,
  .statistics-intro {
    flex-direction: column;
    align-items: stretch;
  }

  .stats,
  .dashboard-grid,
  .stock-summary,
  .form-grid,
  .product-info-grid,
  .product-money-grid {
    grid-template-columns: 1fr !important;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  .toolbar input {
    grid-column: auto;
  }

  .modal {
    align-items: flex-start;
    padding: 18px;
  }

  .modal-content {
    max-height: calc(100vh - 36px);
    padding: 20px;
  }

  .product-sheet-header,
  .product-sheet-actions {
    flex-direction: column;
  }

  .product-sheet-title {
    font-size: 25px;
  }

  .product-sheet-actions button {
    width: 100%;
  }
}


.shipped-status {
  color: #f2c56a;
  background: rgba(242, 197, 106, 0.12);
}

.returned-status {
  color: #d5b3ff;
  background: rgba(181, 126, 255, 0.12);
}

.article-menu .menu-label {
  padding: 7px 11px 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.article-menu button.current-status {
  background: var(--surface-3);
  font-weight: 800;
}

.article-menu button.current-status::after {
  content: "✓";
  margin-left: auto;
}

.product-status-expedie {
  color: #f2c56a;
  background: rgba(242, 197, 106, 0.12);
}

.product-status-retourne {
  color: #d5b3ff;
  background: rgba(181, 126, 255, 0.12);
}

/* ======================================================
   DASHBOARD — ALERTE STOCK +15 JOURS
   ====================================================== */
.dashboard-stock-warning {
  margin-top: 14px;
  padding: 11px 12px;
  border: 1px solid rgba(242, 197, 106, 0.35);
  border-radius: 9px;
  background: rgba(242, 197, 106, 0.09);
  color: #f2c56a;
  font-size: 13px;
  line-height: 1.45;
}

.dashboard-stock-warning strong {
  color: inherit;
}

/* ======================================================
   FICHE ARTICLE — HISTORIQUE DES STATUTS
   ====================================================== */
.status-history-list {
  display: grid;
  gap: 7px;
}

.status-history-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.status-history-row:last-child {
  border-bottom: 0;
}

.status-history-row span {
  color: var(--muted);
}


/* ======================================================
   DASHBOARD — ALERTE STOCK CLIQUABLE
   ====================================================== */
.dashboard-stock-warning {
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.dashboard-stock-warning:hover {
  border-color: rgba(242, 197, 106, 0.7);
  background: rgba(242, 197, 106, 0.14);
}

.dashboard-stock-warning span {
  display: inline-block;
  margin-left: 4px;
  font-weight: 700;
}

/* ======================================================
   FICHE ARTICLE — THÈME SOMBRE
   ====================================================== */
.article-view-content {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.article-view-content .product-sheet-header,
.article-view-content .product-info-section h3,
.article-view-content .product-sale-section h3,
.article-view-content .product-info-row,
.article-view-content .product-sheet-actions {
  border-color: var(--border);
}

.article-view-content .product-sheet-title,
.article-view-content .product-money-value,
.article-view-content .product-info-row strong,
.article-view-content .product-info-section h3,
.article-view-content .product-sale-section h3 {
  color: var(--text);
}

.article-view-content .product-sheet-id,
.article-view-content .product-sheet-brand,
.article-view-content .product-money-label,
.article-view-content .product-money-card small,
.article-view-content .product-info-row span {
  color: var(--muted);
}

.article-view-content .product-money-card {
  background: var(--surface-2);
  border-color: var(--border);
}

.article-view-content .product-status-stock {
  color: #8ee6b8;
  background: rgba(52, 199, 117, 0.14);
}

.article-view-content .product-status-sold {
  color: #9fc2ff;
  background: rgba(79, 134, 247, 0.15);
}


/* ======================================================
   ICONOGRAPHIE PROFESSIONNELLE - LUCIDE
   ====================================================== */
.ui-icon,
.nav-icon,
.menu-icon,
.status-icon,
.button-icon,
.row-icon,
.warning-icon,
.warning-arrow,
.coming-soon-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  stroke-width: 1.9;
}

.nav-icon {
  width: 18px;
  height: 18px;
}

.nav-link.active .nav-icon {
  stroke-width: 2.2;
}

.stock-summary-title,
.heading-with-icon,
.inline-icon-text {
  display: flex !important;
  align-items: center;
  gap: 8px;
}

.stock-summary-title .ui-icon {
  width: 16px;
  height: 16px;
}

.heading-with-icon .ui-icon {
  width: 18px;
  height: 18px;
  color: #9da8ff;
}

.article-menu button {
  gap: 9px;
}

.menu-icon {
  width: 16px;
  height: 16px;
  color: #aeb7c7;
}

.article-menu .danger-action .menu-icon {
  color: currentColor;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-icon {
  width: 13px;
  height: 13px;
}

.stock-age {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.product-sheet-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.button-icon {
  width: 16px;
  height: 16px;
}

.row-icon {
  width: 14px;
  height: 14px;
}

.empty-state-icon {
  width: 38px;
  height: 38px;
  stroke-width: 1.5;
}

.coming-soon-icon {
  width: 34px;
  height: 34px;
  color: #9da8ff;
}

.dashboard-stock-warning {
  align-items: center;
  gap: 9px;
}

.warning-icon {
  width: 18px;
  height: 18px;
  color: #f1b85b;
}

.warning-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
}

.warning-arrow {
  width: 14px;
  height: 14px;
}

/* Ajustements d'alignement pour les icônes */
.dashboard-stock-warning:not(.hidden) {
  display: flex;
}

.dashboard-stock-warning > span {
  margin-left: 0;
  font-weight: 400;
}

.dashboard-stock-warning .warning-link {
  display: inline-flex;
  margin-left: auto;
  font-weight: 700;
  white-space: nowrap;
}

.coming-soon > .coming-soon-icon {
  margin-bottom: 8px;
}


/* ======================================================
   OBJECTIFS
   ====================================================== */

.objectives-intro {
  align-items: center;
}

.objectives-month-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

.objectives-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.objective-card {
  min-width: 0;
}

.objective-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.objective-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(109, 124, 255, 0.12);
  color: var(--primary-strong);
  border: 1px solid rgba(109, 124, 255, 0.2);
}

.objective-icon svg {
  width: 18px;
  height: 18px;
}

.objective-card-head h3 {
  margin: 2px 0 0;
  font-size: 14px;
}

.objective-kicker {
  display: block;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 750;
}

.objective-value-line {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-bottom: 16px;
  min-width: 0;
}

.objective-value-line > strong {
  font-size: clamp(24px, 2.1vw, 31px);
  letter-spacing: -0.7px;
  white-space: nowrap;
}

.objective-value-line > span {
  color: var(--muted);
  font-size: 13px;
  min-width: 0;
}

.objective-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.objective-progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width 0.35s ease;
}

.objective-progress-fill.objective-complete {
  background: var(--green);
}

.objective-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.objective-footer > :first-child {
  color: var(--text);
  font-weight: 750;
}

.objectives-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 16px;
  margin-top: 16px;
}

.objectives-summary-list {
  display: grid;
  gap: 2px;
  margin-top: 16px;
}

.objective-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.objective-summary-row:last-child {
  border-bottom: 0;
}

.objective-summary-label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
}

.summary-icon {
  width: 16px;
  height: 16px;
}

.objective-summary-row strong {
  text-align: right;
  font-size: 12px;
}

.objective-summary-muted strong {
  color: var(--muted);
  font-weight: 600;
}

.objective-summary-success strong {
  color: var(--green);
}

.objectives-form {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.input-with-suffix {
  position: relative;
}

.input-with-suffix input {
  width: 100%;
  padding-right: 38px;
}

.input-with-suffix > span {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 13px;
  pointer-events: none;
}

.objective-save-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 2px;
}

.button-icon {
  width: 16px;
  height: 16px;
}

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

  .objectives-bottom-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .objectives-intro {
    align-items: flex-start;
  }

  .objectives-month-badge {
    align-self: flex-start;
  }

  .objective-summary-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .objective-summary-row strong {
    text-align: left;
  }
}


/* ======================================================
   OBJECTIF ANNUEL
   ====================================================== */

.annual-objective-section {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 16px;
  margin-top: 16px;
}

.annual-objective-card {
  min-width: 0;
}

.annual-objective-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.annual-year-badge,
.treasury-year-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.annual-objective-value {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 6px 0 18px;
}

.annual-objective-value > strong {
  font-size: clamp(30px, 3vw, 42px);
  letter-spacing: -1.1px;
  white-space: nowrap;
}

.annual-objective-value > span {
  color: var(--muted);
  font-size: 14px;
}

.annual-progress {
  height: 10px;
}

.annual-objective-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-top: 14px;
}

.annual-objective-footer > div:first-child {
  display: grid;
  gap: 2px;
}

.annual-objective-footer > div:first-child strong {
  font-size: 18px;
}

.annual-objective-footer > div:first-child span,
.annual-objective-pace {
  color: var(--muted);
  font-size: 12px;
}

.annual-objective-pace {
  text-align: right;
  max-width: 330px;
}

/* ======================================================
   TRESORERIE
   ====================================================== */

.treasury-intro {
  align-items: center;
}

.treasury-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.treasury-card {
  min-width: 0;
}

.treasury-main-card {
  border-color: rgba(109, 124, 255, 0.28);
  background: linear-gradient(145deg, rgba(109, 124, 255, 0.08), var(--surface));
}

.treasury-card-head {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 16px;
}

.treasury-icon {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(109, 124, 255, 0.1);
  color: var(--primary-strong);
}

.treasury-icon svg {
  width: 15px;
  height: 15px;
}

.treasury-card > strong {
  display: block;
  font-size: clamp(24px, 2vw, 31px);
  letter-spacing: -0.7px;
  margin-bottom: 7px;
  white-space: nowrap;
}

.treasury-card > p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.treasury-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  gap: 16px;
  margin-top: 16px;
}

.treasury-breakdown-list {
  display: grid;
  margin-top: 12px;
}

.treasury-breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.treasury-breakdown-row:last-child {
  border-bottom: 0;
}

.treasury-breakdown-row span {
  color: var(--muted);
}

.treasury-history-panel {
  margin-top: 16px;
}

.treasury-history-heading {
  align-items: flex-end;
}

.treasury-table .money-positive,
.treasury-table .money-negative {
  font-weight: 750;
}

@media (max-width: 1100px) {
  .treasury-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .annual-objective-section,
  .treasury-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .treasury-intro {
    align-items: flex-start;
  }

  .treasury-cards {
    grid-template-columns: 1fr;
  }

  .annual-objective-head,
  .annual-objective-footer,
  .treasury-history-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .annual-objective-pace {
    text-align: left;
  }
}


.treasury-savings-card {
  border-color: rgba(53, 194, 127, 0.22);
  background: linear-gradient(145deg, rgba(53, 194, 127, 0.055), var(--surface));
}

.treasury-settings-panel small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}


/* ======================================================
   TRESORERIE - MOUVEMENTS
   ====================================================== */
.treasury-simple-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.treasury-transaction-form select,
#treasury-transaction-type,
#treasury-transaction-date,
#treasury-transaction-note {
  width: 100%; box-sizing: border-box; min-height: 44px; border: 1px solid var(--border-color, #2a3441);
  border-radius: 10px; background: var(--panel-bg, #111821); color: inherit; padding: 0 12px;
}
.optional-label { opacity: .55; font-weight: 400; }
.treasury-delete-transaction {
  border: 0; background: transparent; color: #d26a6a; cursor: pointer; padding: 7px; border-radius: 8px;
}
.treasury-delete-transaction:hover { background: rgba(210,106,106,.12); }
.treasury-empty-state { padding: 22px 8px 6px; text-align: center; opacity: .6; }
@media (max-width: 1050px) { .treasury-simple-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .treasury-simple-cards { grid-template-columns: 1fr; } }


/* ======================================================
   BITCOIN
   ====================================================== */
.bitcoin-intro { align-items: center; }
.bitcoin-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}
.bitcoin-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}
.bitcoin-main-card { background: linear-gradient(145deg, var(--surface-2), var(--surface)); }
.bitcoin-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}
.bitcoin-card-icon { width: 18px; height: 18px; color: var(--primary-strong); }
.bitcoin-card strong {
  display: block;
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.08;
  letter-spacing: -0.6px;
  white-space: nowrap;
}
.bitcoin-card p { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.bitcoin-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}
.bitcoin-price-form { display: flex; align-items: end; gap: 12px; }
.bitcoin-price-form .form-group { flex: 1; margin: 0; }
.bitcoin-price-form .secondary-button { min-height: 43px; }
.bitcoin-summary-list { margin-top: 18px; padding-top: 8px; border-top: 1px solid var(--border); }
.bitcoin-purchase-form .form-actions { margin-top: 8px; }
.btc-input-suffix > span { min-width: 48px; }
.bitcoin-history-panel { margin-bottom: 30px; }
.bitcoin-history-heading { margin-bottom: 12px; }
.bitcoin-table th:last-child,
.bitcoin-table td:last-child { width: 48px; text-align: right; }
.bitcoin-delete-purchase {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.bitcoin-delete-purchase:hover { color: var(--red); background: rgba(255,107,107,.1); }
.bitcoin-delete-purchase svg { width: 16px; height: 16px; }
.bitcoin-empty-state { padding: 30px 10px; text-align: center; color: var(--muted); }
.bitcoin-empty-state svg { width: 28px; height: 28px; margin-bottom: 8px; opacity: .7; }
.bitcoin-empty-state p { margin: 0; }
.optional-label { color: var(--muted); font-weight: 400; }
@media (max-width: 1100px) {
  .bitcoin-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bitcoin-detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .bitcoin-cards { grid-template-columns: 1fr; }
  .bitcoin-price-form { flex-direction: column; align-items: stretch; }
}


/* ======================================================
   SELLIVO — IDENTITÉ
   ====================================================== */
.sellivo-logo {
  display: flex;
  align-items: center;
  padding: 2px 4px 18px;
}

.sellivo-wordmark {
  min-width: 0;
}

.sellivo-wordmark h1 {
  margin: 0;
  font-size: 25px;
  line-height: 1;
  letter-spacing: -1px;
  font-weight: 800;
}

.sellivo-dot {
  color: var(--primary-strong);
}

.sellivo-wordmark > span {
  display: block;
  margin-top: 6px;
  font-size: 8.5px;
  letter-spacing: 1.15px;
  color: var(--muted);
  white-space: nowrap;
}

/* Cours Bitcoin automatique */
.bitcoin-live-price {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
  margin-bottom: 16px;
}
.bitcoin-live-price > div { display: grid; gap: 4px; }
.bitcoin-live-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(53, 194, 127, .10);
}
.bitcoin-live-price strong { font-size: 24px; letter-spacing: -.4px; }
.bitcoin-live-price small { color: var(--muted); font-size: 11px; }
.bitcoin-manual-price {
  padding-top: 2px;
  opacity: .78;
}
@media (max-width: 650px) {
  .bitcoin-live-price { align-items: stretch; flex-direction: column; }
  .bitcoin-live-price .secondary-button { width: 100%; }
}


/* ======================================================
   MOBILE / PWA
   ====================================================== */
@media (max-width: 760px) {
  .app { display: block; }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    height: auto;
    padding: 10px 12px 8px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .sellivo-logo { padding: 2px 4px 9px; }
  .sellivo-mark { width: 31px; height: 31px; flex-basis: 31px; border-radius: 10px; }
  .sellivo-mark svg { width: 17px; height: 17px; }
  .sellivo-wordmark h1 { font-size: 19px; }
  .sellivo-wordmark span { display: none; }
  .navigation {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .navigation::-webkit-scrollbar { display: none; }
  .nav-link {
    flex: 0 0 auto;
    padding: 8px 10px;
    gap: 7px;
    font-size: 12px;
    white-space: nowrap;
  }
  .nav-icon { width: 15px; height: 15px; }
  .sidebar-footer { display: none; }
  .main-content { min-width: 0; }
  .top-header { padding: 16px 16px 0; }
  #page-content { padding-left: 16px; padding-right: 16px; }
}


/* ======================================================
   CORRECTION MISE EN PAGE BITCOIN
   ====================================================== */

.bitcoin-detail-grid > .panel {
  min-width: 0;
}

.bitcoin-detail-grid .panel-heading {
  margin-bottom: 20px;
}

.bitcoin-detail-grid .panel-heading > div {
  min-width: 0;
}

.bitcoin-detail-grid .panel-heading p {
  line-height: 1.55;
  max-width: 620px;
}

.bitcoin-live-price {
  position: relative;
  clear: both;
  width: 100%;
  box-sizing: border-box;
  margin-top: 0;
  margin-bottom: 20px;
}

.bitcoin-live-price > div {
  min-width: 0;
}

.bitcoin-live-price strong {
  display: block;
  line-height: 1.2;
  margin-top: 2px;
}

.bitcoin-live-price small {
  display: block;
  line-height: 1.35;
}

.bitcoin-manual-price {
  margin-top: 0;
}

@media (max-width: 650px) {
  .bitcoin-detail-grid .panel-heading {
    margin-bottom: 16px;
  }

  .bitcoin-live-price {
    gap: 12px;
    padding: 14px;
  }

  .bitcoin-live-price strong {
    font-size: 21px;
  }
}


/* ======================================================
   PARAMÈTRES
   ====================================================== */

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.settings-backup-card {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  min-width: 0;
}

.settings-card-icon {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: rgba(124, 92, 255, 0.13);
  color: var(--primary-strong);
}

.settings-card-icon-secondary {
  background: rgba(89, 201, 165, 0.12);
  color: #59c9a5;
}

.settings-card-icon svg {
  width: 20px;
  height: 20px;
}

.settings-card-content {
  min-width: 0;
  flex: 1;
}

.settings-card-content h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.settings-card-content > p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 13px;
}

.settings-data-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.settings-data-summary > div {
  padding: 11px 12px;
  border-radius: 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.settings-data-summary span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
}

.settings-data-summary strong {
  font-size: 17px;
}

.settings-helper {
  margin: 12px 0 0 !important;
  font-size: 11px !important;
}

.import-backup-preview {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

.import-backup-preview strong {
  display: block;
  margin-bottom: 8px;
}

.import-backup-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.import-backup-preview-grid div {
  font-size: 12px;
  color: var(--muted);
}

.import-backup-preview-grid b {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 15px;
}

.settings-import-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.settings-warning {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 16px;
  padding: 11px 12px;
  border-radius: 11px;
  background: rgba(255, 190, 92, 0.08);
  color: #e7b65f;
  font-size: 11px;
  line-height: 1.45;
}

.settings-warning svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 1px;
}

.settings-info-panel {
  margin-bottom: 30px;
}

.settings-info-list {
  display: grid;
  gap: 2px;
}

.settings-info-row {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.settings-info-row:last-child {
  border-bottom: 0;
}

.settings-info-row > svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  color: var(--muted);
}

.settings-info-row strong,
.settings-info-row span {
  display: block;
}

.settings-info-row strong {
  margin-bottom: 4px;
  font-size: 13px;
}

.settings-info-row span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

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

@media (max-width: 600px) {
  .settings-backup-card { flex-direction: column; }
  .settings-data-summary,
  .import-backup-preview-grid { grid-template-columns: 1fr; }
  .settings-import-actions { flex-direction: column-reverse; }
  .settings-import-actions button { width: 100%; }
}

/* ======================================================
   AUDIT COULEURS DES VALEURS
   ====================================================== */
.money-positive,
.profit-positive {
  color: #59c9a5 !important;
}

.money-negative,
.profit-negative {
  color: #ff6b6b !important;
}

/* V15 — espacement / grilles */
.page.active-page > .page-intro { margin-top: 0; margin-bottom: 28px; }
#bitcoin-page .bitcoin-cards { margin-top: 0; gap: 18px; }
#bitcoin-page .bitcoin-detail-grid { margin-top: 28px; }
#settings-page .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 22px !important; margin-top: 0; margin-bottom: 22px; align-items: stretch; }
#settings-page .settings-backup-card { height: 100%; box-sizing: border-box; }
@media (max-width: 980px) { #settings-page .settings-grid { grid-template-columns: 1fr !important; } }


/* ======================================================
   V16 — SIDEBAR BASSE + ALIGNEMENT DES ICONES DE BOUTONS
   ====================================================== */

.sidebar-settings-link {
  width: 100%;
  box-sizing: border-box;
}

/* Tous les boutons texte + icône utilisent le même axe vertical. */
.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1.2;
}

.primary-button .button-icon,
.secondary-button .button-icon,
.danger-button .button-icon {
  display: block;
  width: 16px;
  height: 16px;
  margin: 0;
  flex: 0 0 16px;
  align-self: center;
}

#add-bitcoin-purchase-button .button-icon,
#bitcoin-refresh-price .button-icon {
  position: static;
  transform: none;
  vertical-align: middle;
}


/* ======================================================
   V17 — BAS DE SIDEBAR + HISTORIQUE TRÉSORERIE
   ====================================================== */

/* Le profil est d'abord affiché, puis Paramètres juste en dessous. */
.sidebar-footer {
  gap: 6px;
}

.sidebar-user {
  margin-bottom: 2px;
}

.sidebar-settings-link {
  margin-top: 0;
}

/* En-tête de l'historique : titre à gauche, année proprement alignée à droite. */
.treasury-history-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 18px;
}

.treasury-history-title {
  min-width: 0;
  flex: 1;
}

.treasury-history-title h3 {
  margin-bottom: 6px;
}

.treasury-history-title p {
  margin: 0;
  line-height: 1.45;
}

.treasury-year-selector {
  flex: 0 0 155px;
  width: 155px;
  display: grid;
  gap: 7px;
  align-self: flex-start;
}

.treasury-year-selector label {
  margin: 0;
  font-size: 12px;
  line-height: 1.2;
  color: var(--muted);
}

.treasury-year-selector select {
  width: 100%;
  min-width: 0;
  height: 42px;
  box-sizing: border-box;
}

/* Donne un peu d'air entre l'en-tête et le tableau. */
.treasury-history-panel .table-wrapper {
  margin-top: 2px;
}

@media (max-width: 700px) {
  .treasury-history-heading {
    gap: 16px;
  }

  .treasury-year-selector {
    width: 100%;
    flex-basis: auto;
  }
}


/* ======================================================
   V18 — FINITION SIDEBAR & CLASSEMENT
   ====================================================== */
.sidebar-footer {
  gap: 0;
}
.sidebar-settings-link {
  width: 100%;
  margin: 0;
}
.ranking-position {
  width: 25px;
  height: 25px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 25px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}


/* ======================================================
   V19 — FINITION MOBILE AVANT MISE EN LIGNE
   ====================================================== */

.mobile-settings-link { display: none; }

@media (max-width: 760px) {
  html { scroll-padding-top: 106px; }
  body { overflow-x: hidden; }

  .sidebar {
    box-sizing: border-box;
    background: rgba(18, 21, 29, 0.98);
    backdrop-filter: blur(14px);
  }

  .sellivo-logo { padding: 1px 6px 8px; }

  .navigation {
    margin: 0 -2px;
    padding: 0 2px 3px;
    -webkit-overflow-scrolling: touch;
  }

  .navigation .nav-link {
    min-height: 38px;
    box-sizing: border-box;
  }

  .mobile-settings-link { display: flex; }

  .top-header { display: none; }

  #page-content {
    padding: 18px 14px calc(32px + env(safe-area-inset-bottom));
  }

  .page.active-page > .page-intro { margin-bottom: 20px; }

  .page-intro h3 { font-size: 22px; }

  .page-intro p,
  .section-heading p,
  .panel-heading p { line-height: 1.45; }

  .page-intro > .primary-button,
  .page-intro > .secondary-button {
    width: 100%;
    min-height: 44px;
  }

  .panel,
  .card,
  .stock-summary-card,
  .bitcoin-card,
  .treasury-simple-card {
    border-radius: 14px;
  }

  .panel { padding: 16px; }

  .stats,
  .dashboard-stats,
  .dashboard-grid,
  .chart-grid,
  .stock-summary,
  .bitcoin-cards,
  .bitcoin-detail-grid,
  .treasury-simple-cards,
  .settings-grid {
    gap: 12px !important;
  }

  .card,
  .stock-summary-card,
  .bitcoin-card,
  .treasury-simple-card { padding: 16px; }

  .card p,
  .stock-summary-card strong,
  .bitcoin-card strong { overflow-wrap: anywhere; }

  input,
  select,
  textarea {
    width: 100%;
    max-width: 100%;
    min-height: 44px;
    box-sizing: border-box;
    font-size: 16px;
  }

  .form-grid { gap: 14px; }

  .form-actions {
    display: flex;
    flex-direction: column-reverse;
    gap: 9px;
  }

  .form-actions button,
  .toolbar button {
    width: 100%;
    min-height: 44px;
  }

  .primary-button,
  .secondary-button,
  .danger-button { min-height: 42px; }

  .toolbar {
    gap: 9px;
    margin-bottom: 14px;
  }

  .stock-panel,
  .monthly-panel,
  .bitcoin-history-panel,
  .treasury-history-panel {
    overflow: hidden;
  }

  .stock-table-container,
  .table-wrapper,
  .table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  .stock-table { min-width: 860px; }
  .monthly-statistics-table { min-width: 610px; }
  .bitcoin-table { min-width: 760px; }
  .treasury-history-panel table { min-width: 650px; }

  .stock-table th,
  .stock-table td,
  .monthly-statistics-table th,
  .monthly-statistics-table td {
    white-space: nowrap;
  }

  .chart-wrapper {
    min-height: 240px;
    height: 240px;
  }

  .chart-panel { min-width: 0; }

  .period-control,
  .statistics-year-selector,
  .treasury-year-selector {
    width: 100% !important;
    max-width: none;
    flex-basis: auto !important;
  }

  .treasury-history-heading,
  .panel-heading {
    flex-direction: column;
    align-items: stretch;
  }

  #bitcoin-page .bitcoin-detail-grid { margin-top: 18px; }

  .bitcoin-live-price { padding: 14px; }

  .bitcoin-live-price strong {
    font-size: 21px;
    white-space: normal;
  }

  .bitcoin-price-form { gap: 9px; }

  #settings-page .settings-grid { gap: 12px !important; }
  .settings-backup-card { padding: 16px; }

  .modal,
  .view-modal {
    padding: 10px !important;
    align-items: center !important;
  }

  .modal-content,
  .view-modal-content {
    width: 100% !important;
    max-width: 100% !important;
    max-height: calc(100dvh - 20px) !important;
    border-radius: 16px !important;
    padding: 18px !important;
    box-sizing: border-box;
  }

  .product-sheet-title { font-size: 22px; }

  .article-details-actions,
  .product-sheet-actions { gap: 8px; }

  .action-menu,
  .more-menu { max-width: calc(100vw - 24px); }

  .action-menu button,
  .more-menu button { min-height: 42px; }
}

@media (max-width: 390px) {
  #page-content {
    padding-left: 11px;
    padding-right: 11px;
  }

  .nav-link {
    padding-left: 9px;
    padding-right: 9px;
  }

  .panel,
  .card,
  .stock-summary-card,
  .bitcoin-card { padding: 14px; }

  .page-intro h3 { font-size: 20px; }
}


/* ======================================================
   V20 — MOBILE COMPAGNON
   ====================================================== */

.mobile-app-header,
.mobile-bottom-nav,
.mobile-article-list {
  display: none;
}

@media (max-width: 760px) {
  :root { --mobile-nav-height: 68px; }

  body {
    background: #0f1117;
    padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
  }

  .sidebar { display: none !important; }

  .main-content {
    width: 100%;
    min-width: 0;
  }

  .mobile-app-header {
    position: sticky;
    top: 0;
    z-index: 90;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: env(safe-area-inset-top) 16px 0;
    box-sizing: content-box;
    border-bottom: 1px solid var(--border);
    background: rgba(15, 17, 23, 0.96);
    backdrop-filter: blur(16px);
  }

  .mobile-app-header > strong {
    font-size: 20px;
    letter-spacing: -0.6px;
  }

  .mobile-header-action {
    width: 38px;
    height: 38px;
    display: grid !important;
    place-items: center;
    padding: 0 !important;
    border-radius: 11px;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--border);
  }

  .mobile-header-action svg {
    width: 18px;
    height: 18px;
  }

  .mobile-bottom-nav {
    position: fixed;
    z-index: 120;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: var(--mobile-nav-height);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 6px 5px calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    background: rgba(15, 17, 23, 0.97);
    backdrop-filter: blur(18px);
  }

  .mobile-bottom-link {
    min-width: 0;
    height: 54px;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 !important;
    border-radius: 10px;
    font-size: 10px !important;
    color: #777e8d;
  }

  .mobile-bottom-link svg {
    width: 20px;
    height: 20px;
  }

  .mobile-bottom-link.active {
    color: var(--primary-strong);
    background: rgba(124, 92, 255, 0.09);
  }

  #page-content {
    padding: 18px 14px 24px !important;
  }

  .page-intro {
    gap: 12px;
    align-items: stretch;
  }

  .page-intro h3 {
    margin-bottom: 4px;
    font-size: 21px;
  }

  .page-intro p { font-size: 12px; }

  #dashboard-page .dashboard-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #dashboard-page .dashboard-stats .card:nth-child(5),
  #dashboard-page .dashboard-stats .card:nth-child(6) {
    display: none;
  }

  #dashboard-page .dashboard-stats .card {
    min-height: 92px;
    padding: 15px;
  }

  #dashboard-page .dashboard-stats .card h3 {
    font-size: 11px;
    line-height: 1.3;
  }

  #dashboard-page .dashboard-stats .card p { font-size: 22px; }

  #dashboard-page .dashboard-grid {
    grid-template-columns: 1fr !important;
  }

  #articles-page .desktop-article-table {
    display: none !important;
  }

  #articles-page .stock-panel {
    padding: 0 !important;
    border: 0;
    background: transparent;
    overflow: visible;
  }

  .mobile-article-list {
    display: grid;
    gap: 10px;
  }

  .mobile-article-card {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--surface);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-article-card:active {
    transform: scale(0.99);
    background: var(--surface-2);
  }

  .mobile-article-card-top {
    display: flex;
    align-items: flex-start;
    gap: 12px;
  }

  .mobile-article-main {
    min-width: 0;
    flex: 1;
  }

  .mobile-article-id {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
  }

  .mobile-article-main strong {
    display: block;
    overflow: hidden;
    font-size: 15px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-article-brand {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
  }

  .mobile-more-button {
    flex: 0 0 auto;
    width: 36px !important;
    height: 36px;
    min-height: 36px !important;
    margin: -4px -4px 0 0;
    font-size: 21px;
  }

  .mobile-article-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
  }

  .mobile-stock-age {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 7px;
    border-radius: 999px;
    color: var(--muted);
    background: var(--surface-2);
    font-size: 10px;
    font-weight: 700;
  }

  .mobile-stock-age svg {
    width: 11px;
    height: 11px;
  }

  .mobile-article-values {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    padding-top: 11px;
    border-top: 1px solid var(--border);
  }

  .mobile-article-values > span {
    color: var(--muted);
    font-size: 11px;
  }

  .mobile-article-values > strong {
    font-size: 15px;
    white-space: nowrap;
  }

  .mobile-empty-state {
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 32px 16px;
    color: var(--muted);
    text-align: center;
  }

  .mobile-empty-state svg {
    width: 24px;
    height: 24px;
  }

  .mobile-empty-state strong {
    color: var(--text);
    font-size: 14px;
  }

  .mobile-empty-state span { font-size: 11px; }

  #articles-page .stock-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  #articles-page .stock-summary-card {
    min-width: 0;
    padding: 12px 9px;
    text-align: left;
  }

  #articles-page .stock-summary-title {
    gap: 5px;
    font-size: 9px;
    line-height: 1.2;
  }

  #articles-page .stock-summary-title .ui-icon {
    width: 13px;
    height: 13px;
  }

  #articles-page .stock-summary-card strong {
    margin-top: 8px;
    font-size: 19px;
  }

  #articles-page .stock-summary-card small { font-size: 9px; }

  #articles-page .toolbar {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px !important;
  }

  #articles-page #article-search {
    grid-column: 1 / -1;
  }

  #articles-page .toolbar select {
    min-width: 0;
    padding-left: 10px;
    padding-right: 28px;
    font-size: 12px;
  }

  #treasury-page .treasury-simple-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #treasury-page .treasury-simple-card { min-height: 105px; }

  #objectives-page .objective-grid,
  #objectives-page .objectives-grid {
    grid-template-columns: 1fr !important;
  }

  #bitcoin-page .bitcoin-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #bitcoin-page .bitcoin-card { min-height: 108px; }

  #bitcoin-page .bitcoin-card strong { font-size: 20px; }

  .view-modal {
    padding: 0 !important;
    align-items: flex-end !important;
  }

  .view-modal-content {
    max-height: 92dvh !important;
    border-radius: 20px 20px 0 0 !important;
    padding: 20px 16px calc(18px + env(safe-area-inset-bottom)) !important;
  }

  .product-sheet-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 7px !important;
  }

  .product-kpi {
    min-width: 0;
    padding: 11px 8px !important;
  }

  .product-kpi span { font-size: 9px; }

  .product-kpi strong {
    font-size: 15px !important;
    white-space: nowrap;
  }

  .product-sheet-grid {
    grid-template-columns: 1fr !important;
  }

  #settings-page .settings-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 370px) {
  .mobile-bottom-link span { font-size: 9px; }

  #articles-page .stock-summary-title { font-size: 8px; }

  #articles-page .stock-summary-card {
    padding-left: 7px;
    padding-right: 7px;
  }
}


/* ======================================================
   V21 — POLISH MOBILE
   ====================================================== */

@media (max-width: 760px) {
  .mobile-app-header {
    height: 50px;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    align-items: center;
    gap: 6px;
    padding-left: 12px;
    padding-right: 12px;
    border-bottom-color: rgba(255, 255, 255, 0.055);
    background: rgba(15, 17, 23, 0.94);
  }

  .mobile-header-spacer {
    width: 40px;
    height: 40px;
  }

  .mobile-wordmark {
    justify-self: center;
    font-size: 18px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.55px;
    color: var(--text);
  }

  .mobile-header-action {
    justify-self: end;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #8d94a4;
    transition: background 0.15s ease, color 0.15s ease;
  }

  .mobile-header-action:active,
  .mobile-header-action.active {
    background: rgba(124, 92, 255, 0.1);
    color: var(--primary-strong);
  }

  .mobile-header-action svg {
    width: 19px;
    height: 19px;
  }

  .mobile-bottom-link {
    border: 0 !important;
    box-shadow: none !important;
  }

  .mobile-bottom-link.active {
    color: var(--primary-strong);
    background: rgba(124, 92, 255, 0.1);
  }

  .mobile-bottom-link:not(.active) {
    color: #777e8d;
    background: transparent;
  }
}


/* ======================================================
   V22 — DESIGN MOBILE BUSINESS / FINANCE
   ====================================================== */

@media (max-width: 760px) {
  :root {
    --mobile-surface: #171a22;
    --mobile-surface-soft: #1b1f29;
    --mobile-border: rgba(255, 255, 255, 0.065);
  }

  body {
    background:
      radial-gradient(circle at 50% -120px, rgba(124, 92, 255, 0.10), transparent 330px),
      #0f1117;
  }

  /* --------------------------------------------------
     HIÉRARCHIE GÉNÉRALE
     -------------------------------------------------- */

  #page-content {
    padding-top: 20px !important;
  }

  .page-intro {
    margin-bottom: 22px !important;
  }

  .page-intro h3 {
    font-size: 24px !important;
    font-weight: 780;
    letter-spacing: -0.75px;
  }

  .page-intro p {
    max-width: 330px;
    color: #7f8797;
    font-size: 12px;
  }

  .panel,
  .card,
  .bitcoin-card,
  .treasury-card,
  .objective-card,
  .annual-objective-card,
  .settings-backup-card {
    border-color: var(--mobile-border);
    box-shadow: none;
  }

  /* --------------------------------------------------
     DASHBOARD — style appli financière
     -------------------------------------------------- */

  #dashboard-page .dashboard-stats {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  /* Bénéfice = information principale */
  #dashboard-page .dashboard-stats .card:first-child {
    position: relative;
    grid-column: 1 / -1;
    min-height: 126px;
    overflow: hidden;
    padding: 20px;
    border: 1px solid rgba(135, 109, 255, 0.22);
    border-radius: 20px;
    background:
      linear-gradient(135deg, rgba(124, 92, 255, 0.24), rgba(124, 92, 255, 0.055)),
      #181a23;
  }

  #dashboard-page .dashboard-stats .card:first-child::after {
    content: "";
    position: absolute;
    width: 150px;
    height: 150px;
    right: -48px;
    bottom: -80px;
    border-radius: 50%;
    background: rgba(124, 92, 255, 0.17);
    filter: blur(2px);
    pointer-events: none;
  }

  #dashboard-page .dashboard-stats .card:first-child h3 {
    color: #aaa3ca;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.65px;
  }

  #dashboard-page .dashboard-stats .card:first-child p {
    position: relative;
    z-index: 1;
    margin-top: 14px;
    font-size: 34px !important;
    font-weight: 800;
    letter-spacing: -1.1px;
  }

  #dashboard-page .dashboard-stats .card:not(:first-child) {
    min-height: 92px;
    padding: 15px;
    border-radius: 16px;
    background: var(--mobile-surface);
  }

  #dashboard-page .dashboard-stats .card:not(:first-child) h3 {
    color: #828999;
    font-size: 10px;
    font-weight: 600;
  }

  #dashboard-page .dashboard-stats .card:not(:first-child) p {
    margin-top: 10px;
    font-size: 22px;
    font-weight: 760;
    letter-spacing: -0.5px;
  }

  #dashboard-page .dashboard-grid {
    gap: 12px !important;
    margin-top: 18px;
  }

  #dashboard-page .dashboard-grid .panel {
    padding: 17px;
    border-radius: 17px;
    background: var(--mobile-surface);
  }

  #dashboard-page .dashboard-grid .panel > h3 {
    margin-bottom: 15px;
    font-size: 14px;
  }

  #dashboard-page .summary-line {
    padding: 10px 0;
  }

  /* --------------------------------------------------
     ARTICLES — cartes plus propres
     -------------------------------------------------- */

  .mobile-article-card {
    border-color: var(--mobile-border);
    border-radius: 17px;
    background: var(--mobile-surface);
  }

  .mobile-article-card-top {
    align-items: center;
  }

  .mobile-article-main strong {
    font-size: 15.5px;
    font-weight: 700;
  }

  .mobile-article-id,
  .mobile-article-brand {
    color: #777f8f;
  }

  .mobile-article-values {
    border-top-color: var(--mobile-border);
  }

  #articles-page .stock-summary-card {
    border-color: var(--mobile-border);
    border-radius: 14px;
    background: var(--mobile-surface);
  }

  #articles-page .stock-summary-card strong {
    font-weight: 770;
    letter-spacing: -0.45px;
  }

  #articles-page #article-search,
  #articles-page .toolbar select {
    border-color: var(--mobile-border);
    border-radius: 13px;
    background: var(--mobile-surface);
  }

  /* --------------------------------------------------
     TRÉSORERIE — solde principal comme une app bancaire
     -------------------------------------------------- */

  #treasury-page .treasury-simple-cards {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  #treasury-page .treasury-main-card {
    position: relative;
    grid-column: 1 / -1;
    min-height: 145px;
    overflow: hidden;
    padding: 20px;
    border: 1px solid rgba(89, 201, 165, 0.17);
    border-radius: 21px;
    background:
      linear-gradient(135deg, rgba(89, 201, 165, 0.14), transparent 70%),
      #181b22;
  }

  #treasury-page .treasury-main-card::after {
    content: "";
    position: absolute;
    width: 165px;
    height: 165px;
    right: -65px;
    bottom: -95px;
    border-radius: 50%;
    background: rgba(89, 201, 165, 0.10);
  }

  #treasury-page .treasury-main-card .treasury-card-head {
    color: #9bb9ae;
  }

  #treasury-page .treasury-main-card > strong {
    position: relative;
    z-index: 1;
    margin-top: 18px;
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -1px;
  }

  #treasury-page .treasury-main-card > p {
    position: relative;
    z-index: 1;
    max-width: 260px;
  }

  #treasury-page .treasury-card:not(.treasury-main-card) {
    min-height: 112px;
    padding: 15px;
    border-radius: 16px;
    background: var(--mobile-surface);
  }

  #treasury-page .treasury-card:not(.treasury-main-card) > strong {
    margin-top: 13px;
    font-size: 19px;
    letter-spacing: -0.4px;
  }

  #treasury-page .treasury-card:not(.treasury-main-card) > p {
    display: none;
  }

  #treasury-page .treasury-card-head {
    gap: 8px;
    font-size: 10px;
  }

  #treasury-page .treasury-icon {
    width: 29px;
    height: 29px;
    border-radius: 9px;
  }

  #treasury-page .treasury-detail-grid {
    gap: 12px !important;
    margin-top: 18px;
  }

  #treasury-page .treasury-detail-grid > .panel,
  #treasury-page .treasury-history-panel {
    border-radius: 17px;
    background: var(--mobile-surface);
  }

  /* --------------------------------------------------
     OBJECTIFS — progression mise en avant
     -------------------------------------------------- */

  #objectives-page .objectives-grid {
    gap: 11px !important;
  }

  #objectives-page .objective-card {
    padding: 17px;
    border-radius: 18px;
    background: var(--mobile-surface);
  }

  #objectives-page .objective-card-head {
    align-items: center;
  }

  #objectives-page .objective-icon {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: rgba(124, 92, 255, 0.11);
  }

  #objectives-page .objective-card-head h3 {
    font-size: 14px;
  }

  #objectives-page .objective-kicker {
    color: #7f8797;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
  }

  #objectives-page .objective-value-line {
    margin-top: 19px;
  }

  #objectives-page .objective-value-line > strong {
    font-size: 26px;
    font-weight: 790;
    letter-spacing: -0.8px;
  }

  #objectives-page .objective-progress {
    height: 7px;
    margin-top: 15px;
    border-radius: 999px;
    background: #242833;
  }

  #objectives-page .objective-progress-fill {
    border-radius: inherit;
  }

  #objectives-page .objective-footer {
    margin-top: 11px;
    color: #858d9d;
    font-size: 10px;
  }

  #objectives-page .objectives-bottom-grid,
  #objectives-page .annual-objective-section {
    gap: 12px !important;
    margin-top: 18px;
  }

  #objectives-page .objective-summary-panel,
  #objectives-page .objective-settings-panel,
  #objectives-page .annual-objective-card,
  #objectives-page .annual-objective-settings {
    border-radius: 18px;
    background: var(--mobile-surface);
  }

  /* --------------------------------------------------
     BITCOIN — mini portefeuille
     -------------------------------------------------- */

  #bitcoin-page .bitcoin-cards {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  #bitcoin-page .bitcoin-main-card {
    position: relative;
    grid-column: 1 / -1;
    min-height: 142px;
    overflow: hidden;
    padding: 20px;
    border: 1px solid rgba(247, 147, 26, 0.16);
    border-radius: 21px;
    background:
      linear-gradient(135deg, rgba(247, 147, 26, 0.13), transparent 72%),
      #191a20;
  }

  #bitcoin-page .bitcoin-main-card::after {
    content: "₿";
    position: absolute;
    right: 16px;
    bottom: -20px;
    color: rgba(247, 147, 26, 0.07);
    font-size: 110px;
    font-weight: 800;
    line-height: 1;
    pointer-events: none;
  }

  #bitcoin-page .bitcoin-main-card strong {
    position: relative;
    z-index: 1;
    margin-top: 18px;
    font-size: 28px !important;
    font-weight: 800;
    letter-spacing: -0.8px;
  }

  #bitcoin-page .bitcoin-main-card p {
    position: relative;
    z-index: 1;
  }

  #bitcoin-page .bitcoin-card:not(.bitcoin-main-card) {
    min-height: 108px;
    padding: 15px;
    border-radius: 16px;
    background: var(--mobile-surface);
  }

  #bitcoin-page .bitcoin-card:not(.bitcoin-main-card) strong {
    font-size: 18px !important;
    line-height: 1.15;
  }

  #bitcoin-page .bitcoin-card:not(.bitcoin-main-card) p {
    display: none;
  }

  #bitcoin-page .bitcoin-detail-grid {
    gap: 12px !important;
  }

  #bitcoin-page .bitcoin-detail-grid > .panel,
  #bitcoin-page .bitcoin-history-panel {
    border-radius: 18px;
    background: var(--mobile-surface);
  }

  #bitcoin-page #add-bitcoin-purchase-button {
    border-radius: 13px;
  }

  /* --------------------------------------------------
     BOUTONS / CHAMPS — cohérence générale
     -------------------------------------------------- */

  .primary-button {
    border-radius: 13px;
    font-weight: 690;
  }

  .secondary-button {
    border-radius: 13px;
  }

  input,
  select,
  textarea,
  .input-with-suffix {
    border-radius: 13px;
  }

  /* --------------------------------------------------
     NAVIGATION BASSE — plus légère
     -------------------------------------------------- */

  .mobile-bottom-nav {
    border-top-color: rgba(255, 255, 255, 0.055);
    background: rgba(14, 16, 22, 0.965);
  }

  .mobile-bottom-link {
    border-radius: 12px;
  }

  .mobile-bottom-link.active {
    background: transparent !important;
  }

  .mobile-bottom-link.active svg {
    filter: drop-shadow(0 0 6px rgba(124, 92, 255, 0.3));
  }

  .mobile-bottom-link.active span {
    font-weight: 700;
  }
}

@media (max-width: 370px) {
  #dashboard-page .dashboard-stats .card:first-child p,
  #treasury-page .treasury-main-card > strong {
    font-size: 30px !important;
  }

  #bitcoin-page .bitcoin-main-card strong {
    font-size: 25px !important;
  }
}


/* ======================================================
   V23 — ACCENTS COULEUR PC + GRILLES MOBILE SANS TROUS
   ====================================================== */

/* ------------------------------------------------------
   DESKTOP : couleurs très légères, sans changer la structure
   ------------------------------------------------------ */

@media (min-width: 761px) {
  /* Dashboard : quelques accents plutôt qu'un écran entièrement gris. */
  #dashboard-page .dashboard-stats .card {
    position: relative;
    overflow: hidden;
    transition: border-color 0.18s ease, background 0.18s ease;
  }

  #dashboard-page .dashboard-stats .card:nth-child(1) {
    border-color: rgba(124, 92, 255, 0.20);
    background:
      linear-gradient(135deg, rgba(124, 92, 255, 0.09), transparent 65%),
      var(--surface);
  }

  #dashboard-page .dashboard-stats .card:nth-child(2) {
    border-color: rgba(89, 201, 165, 0.15);
    background:
      linear-gradient(135deg, rgba(89, 201, 165, 0.055), transparent 68%),
      var(--surface);
  }

  #dashboard-page .dashboard-stats .card:nth-child(3) {
    border-color: rgba(93, 162, 255, 0.14);
    background:
      linear-gradient(135deg, rgba(93, 162, 255, 0.05), transparent 70%),
      var(--surface);
  }

  #dashboard-page .dashboard-stats .card:nth-child(4) {
    border-color: rgba(255, 190, 92, 0.13);
    background:
      linear-gradient(135deg, rgba(255, 190, 92, 0.045), transparent 70%),
      var(--surface);
  }

  /* Trésorerie : disponible mis en avant, épargne avec un accent doux. */
  #treasury-page .treasury-main-card {
    border-color: rgba(89, 201, 165, 0.18);
    background:
      linear-gradient(135deg, rgba(89, 201, 165, 0.075), transparent 68%),
      var(--surface);
  }

  #treasury-page .treasury-savings-card {
    border-color: rgba(124, 92, 255, 0.14);
    background:
      linear-gradient(135deg, rgba(124, 92, 255, 0.05), transparent 70%),
      var(--surface);
  }

  /* Bitcoin : petit rappel orange du BTC, sans rendre la page flashy. */
  #bitcoin-page .bitcoin-main-card {
    border-color: rgba(247, 147, 26, 0.18);
    background:
      linear-gradient(135deg, rgba(247, 147, 26, 0.075), transparent 70%),
      var(--surface);
  }

  #bitcoin-page .bitcoin-card-icon {
    color: #f4a13c;
  }

  /* Objectifs : accent violet discret sur les cartes de progression. */
  #objectives-page .objective-card {
    border-color: rgba(124, 92, 255, 0.10);
    background:
      linear-gradient(145deg, rgba(124, 92, 255, 0.025), transparent 60%),
      var(--surface);
  }

  /* Les icônes de titres ont un peu plus de présence. */
  .heading-with-icon .ui-icon {
    color: var(--primary-strong);
  }
}

/* ------------------------------------------------------
   MOBILE : supprimer les trois cases vides signalées
   ------------------------------------------------------ */

@media (max-width: 760px) {
  /* Dashboard : après la carte principale, CA + Stock puis Ventes pleine largeur. */
  #dashboard-page .dashboard-stats .card:nth-child(4) {
    grid-column: 1 / -1;
    min-height: 82px;
  }

  #dashboard-page .dashboard-stats .card:nth-child(4) p {
    font-size: 24px;
  }

  /* Trésorerie : "Mis de côté" prend toute la dernière ligne. */
  #treasury-page .treasury-savings-card {
    grid-column: 1 / -1;
    min-height: 92px !important;
  }

  #treasury-page .treasury-savings-card > p {
    display: block !important;
    max-width: 280px;
    margin-top: 7px;
    color: #7f8797;
    font-size: 10px;
  }

  /* Bitcoin : "Performance" prend toute la dernière ligne. */
  #bitcoin-page .bitcoin-cards > .bitcoin-card:last-child {
    grid-column: 1 / -1;
    min-height: 90px;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "head value"
      "profit value";
    align-items: center;
    column-gap: 16px;
  }

  #bitcoin-page .bitcoin-cards > .bitcoin-card:last-child .bitcoin-card-head {
    grid-area: head;
    margin-bottom: 2px;
  }

  #bitcoin-page .bitcoin-cards > .bitcoin-card:last-child > strong {
    grid-area: value;
    font-size: 22px !important;
    text-align: right;
  }

  #bitcoin-page .bitcoin-cards > .bitcoin-card:last-child > p {
    grid-area: profit;
    display: block !important;
    margin: 0;
    font-size: 11px;
    text-align: left;
  }
}


/* ======================================================
   V24 — WORDMARK SELLIVO MOBILE
   ====================================================== */

@media (max-width: 760px) {
  .mobile-wordmark {
    position: relative;
    display: inline-block;
    padding: 1px 2px 3px;
    font-family: "Segoe Print", "Comic Sans MS", cursive;
    font-size: 21px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -1.35px;
    transform: rotate(-1deg);
    color: #f4f3f8;
    text-rendering: geometricPrecision;
    -webkit-font-smoothing: antialiased;
  }

  .mobile-wordmark::after {
    content: "";
    position: absolute;
    left: 9%;
    right: 8%;
    bottom: -2px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(
      90deg,
      transparent,
      rgba(124, 92, 255, 0.72),
      rgba(166, 126, 255, 0.48),
      transparent
    );
    opacity: 0.72;
  }
}


/* ======================================================
   V25 — IDENTITÉ SELLIVO + COULEURS DES CARTES PC
   ====================================================== */

/* ------------------------------------------------------
   WORDMARK SELLIVO — plus lisible sur PC et mobile
   ------------------------------------------------------ */

.sellivo-wordmark h1,
.mobile-wordmark {
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", "Segoe UI", sans-serif;
  font-weight: 800;
  letter-spacing: -1.1px;
  color: #f4f3f8;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

.sellivo-wordmark h1 {
  font-size: 27px;
  line-height: 1;
}

.sellivo-wordmark > span {
  margin-top: 7px;
}

/* Remplace le rendu manuscrit de la V24 par quelque chose de plus net. */
@media (max-width: 760px) {
  .mobile-wordmark {
    position: relative;
    padding: 0 3px 3px;
    font-size: 24px;
    line-height: 1;
    letter-spacing: -1.25px;
    transform: none;
  }

  .mobile-wordmark::after {
    content: "";
    position: absolute;
    left: 12%;
    right: 11%;
    bottom: -3px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(
      90deg,
      transparent,
      rgba(124, 92, 255, 0.72),
      rgba(166, 126, 255, 0.42),
      transparent
    );
    opacity: 0.62;
  }
}

/* ------------------------------------------------------
   PC — COULEURS LÉGÈRES SUR LES CARTES DU HAUT
   ------------------------------------------------------ */

@media (min-width: 761px) {
  /* Base commune */
  #dashboard-page .dashboard-stats .card,
  #articles-page .stock-summary-card,
  #statistics-page .stats .card,
  #treasury-page .treasury-card,
  #objectives-page .objective-card,
  #bitcoin-page .bitcoin-card {
    position: relative;
    overflow: hidden;
    transition:
      border-color 0.18s ease,
      transform 0.18s ease,
      background 0.18s ease;
  }

  #dashboard-page .dashboard-stats .card:hover,
  #articles-page .stock-summary-card:hover,
  #statistics-page .stats .card:hover,
  #treasury-page .treasury-card:hover,
  #objectives-page .objective-card:hover,
  #bitcoin-page .bitcoin-card:hover {
    transform: translateY(-1px);
  }

  /* -------- Dashboard -------- */
  #dashboard-page .dashboard-stats .card:nth-child(1) {
    border-color: rgba(124, 92, 255, 0.22);
    background: linear-gradient(135deg, rgba(124, 92, 255, 0.095), transparent 68%), var(--surface);
  }

  #dashboard-page .dashboard-stats .card:nth-child(2) {
    border-color: rgba(89, 201, 165, 0.18);
    background: linear-gradient(135deg, rgba(89, 201, 165, 0.065), transparent 68%), var(--surface);
  }

  #dashboard-page .dashboard-stats .card:nth-child(3) {
    border-color: rgba(83, 157, 255, 0.18);
    background: linear-gradient(135deg, rgba(83, 157, 255, 0.06), transparent 68%), var(--surface);
  }

  #dashboard-page .dashboard-stats .card:nth-child(4) {
    border-color: rgba(255, 190, 92, 0.17);
    background: linear-gradient(135deg, rgba(255, 190, 92, 0.055), transparent 68%), var(--surface);
  }

  #dashboard-page .dashboard-stats .card:nth-child(5) {
    border-color: rgba(241, 114, 157, 0.16);
    background: linear-gradient(135deg, rgba(241, 114, 157, 0.05), transparent 68%), var(--surface);
  }

  #dashboard-page .dashboard-stats .card:nth-child(6) {
    border-color: rgba(162, 120, 255, 0.16);
    background: linear-gradient(135deg, rgba(162, 120, 255, 0.05), transparent 68%), var(--surface);
  }

  /* -------- Articles -------- */
  #articles-page .stock-summary-card:nth-child(1) {
    border-color: rgba(83, 157, 255, 0.19);
    background: linear-gradient(135deg, rgba(83, 157, 255, 0.07), transparent 70%), var(--surface);
  }

  #articles-page .stock-summary-card:nth-child(2) {
    border-color: rgba(89, 201, 165, 0.19);
    background: linear-gradient(135deg, rgba(89, 201, 165, 0.07), transparent 70%), var(--surface);
  }

  #articles-page .stock-summary-card:nth-child(3) {
    border-color: rgba(255, 190, 92, 0.20);
    background: linear-gradient(135deg, rgba(255, 190, 92, 0.075), transparent 70%), var(--surface);
  }

  /* -------- Statistiques -------- */
  #statistics-page .stats .card:nth-child(1) {
    border-color: rgba(83, 157, 255, 0.18);
    background: linear-gradient(135deg, rgba(83, 157, 255, 0.06), transparent 70%), var(--surface);
  }

  #statistics-page .stats .card:nth-child(2) {
    border-color: rgba(89, 201, 165, 0.19);
    background: linear-gradient(135deg, rgba(89, 201, 165, 0.07), transparent 70%), var(--surface);
  }

  #statistics-page .stats .card:nth-child(3) {
    border-color: rgba(255, 190, 92, 0.17);
    background: linear-gradient(135deg, rgba(255, 190, 92, 0.055), transparent 70%), var(--surface);
  }

  #statistics-page .stats .card:nth-child(4) {
    border-color: rgba(241, 114, 157, 0.15);
    background: linear-gradient(135deg, rgba(241, 114, 157, 0.05), transparent 70%), var(--surface);
  }

  #statistics-page .stats .card:nth-child(5) {
    border-color: rgba(124, 92, 255, 0.18);
    background: linear-gradient(135deg, rgba(124, 92, 255, 0.065), transparent 70%), var(--surface);
  }

  #statistics-page .stats .card:nth-child(6) {
    border-color: rgba(80, 190, 190, 0.16);
    background: linear-gradient(135deg, rgba(80, 190, 190, 0.05), transparent 70%), var(--surface);
  }

  /* -------- Trésorerie -------- */
  #treasury-page .treasury-card:nth-child(1) {
    border-color: rgba(89, 201, 165, 0.21);
    background: linear-gradient(135deg, rgba(89, 201, 165, 0.08), transparent 70%), var(--surface);
  }

  #treasury-page .treasury-card:nth-child(2) {
    border-color: rgba(83, 157, 255, 0.17);
    background: linear-gradient(135deg, rgba(83, 157, 255, 0.055), transparent 70%), var(--surface);
  }

  #treasury-page .treasury-card:nth-child(3) {
    border-color: rgba(255, 190, 92, 0.17);
    background: linear-gradient(135deg, rgba(255, 190, 92, 0.055), transparent 70%), var(--surface);
  }

  #treasury-page .treasury-card:nth-child(4) {
    border-color: rgba(124, 92, 255, 0.18);
    background: linear-gradient(135deg, rgba(124, 92, 255, 0.065), transparent 70%), var(--surface);
  }

  /* -------- Objectifs -------- */
  #objectives-page .objective-card:nth-child(1) {
    border-color: rgba(89, 201, 165, 0.18);
    background: linear-gradient(135deg, rgba(89, 201, 165, 0.06), transparent 70%), var(--surface);
  }

  #objectives-page .objective-card:nth-child(2) {
    border-color: rgba(83, 157, 255, 0.18);
    background: linear-gradient(135deg, rgba(83, 157, 255, 0.06), transparent 70%), var(--surface);
  }

  #objectives-page .objective-card:nth-child(3) {
    border-color: rgba(124, 92, 255, 0.19);
    background: linear-gradient(135deg, rgba(124, 92, 255, 0.065), transparent 70%), var(--surface);
  }

  /* -------- Bitcoin -------- */
  #bitcoin-page .bitcoin-card:nth-child(1) {
    border-color: rgba(247, 147, 26, 0.22);
    background: linear-gradient(135deg, rgba(247, 147, 26, 0.085), transparent 70%), var(--surface);
  }

  #bitcoin-page .bitcoin-card:nth-child(2) {
    border-color: rgba(83, 157, 255, 0.16);
    background: linear-gradient(135deg, rgba(83, 157, 255, 0.05), transparent 70%), var(--surface);
  }

  #bitcoin-page .bitcoin-card:nth-child(3) {
    border-color: rgba(89, 201, 165, 0.17);
    background: linear-gradient(135deg, rgba(89, 201, 165, 0.055), transparent 70%), var(--surface);
  }

  #bitcoin-page .bitcoin-card:nth-child(4) {
    border-color: rgba(124, 92, 255, 0.17);
    background: linear-gradient(135deg, rgba(124, 92, 255, 0.055), transparent 70%), var(--surface);
  }
}




/* ======================================================
   V31 — CONNEXION / CRÉATION DE COMPTE
   ====================================================== */
.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 24px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 50% 0%, rgba(124, 92, 255, 0.16), transparent 34%),
    #090b10;
}
.auth-screen.hidden { display: none !important; }
.auth-shell { width: min(100%, 430px); }
.auth-brand { text-align: center; margin-bottom: 24px; }
.auth-brand-name {
  font-size: 2.35rem;
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 1;
}
.auth-brand-name::after {
  content: "";
  display: block;
  width: 44px;
  height: 3px;
  margin: 10px auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(139,92,246,.35), rgba(139,92,246,.95), rgba(139,92,246,.35));
}
.auth-brand p { margin: 9px 0 0; color: #858b99; font-size: .9rem; }
.auth-card {
  padding: 28px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 22px;
  background: rgba(18,21,29,.96);
  box-shadow: 0 24px 70px rgba(0,0,0,.38);
}
.auth-heading { margin-bottom: 22px; }
.auth-kicker, .settings-label {
  color: #9c82ff;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .12em;
}
.auth-heading h1 { margin: 6px 0 7px; font-size: 1.65rem; letter-spacing: -.03em; }
.auth-heading p, .account-settings-card p { margin: 0; color: #9298a6; line-height: 1.5; }
.auth-form { display: grid; gap: 16px; }
.auth-form label { display: grid; gap: 8px; color: #d9dce4; font-size: .82rem; font-weight: 650; }
.auth-form input {
  width: 100%;
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 12px;
  outline: none;
  background: #0e1118;
  color: #f5f6f8;
  font: inherit;
}
.auth-form input:focus { border-color: rgba(139,92,246,.75); box-shadow: 0 0 0 3px rgba(139,92,246,.10); }
.auth-password-wrap { position: relative; }
.auth-password-wrap input { padding-right: 76px; }
.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #9c82ff;
  font-size: .72rem;
  font-weight: 750;
  cursor: pointer;
}
.auth-primary {
  min-height: 49px;
  margin-top: 2px;
  border: 0;
  border-radius: 12px;
  background: #7c5cff;
  color: white;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}
.auth-primary:disabled { opacity: .58; cursor: wait; }
.auth-switch { margin: 20px 0 0; text-align: center; color: #8d93a1; font-size: .82rem; }
.auth-switch button, .auth-back { border: 0; background: transparent; color: #a28cff; font: inherit; font-weight: 700; cursor: pointer; }
.auth-back { padding: 0; margin-bottom: 18px; }
.auth-message { min-height: 18px; margin: -5px 0 0; font-size: .78rem; }
.auth-error { color: #ff7777; }
.auth-security { margin: 16px 0 0; text-align: center; color: #656b78; font-size: .72rem; }
.account-settings-card { margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.account-settings-card h3 { margin: 5px 0 4px; }
.danger-outline-button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(255,100,100,.28);
  border-radius: 10px;
  background: rgba(255,100,100,.06);
  color: #ff8585;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
@media (max-width: 600px) {
  .auth-screen { place-items: start center; padding: 42px 18px 24px; }
  .auth-brand { margin-bottom: 20px; }
  .auth-card { padding: 22px 18px; border-radius: 18px; }
  .account-settings-card { align-items: stretch; flex-direction: column; }
}


/* ======================================================
   V32 — COMPTE & BIENVENUE
   ====================================================== */
.welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 11000;
  display: grid;
  place-items: center;
  background: #0b0d13;
  opacity: 1;
  transition: opacity .5s ease, visibility .5s ease;
}
.welcome-overlay.hidden { display: none !important; }
.welcome-overlay.welcome-leaving {
  opacity: 0;
  visibility: hidden;
}
.welcome-content {
  display: grid;
  justify-items: center;
  gap: 5px;
  animation: welcome-rise .55s cubic-bezier(.2,.75,.3,1);
}
.welcome-content span {
  color: #8b91a0;
  font-size: 1rem;
}
.welcome-content strong {
  position: relative;
  padding-bottom: 11px;
  font-size: clamp(2rem, 7vw, 3.3rem);
  line-height: 1;
  letter-spacing: -.055em;
}
.welcome-content strong::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 0;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #7c5cff, transparent);
}
@keyframes welcome-rise {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: none; }
}

.settings-account-panel {
  margin-top: 18px;
  padding: 22px;
}
.settings-account-heading {
  align-items: center;
}
.settings-account-heading #account-first-name {
  margin: 5px 0 3px;
}
.settings-account-heading #account-email {
  margin: 0;
  color: var(--muted);
}
.settings-account-divider {
  height: 1px;
  margin: 22px 0;
  background: var(--border);
}
.settings-password-section {
  display: grid;
  grid-template-columns: minmax(190px, .65fr) minmax(320px, 1.35fr);
  gap: 28px;
  align-items: start;
}
.settings-password-section > div > h3 {
  margin: 0 0 6px;
}
.settings-password-section > div > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}
.settings-password-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.settings-password-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}
.settings-password-form input {
  width: 100%;
  min-width: 0;
}
.settings-password-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 4px;
}
.auth-success { color: #65d6a5; }
.settings-password-actions .auth-message {
  flex: 1;
  min-height: 0;
  margin: 0;
}
.danger-outline-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
@media (max-width: 760px) {
  .settings-account-panel { padding: 17px; }
  .settings-account-heading {
    display: grid;
    gap: 15px;
  }
  .settings-account-heading .danger-outline-button {
    width: 100%;
  }
  .settings-password-section {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .settings-password-form {
    grid-template-columns: 1fr;
  }
  .settings-password-actions {
    display: grid;
    gap: 8px;
  }
  .settings-password-actions .primary-button {
    width: 100%;
  }
}


/* ======================================================
   V33 — CORRECTIONS COMPTE / RESPONSIVE
   ====================================================== */
.settings-account-panel,
.settings-account-panel * {
  box-sizing: border-box;
}
.settings-account-panel {
  min-width: 0;
  overflow: hidden;
}
.settings-account-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
}
.settings-account-heading > div {
  min-width: 0;
}
.settings-account-heading #account-email {
  overflow-wrap: anywhere;
}
.settings-password-section {
  grid-template-columns: minmax(210px, .55fr) minmax(0, 1.45fr);
}
.settings-password-form {
  min-width: 0;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
}
.settings-password-form label,
.settings-password-form input {
  min-width: 0;
  max-width: 100%;
}
.settings-password-actions {
  min-width: 0;
}
.settings-password-actions .primary-button {
  max-width: 100%;
  white-space: normal;
}
@media (max-width: 1180px) {
  .settings-password-section {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 900px) {
  .settings-password-form {
    grid-template-columns: 1fr;
  }
  .settings-password-actions {
    justify-items: stretch;
  }
  .settings-password-actions .primary-button {
    width: 100%;
  }
}


/* ======================================================
   V34 — PARAMÈTRES COMPTE REFAITS
   ====================================================== */

.settings-account-panel {
  min-width: 0;
  overflow: hidden;
  padding: 24px;
}

.settings-account-profile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-width: 0;
}

.settings-account-identity {
  min-width: 0;
}

.settings-account-identity h3 {
  margin: 5px 0 4px;
  font-size: 24px;
}

.settings-account-identity p {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.settings-account-profile .danger-outline-button {
  flex: 0 0 auto;
  max-width: 100%;
}

.settings-account-divider {
  width: 100%;
  height: 1px;
  margin: 24px 0;
  background: var(--border);
}

.settings-password-block {
  min-width: 0;
}

.settings-password-intro {
  margin-bottom: 18px;
}

.settings-password-intro h3 {
  margin: 0 0 5px;
  font-size: 20px;
}

.settings-password-intro p {
  margin: 0;
  color: var(--muted);
}

.settings-password-form {
  display: block !important;
  width: 100%;
  min-width: 0;
}

.settings-password-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.settings-password-fields label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.settings-password-fields input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.settings-password-actions {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-width: 0;
  margin-top: 14px;
}

.settings-password-actions .auth-message {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.settings-password-actions .primary-button {
  flex: 0 0 auto;
  width: auto !important;
  max-width: 100%;
  white-space: normal;
}

@media (max-width: 1050px) {
  .settings-password-fields {
    grid-template-columns: 1fr 1fr;
  }

  .settings-password-fields label:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .settings-account-panel {
    padding: 17px;
  }

  .settings-account-profile {
    align-items: stretch;
    flex-direction: column;
    gap: 15px;
  }

  .settings-account-profile .danger-outline-button {
    width: 100%;
  }

  .settings-password-fields {
    grid-template-columns: 1fr;
  }

  .settings-password-fields label:last-child {
    grid-column: auto;
  }

  .settings-password-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-password-actions .primary-button {
    width: 100% !important;
  }
}


/* V36 — espace net sous le bloc Compte Sellivo */
.settings-account-panel {
  margin-bottom: 32px !important;
}

.settings-account-panel + * {
  margin-top: 0 !important;
}

@media (max-width: 700px) {
  .settings-account-panel {
    margin-bottom: 24px !important;
  }
}


/* ======================================================
   V37 — ÉTAT DE SYNCHRONISATION
   ====================================================== */
.settings-sync-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.sync-status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #8b91a0;
}

.sync-status-dot[data-state="ok"] {
  background: #54d39a;
  box-shadow: 0 0 0 3px rgba(84, 211, 154, .08);
}

.sync-status-dot[data-state="syncing"] {
  background: #9c82ff;
  animation: sellivo-sync-pulse 1.1s ease-in-out infinite;
}

.sync-status-dot[data-state="error"] {
  background: #ff8a72;
}

@keyframes sellivo-sync-pulse {
  0%, 100% { opacity: .45; }
  50% { opacity: 1; }
}


/* ======================================================
   V38 — DÉMARRAGE SANS FLASH DE CONNEXION
   ====================================================== */
.session-loader {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  background: #090b10;
  opacity: 1;
  visibility: visible;
  transition: opacity .22s ease, visibility .22s ease;
}

.session-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.session-loader-brand {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -.05em;
  color: #f3f4f7;
}

.session-loader-brand::after {
  content: "";
  display: block;
  width: 34px;
  height: 2px;
  margin: 8px auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #7c5cff, transparent);
}


/* ======================================================
   V40 FINAL — IDENTITÉ VISUELLE OFFICIELLE SELLIVO
   ====================================================== */
.sellivo-logo {
  gap: 10px;
}

.sellivo-brand-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: block;
  border-radius: 11px;
  object-fit: cover;
  box-shadow: 0 0 22px rgba(124, 92, 255, .10);
}

.session-loader-identity {
  display: grid;
  justify-items: center;
  gap: 11px;
}

.session-loader-icon {
  width: 54px;
  height: 54px;
  border-radius: 15px;
  object-fit: cover;
  box-shadow: 0 0 28px rgba(124, 92, 255, .16);
}

/* Le header mobile conserve volontairement le wordmark seul :
   l'icône officielle est surtout utilisée par la PWA / écran d'accueil. */
@media (max-width: 760px) {
  .sellivo-brand-icon {
    display: none;
  }
}


/* ======================================================
   V41 FINAL — WORDMARK SITE ALIGNÉ SUR L'APP
   ====================================================== */
.sellivo-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sellivo-brand-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: block;
  object-fit: contain;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.sellivo-wordmark-app {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 0;
  padding-bottom: 8px;
}

.sellivo-wordmark-app h1 {
  margin: 0;
  font-family: Inter, "SF Pro Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 30px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.055em;
  color: #f5f5f7;
}

.sellivo-wordmark-app::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 62px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(124, 92, 255, .08),
    rgba(124, 92, 255, .85),
    rgba(124, 92, 255, .08)
  );
  box-shadow: 0 0 16px rgba(124, 92, 255, .14);
}

@media (max-width: 760px) {
  .sellivo-brand-icon {
    display: none;
  }

  .sellivo-wordmark-app {
    padding-bottom: 7px;
  }

  .sellivo-wordmark-app h1 {
    font-size: 28px;
  }

  .sellivo-wordmark-app::after {
    width: 58px;
  }
}


/* ======================================================
   V42 FINAL — LOGO OFFICIEL UNIFIÉ
   ====================================================== */
.sellivo-brand-icon {
  border-radius: 12px !important;
  object-fit: cover !important;
  background: #0b0b13 !important;
  box-shadow:
    0 0 0 1px rgba(124, 92, 255, .14),
    0 0 18px rgba(124, 92, 255, .08) !important;
}

.session-loader-icon {
  border-radius: 16px !important;
  object-fit: cover !important;
  background: #0b0b13 !important;
}


/* ======================================================
   V43 FINAL — LOGO PARFAITEMENT CENTRÉ
   ====================================================== */
.sellivo-logo {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 12px !important;
}

.sellivo-brand-icon {
  display: block !important;
  width: 48px !important;
  height: 48px !important;
  flex: 0 0 48px !important;
  margin: 0 !important;
  padding: 0 !important;
  object-fit: contain !important;
  object-position: 50% 50% !important;
  border-radius: 13px !important;
  background: transparent !important;
  transform: none !important;
}

.sellivo-wordmark-app {
  display: flex !important;
  align-items: center !important;
  margin: 0 !important;
}

.sellivo-wordmark-app h1 {
  margin: 0 !important;
}

.session-loader-icon {
  object-fit: contain !important;
  object-position: 50% 50% !important;
  transform: none !important;
}

/* Sur mobile on garde le choix précédent : wordmark seul dans l'interface.
   L'icône installée PWA utilise bien le nouveau logo centré. */
@media (max-width: 760px) {
  .sellivo-brand-icon {
    display: none !important;
  }
}


/* Sellivo 1.1 Preview — provenance */
#article-source {
  width: 100%;
}
