/* === Variables globales (thème Apple Wallet) === */
:root {
  --bg-main: #f5f5f7;
  --text-main: #1d1d1f;
  --accent: #007aff;
  --bg-card: #ffffff;
  --shadow-light: rgba(0,0,0,0.05);
  --radius-lg: 20px;
  --radius-md: 12px;
  --padding-lg: 2rem;
  --padding-md: 1rem;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* === Reset & Base === */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-sans); background-color: var(--bg-main); color: var(--text-main); line-height: 1.6; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; }

/* === Layout Utilities === */
.container { width: 100%; max-width: 1024px; margin: 0 auto; padding: 0 var(--padding-md); }
.flex { display: flex; }
.grid { display: grid; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }

/* === Cards === */
.card,
.stats-cards .card,
.dashboard-graph,
.dashboard-chart {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: 0 5px 20px var(--shadow-light);
  padding: var(--padding-md);
}

/* === Header === */
.prestibank-header {
  background: var(--bg-card);
  border-bottom: 1px solid #e0e0e0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 6px var(--shadow-light);
  padding: 0.8rem var(--padding-md);
}
.header-content { display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 1.5rem; font-weight: 700; color: var(--accent); }
.nav-links { display: flex; align-items: center; }
.nav-links a { margin-left: 1rem; padding: 0.5rem 1rem; border-radius: var(--radius-md); font-weight: 500; color: var(--text-main); transition: background 0.3s; }
.nav-links a:hover { background: #f1f1f1; color: var(--accent); }
.logout { color: #d93025; font-weight: 600; }
.nav-toggle, .nav-close { display: none; }

/* === Forms & Buttons === */
/* Constrain form width for better aesthetics */
.login-form, .add-form, .edit-form {
  max-width: 480px;
  margin: 0 auto;
}

.login-form input,
.login-form select,
.login-form textarea,
.add-form input,
.add-form select,
.add-form textarea,
.edit-form input,
.edit-form select,
.edit-form textarea {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid #ccc;
  border-radius: var(--radius-md);
  font-size: 1rem;
  background: #fafafa;
  transition: border-color 0.2s;
}
.login-form input:focus,
.login-form select:focus,
.login-form textarea:focus {
  border-color: var(--accent);
  background: #fff;
  outline: none;
}
.login-btn,
.add-btn,
.edit-btn {
  display: block;
  width: 100%;
  padding: 0.9rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
  margin-right: 1rem;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: bold;
  text-align: center;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.3s;
}
.login-btn:hover,
.add-btn:hover,
.edit-btn:hover { background: #005bb5; }
.login-link a, .form-link a { color: var(--accent); font-weight: 500; }

/* === Dashboard === */
.dashboard-container { padding: var(--padding-lg) var(--padding-md); }
.dashboard-title { font-size: 1.8rem; margin-bottom: var(--padding-md); }
.stats-cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); margin-bottom: 2rem; }
.card-label { font-size: 0.9rem; color: #999;}
.card-value { font-size: 1.6rem; font-weight: bold; color: var(--accent); }
.dashboard-chart { margin-bottom: 2rem; }

/* === Tables === */
table { width: 100%; border-collapse: collapse; border-radius: var(--radius-md); overflow: hidden; }
thead { background: #f5f5f7; }
th, td { padding: 0.75rem 1rem; border-bottom: 1px solid #e0e0e0; }
th { font-weight: 600; }
@media (max-width: 600px) {
  table, thead, tbody, th, td, tr { display: block; }
  thead tr { position: absolute; top: -9999px; left: -9999px; }
  tr { margin-bottom: 1rem; }
  td { padding-left: 50%; position: relative; }
  td::before { content: attr(data-label); position: absolute; left: 1rem; font-weight: 600; }
}

/* === Responsive Header & Nav Slide === */
@media (max-width: 768px) {
  .nav-toggle { display: block; background:none; border:none; font-size:1.8rem; cursor:pointer; }
  .nav-links { position: fixed; top:0; right:0; height:100vh; width:80%; max-width:300px; background: var(--bg-card); flex-direction: column; padding: 1rem; transform: translateX(100%); transition: transform 0.3s ease-in-out; box-shadow: -2px 0 8px var(--shadow-light); z-index: 200; }
  .nav-links.open { transform: translateX(0); }
  .nav-close { display:block; background:none; border:none; font-size:1.5rem; align-self:flex-end; cursor:pointer; margin-bottom:1rem; }
  .nav-links a { margin:0.5rem 0; padding:0.5rem; border-radius: var(--radius-md); }
}

/* === Media Queries for Large Screens === */
@media (min-width: 1200px) {
  .dashboard-container { padding: var(--padding-lg) 2rem; }
  .stats-cards { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
}

/* === Adjustments for Very Small Devices === */
@media (max-width: 360px) {
  .card, .add-form, .login-form, .edit-form { padding: 1rem; }
  .login-title, .dashboard-title { font-size: 1.3rem; }
  .login-form input, .login-form select, .login-form textarea { font-size: 0.9rem; }
}

/* == Card action icons == */
.card-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

/* Make the <a> and <button> wrappers for the SVG icons visible */
.edit-icon,
.delete-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;    /* ~36px */
  height: 2.25rem;
  background: var(--bg-card);
  border-radius: 50%;
  border: 1px solid #ddd;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  color: var(--text-main);
  text-decoration: none;
}

/* Size the SVG inside */
.edit-icon svg,
.delete-icon svg {
  width: 1.25rem;   /* ~20px */
  height: 1.25rem;
  stroke-width: 2;
}

/* Hover states */
.edit-icon:hover,
.delete-icon:hover {
  background: #f1f1f1;
  border-color: var(--accent);
  color: var(--accent);
}

/* If you want the delete to be red on hover */
.delete-icon:hover {
  color: #d93025;
  border-color: #d93025;
}



/* --- Pour toutes les tailles — */
td.description {
  max-width: 200px;            /* Ajuste selon ton besoin */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Masquer totalement la colonne “Description” sur mobile < 600px */
@media (max-width: 600px) {
  th.description,
  td.description {
    display: none;
  }
  /* On peut indiquer visuellement qu’il y a plus à lire */
  td.actions::before {
    content: "…";
    margin-right: 0.25rem;
    color: #999;
  }
}







.mobile-list { display: none; }

@media (max-width: 600px) {
  .desktop-table { display: none; }
  .mobile-list  { display: block; }

  .mobile-list details {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: 0 5px 20px var(--shadow-light);
    margin-bottom: var(--padding-md);
    padding: var(--padding-md);
  }
  .mobile-list summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
  }
  .mobile-list summary::-webkit-details-marker { display: none; }
  .mobile-list .details-content {
    margin-top: 0.75rem;
    border-top: 1px solid #e0e0e0;
    padding-top: 0.75rem;
  }
  .mobile-list .details-content p { margin: 0.5rem 0; }
  .mobile-list .tx-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 0.5rem;
  }
}




.mobile-list { display: none; }
@media (max-width: 600px) {
  .desktop-table { display: none; }
  .mobile-list  { display: block; }

  .mobile-list details {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: 0 5px 20px var(--shadow-light);
    margin-bottom: var(--padding-md);
    padding: var(--padding-md);
  }
  .mobile-list summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
  }
  .mobile-list summary::-webkit-details-marker { display: none; }
  .mobile-list .details-content {
    margin-top: 0.75rem;
    border-top: 1px solid #e0e0e0;
    padding-top: 0.75rem;
  }
  .mobile-list .details-content p { margin: 0.5rem 0; }
}



/* === Overrides Mobile (<600px) pour login-box & champs === */
@media (max-width: 600px) {
  /* Retirer l’ombre trop marquée autour de la card */
  .login-box {
    box-shadow: none;
    margin: var(--padding-md);
  }

  /* Champ plein largeur, fond blanc, bord fin et angles arrondis */
  .login-form input,
  .login-form select,
  .login-form textarea {
    background-color: var(--bg-card) !important;
    box-shadow: inset 0 0 0 1px #ccc !important;
    border-radius: var(--radius-md) !important;
    border: none !important;
  }

  /* Le bouton plein écran colle aux bords */
  .login-btn {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}





/* === Transfer page overrides === */
.card {
  /* votre .card existante donne déjà la card, on ajuste juste la largeur max mobile/desktop */

  margin: 0 auto;
}

/* Champ plein écran, fond blanc, bord fin et angles arrondis */
.login-form input,
.login-form select,
.login-form textarea {
  background-color: var(--bg-card);
  box-shadow: inset 0 0 0 1px #ccc;
  border-radius: var(--radius-md);
  border: none;
}

/* Retina du bouton */
.login-btn {
  margin-left: 0;
  margin-right: 0;
}

/* Flash message centré et responsive */
.error-message,
.success-message {
  text-align: center;
  margin: var(--padding-md) 0;
}

/* === Mobile tweaks (<600px) === */
@media (max-width: 600px) {
  /* On enlève l’ombre de la card pour un rendu plus plat */
  .card {
    box-shadow: none;
    margin: var(--padding-md) 0;
  }

  /* On étend le formulaire en pleine largeur */
  .login-form {
    padding: 0 var(--padding-md);
  }

  /* On rend les champs bien alignés et plus compacts */
  .login-form label {
    margin-top: var(--padding-md);
    display: block;
    font-weight: 500;
  }
  .login-form input,
  .login-form select,
  .login-form textarea {
    width: 100%;
    padding: 0.8rem;
    margin-top: 0.25rem;
  }

  /* Bouton plein écran */
  .login-btn {
    width: 100%;
    margin-top: var(--padding-md);
  }

  /* Le lien de retour centré en dessous */
  .login-link {
    text-align: center;
    margin-top: var(--padding-md);
  }
}



