/* ===== STYLE BANQUE ROYALE ===== */

/* === Layout global === */
body {
  font-family: system-ui, sans-serif;
  margin: 0;
  background: #f8f6f0;
  color: #222;
  line-height: 1.5;
}

/* === Header / topbar === */
.header {
  background: #1E40AF;
  color: #fff;
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 8px rgba(0,0,0,0.25);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.header h1 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.header-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .9rem;
}
#clock {
  font-variant-numeric: tabular-nums;
  background: rgba(255,255,255,0.15);
  padding: 4px 8px;
  border-radius: 6px;
}
.logout {
  text-decoration: none;
  background: #ef4444;
  color: #fff;
  border-radius: 6px;
  padding: 6px 10px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.logout:hover { background:#dc2626; }

/* === Onglets === */
.tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  background: #f3f4f6;
  border-bottom: 1px solid #ddd;
  position: sticky;
  top: 52px;
  z-index: 900;
}
.tab {
  padding: 10px 12px;
  margin: 2px;
  border: none;
  background: #eaf1ff;
  cursor: pointer;
  border-radius: 8px;
  flex: 1;
  font-size: 0.95em;
  max-width: 180px;
}
.tab.active {
  background: #1E40AF;
  color: #fff;
  font-weight: 600;
}
.tab-content { display: none; padding: 16px; }
.tab-content.active { display: block; }

/* === Cartes et tableaux === */
.profile-card {
  background: #fff;
  border: 2px solid #d6c28f;
  border-radius: 10px;
  padding: 20px;
  margin-top: 20px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}
.table-container {
  overflow-x: auto;
  margin-top: 20px;
}
table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}
thead tr {
  background: #1E40AF;
  color: #fff;
  text-align: left;
}
th, td {
  padding: 10px 12px;
  font-size: .9rem;
  border-bottom: 1px solid #eee;
}
tbody tr:nth-child(even) { background: #fafafa; }

/* === Couleurs montants === */
.tx-green { color: green; font-weight: bold; }
.tx-red { color: red; font-weight: bold; }
.tx-gold { color: goldenrod; font-weight: bold; }

/* === Boutons === */
.btn {
  background: #1E40AF;
  color: #fff;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1em;
  text-decoration: none;
  display: inline-block;
  min-width: 110px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.btn:hover { background: #2a55d4; }

/* === Popup succès === */
.popup-success {
  position: fixed;
  top: 70px;
  right: 15px;
  background: #1E40AF;
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  opacity: 0;
  transform: translateY(-20px);
  transition: all .4s ease;
  z-index: 1000;
  font-weight: 600;
  font-size: 0.95em;
}
.popup-success.show { opacity: 1; transform: translateY(0); }

/* === Section Héros / Troupes / Capitaines === */
.hero-wrap {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}
.select-hero {
  min-width: 180px;
  padding: 6px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: .95rem;
}
.input-int {
  width: 90px;
  padding: 6px;
  border-radius: 6px;
  border: 1px solid #ccc;
  text-align: center;
  font-size: .95rem;
}
.hero-preview img {
  width: 90px;
  height: 90px;
  border: 3px solid #cfa53e;
  border-radius: 10px;
  object-fit: cover;
  background: #fff;
}

/* === Troupes === */
.troops-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
}
.troop-card {
  flex: 1 1 200px;
  border-radius: 10px;
  text-align: center;
  color: #fff;
  font-weight: bold;
  padding: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform .2s;
  min-width: 150px;
}
.troop-card:hover { transform: translateY(-3px); }
.troop-card select {
  width: 100%;
  padding: 8px;
  border: none;
  border-radius: 6px;
  margin-top: 8px;
  background: rgba(255,255,255,0.9);
  color: #000;
  font-size: 0.9rem;
}
.troop-G { background: linear-gradient(135deg,#f1c40f,#f39c12); }
.troop-S { background: linear-gradient(135deg,#3498db,#2e86de); }
.troop-E { background: linear-gradient(135deg,#27ae60,#1e8449); }
.troop-M { background: linear-gradient(135deg,#e74c3c,#c0392b); }

/* === Capitaines === */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 15px;
}
.cap-tile {
  text-align: center;
  padding: 10px;
  background: #fffaf0;
  border: 2px solid #d4b16a;
  border-radius: 10px;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.cap-tile.active {
  box-shadow: 0 0 8px 3px rgba(207,165,62,0.5);
  transform: scale(1.03);
}
.cap-tile img {
  width: 70px;
  height: 70px;
  border-radius: 6px;
  object-fit: cover;
  background:#fff;
  border:1px solid #d4b16a;
}
.cap-tile div {
  margin:6px 0;
  font-size:.8rem;
  font-weight:600;
}
.cap-tile .input-int {
  width:70px;
  font-size:.8rem;
}

/* === FORMULAIRES (Dépôt / Retrait / Virement) === */
.container-form {
  max-width: 420px;
  background: #fff;
  margin: 100px auto;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.container-form h1 {
  background: #1E40AF;
  color: #fff;
  padding: 15px;
  margin: -30px -30px 25px -30px;
  border-radius: 12px 12px 0 0;
  text-align: center;
}
.container-form form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.container-form input,
.container-form select {
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1em;
}
.container-form button {
  background: #1E40AF;
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}
.container-form button:hover { background: #0d2f8a; }
.links {
  text-align: center;
  margin-top: 15px;
}
.links a {
  color: #1E40AF;
  text-decoration: none;
  font-weight: 600;
}
.links a:hover { text-decoration: underline; }

/* === Responsive === */
@media (max-width: 900px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .header-info {
    width: 100%;
    justify-content: space-between;
  }
  .tab {
    font-size: 0.9em;
    padding: 8px;
    flex: 1 1 auto;
  }
  .profile-card {
    padding: 15px;
  }
}

@media (max-width: 600px) {
  body { font-size: 15px; }
  .header h1 { font-size: 1em; }
  table { font-size: 0.85em; min-width: unset; }
  th, td { padding: 8px 6px; }
  .hero-wrap { flex-direction: column; }
  .select-hero { width: 100%; }
  .input-int { width: 100%; max-width: 90px; }
  .btn { padding: 8px 12px; font-size: 0.9em; min-width: 90px; }
  .container-form {
    margin: 60px 15px;
    padding: 20px;
  }
  .container-form h1 { font-size: 1.1em; }
  .container-form input { font-size: 0.9em; }
}

@media (max-width: 400px) {
  .header { padding: 8px; }
  .header h1 { font-size: 0.9em; }
  #clock { padding: 2px 5px; }
  .btn { font-size: 0.8em; padding: 6px 10px; }
  table { font-size: 0.75em; }
  .container-form { margin: 40px 10px; }
}
/* --- Popups globales succès / erreur --- */
.popup-success, .popup-error {
  position: fixed;
  top: 70px;
  right: 15px;
  padding: 12px 20px;
  border-radius: 10px;
  color: #fff;
  font-weight: 600;
  font-size: 0.95em;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  opacity: 0;
  transform: translateY(-20px);
  transition: all .4s ease;
  z-index: 1000;
}
.popup-success { background: #1E40AF; }
.popup-error { background: #b91c1c; }
.popup-success.show, .popup-error.show {
  opacity: 1;
  transform: translateY(0);
}
/* === Conseiller (admin) === */
.btn.advisor-active {
  background-color: #dc2626; /* rouge */
  color: #fff;
}

.btn.advisor-inactive {
  background-color: #16a34a; /* vert */
  color: #fff;
}
