:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0d10;
  --card: #11161b;
  --muted: #9fb3c8;
  --text: #e5e7eb;
  --accent: #4f46e5;
  --accent-2: #22c55e;
  --border: #1f2937;
  --header-bg: rgba(13,16,22,0.8);
  --input-bg: #0f131b;
  --link-color: #7aa2ff;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f8fafc;
  --card: #ffffff;
  --muted: #64748b;
  --text: #1e293b;
  --accent: #4f46e5;
  --accent-2: #22c55e;
  --border: #e2e8f0;
  --header-bg: rgba(255,255,255,0.8);
  --input-bg: #f1f5f9;
  --link-color: #3b82f6;
  .btn-danger {
    background-color: #ffb3ba;
  }
}

/* Par défaut, utiliser le thème sombre */
:root {
  color-scheme: light;
  --bg: #f8fafc;
  --card: #ffffff;
  --muted: #64748b;
  --text: #1e293b;
  --accent: #4f46e5;
  --accent-2: #22c55e;
  --border: #e2e8f0;
  --header-bg: rgba(255,255,255,0.8);
  --input-bg: #f1f5f9;
  --link-color: #3b82f6;
}


*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font:14px/1.5 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Helvetica Neue,Arial,Noto Sans;
  padding:24px
}
a{color:var(--link-color);text-decoration:none}
a:hover{text-decoration:underline}
h1 { text-align: center; }
.site-header{
  position:sticky; top:0; z-index:10;
  display:flex; align-items:center; justify-content:space-between;
  gap:16px; padding:12px 20px; border-bottom:1px solid var(--border);
  background:var(--header-bg); backdrop-filter: blur(8px);
}
.brand img{ height:50px; }
.brand .title{font-weight:700; letter-spacing:.3px}
.site-nav{display:flex; gap:8px; flex-wrap:wrap}
.nav-item{
  display:inline-flex; align-items:center; gap:6px; padding:8px 10px;
  border:1px solid var(--border); border-radius:8px; background:var(--card);
}
.nav-item.active{border-color:var(--accent); box-shadow:0 0 0 1px var(--accent) inset}
.nav-item .emoji{font-size:16px}
.site-main{max-width: 100%; margin:20px auto; padding:0 16px}
.card{background:var(--card); border:1px solid var(--border); border-radius:12px; padding:20px;margin:0 auto}
table{width:100%;border-collapse:collapse;margin-top:8px;}
.table th,.table td{padding:10px; border-bottom:1px solid var(--border); text-align:left; font-size:14px}
.table th{color:var(--muted); font-weight:600}
.table tr:last-child td {
  border: none;
}
.table .addr{font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace}
td img {
  max-height: 25px;
  vertical-align: middle;
  background: #FFF;
  border-radius: 20px;
  padding: 2px;
  margin-right: 3px;
}.grid{display:grid; gap:16px}
.grid.cols-2{grid-template-columns:1fr 1fr}
.grid.cols-3{grid-template-columns:repeat(3, 1fr)}
.notice{padding:10px 12px; border:1px solid var(--border); border-radius:8px; background:rgba(0,0,0,0.1)}
.notice.ok{border-color:var(--accent-2); background:rgba(34,197,94,0.1)}
.muted{color:var(--muted)}
.site-footer{color:var(--muted); padding:20px; border-top:1px solid var(--border); text-align:center; margin-top:40px}
button,.btn{
  background:var(--card); color:var(--text); border:1px solid var(--border);
  padding:8px 12px; border-radius:8px; cursor:pointer
}
button:hover,.btn:hover{border-color:var(--accent)}
.btn{padding:8px 12px;border-radius:8px;border:1px solid var(--border);background:var(--card);color:var(--text);text-decoration:none}
.btn[disabled]{opacity:.5;cursor:not-allowed}
.btn-danger {
  background-color: #dc3545;
  color: white;
}

.btn-danger:hover {
  background-color: #bd2130;
}

.btn-danger a:hover {
  text-decoration: none;
}

input,select{
  background:var(--input-bg); color:var(--text); border:1px solid var(--border); border-radius:8px; padding:8px;
}

.import-form {
  text-align: center;
  max-width: 800px;
}


.import-form input, .import-form select, .import-form button  {
  font-size: 25px;
  margin: 15px;
}


.import-form .tuto {
  text-align:left;
  margin-top: 40px;
}
.import-form .tuto img {
  width:100%;
}
h1{margin:0 0 12px;font-size:20px}
h1 img { vertical-align: middle; max-height: 60px; margin-right:10px;
  background: #FFF;
  border-radius: 40px;
  padding: 5px;
 }

.badge{display:block;padding:4px 8px;border-radius:6px;border:1px solid var(--border);background:var(--card);width: max-content;}

.pager{margin-top:12px;display:flex;gap:8px}

.bar{display:flex;gap:12px;align-items:center;justify-content:space-between;flex-wrap:wrap}
.meta{color:var(--muted);font-size:13px}

/* Styles pour le menu déroulant */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: var(--card);
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  z-index: 1;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.dropdown-content a {
  color: var(--text);
  padding: 12px 16px;
  text-decoration: none;
  display: block;
}

.dropdown-content a:hover {
  background-color: rgba(0,0,0,0.1);
}

.dropdown:hover .dropdown-content {
  display: block;
}

/* Styles pour le sélecteur de thème */
.theme-switch {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
}

.theme-switch:hover {
  border-color: var(--accent);
}

/* Style du sélecteur de thème */
.theme-switch {
  display: flex;
  align-items: center;
  margin-left: auto;
  margin-right: 16px;
}

.theme-switch-icon {
  font-size: 16px;
  margin-right: 6px;
}

/* Style pour l'en-tête de tableau fixe */
.transaction-table {
  position: relative;
}

.transaction-table thead {
  position: sticky;
  top: 0;
  z-index: 5;
  background-color: var(--card);
}

/* Optionnel : ajouter une ombre pour améliorer la visibilité */
.transaction-table thead::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--border);
}

.btn-danger:hover {
  text-decoration: none;
  border-color: #FFF;
}

/* Styles pour rendre le menu responsive */
/* Icône hamburger masquée par défaut */
.hamburger {
  display: none; /* Masquer le hamburger sur les grands écrans */
  background: none;
  border: none;
  cursor: pointer;
  font-size: 24px;
  color: var(--text);
}

.hamburger:hover {
  color: var(--accent);
}

.symbol_current_price {
  font-size:12px;
}

.portfolio-table-wrapper {
  width: 100%;
  overflow-x: auto;   /* Active le scroll horizontal */
  position: relative; /* important */
}

.portfolio-table-wrapper table {
  width: 100%;
  border-collapse: collapse;
}

.portfolio-table-wrapper table td {
  font-size: 12px;
  padding: 7px;
}

/* pour que l’en-tête reste visible au scroll vertical si tu le souhaites */
.portfolio-table-wrapper table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--bg);
}

.portfolio-table-wrapper table th:first-child,
.portfolio-table-wrapper table td:first-child {
  position: sticky;
  left: 0;
  background: var(--bg);       /* obligatoire pour masquer ce qu’il y a dessous */
  z-index: 2;             /* la colonne passe au-dessus des autres */
  white-space: nowrap;    /* optionnel */
}

.current_balances {
  width:500px; margin:0 20px; display:inline-block; vertical-align:top;
}
.intro_summary {
  width:500px; margin:0 20px; display:inline-block; vertical-align:top;
}

.card h2 {
  text-align: center;
}
.card .header {
  padding: 20px;
  border-bottom: #EEE 2px solid;
}
.card .header h1 {
  margin: 0;
  font-size: 1.8rem;
  color: #333;
}

/* Bloc Live Price */
.card .live-price {
  text-align: center;
  font-size: 1rem;
  color: #10b981;
}


.filter-form {
  margin-bottom: 20px;
  padding: 15px;
  border-radius: 5px;
}

.filter-container {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  min-width: 150px;
}

.filter-group label {
  margin-bottom: 5px;
  font-weight: bold;
}

.filter-group select,
.filter-group input {
  padding: 5px 10px;
  border: 1px solid #ced4da;
  border-radius: 4px;
}

/* Pour les petits écrans */
@media (max-width: 768px) {
  .hamburger {
    display: block; /* Afficher l'icône hamburger sur les petits écrans */
  }

  .site-nav {
    display: none; /* Masquer le menu par défaut sur mobile */
    flex-direction: column;
    position: absolute;
    top: 56px; /* Ajustez en fonction de la hauteur du header */
    left: 0;
    width: 100%;
    background: var(--header-bg);
    z-index: 100;
    border-top: 1px solid var(--border);
  }

  .site-nav.show {
    display: flex; /* Montrer le menu lors du clic sur l'icône hamburger */
  }

  .nav-item {
    padding: 12px 16px;
    border-radius: 0;
    border: none;
    text-align: center;
  }

  .nav-item:not(:last-child) {
    border-bottom: 1px solid var(--border);
  }


  body {
    padding: 0;
  }

  .brand img {
    height: 45px;
  }
  #themeSwitch {
    margin: auto;
    color: #777;
    font-size: 12px;
  }
  .site-main {
    padding: 0 10px;
    margin: 10px auto;
  }
  .card {
    padding: 10px;
  }
  #hideZeroForm {
    text-align: left;
    font-size: 12px;
    font-style: italic;
  }

  .current_balances {
    width:100%; margin:0; display:inline-block; vertical-align:top; font-size:12px;
  }
  .intro_summary {
    width:100%; margin:0; display:inline-block; vertical-align:top; font-size:12px;
  }

}





.prc_badge {
  display: inline-block;
  padding: 4px 7px;
  font-size: 10px;
  line-height: 1;
  text-align: center;
  vertical-align: baseline;
  border-radius: 14px;
  width: max-content;
}

.prc_badge_green {
  background: rgba(4, 170, 109, 0.2);
  color: #04aa6d;
}
.prc_badge_red {
  background: rgba(255, 0, 0, 0.2);
  color: #ff0000;
}


.prc_badge img {
  border-radius: unset;
  max-height: 14px;
  vertical-align: middle;
  margin-bottom: 2px;
  background:none;
}

.usd_quote {
  display: inline-block;
  background: #EEE;
  padding: 5px;
  border-radius: 5px;
  font-size: 10px;
  font-style: italic;
  font-weight: bold;
  color: #555;
  margin-top: 5px;
}

.amount {
  text-align:right!important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas;
  font-size: 12px!important;
}
/* Layout 2 cards responsive */
.cards-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
    align-items: center;
}

/* Mobile = 1 colonne */
@media (max-width: 768px) {
  .cards-2col {
    grid-template-columns: 1fr;
  }

  /* Le tableau du premier cadre doit wrapper */
  .card-left table {
    display: block;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
  }
}
