/* Traguer AI — portail community. Identité alignée sur la page de login. */
:root {
  --accent: #2f6bff;
  --accent-2: #18a7ff;
  --accent-hover: #1e5be0;
  --text: #1a2030;
  --muted: #8a93a6;
  --border: #e6eaf2;
  --bg: #f5f7fb;
  --card: #ffffff;
  --ok: #12a150;
  --warn: #e5844d;
  --error: #e5484d;
  --sidebar-w: 248px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14.5px;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout : sidebar + contenu ─────────────────────── */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  flex: none;
  background: var(--card);
  border-right: 1px solid var(--border);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
}
.sidebar-logo { display: flex; align-items: center; margin: 0 6px 26px; }
.sidebar-logo img { height: 34px; width: auto; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 9px;
  color: var(--text); font-weight: 500; font-size: 14px;
}
.nav a:hover { background: var(--bg); text-decoration: none; }
.nav a.active { background: #eef3ff; color: var(--accent); }
.nav a .ico { width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; opacity: .9; }

/* Icônes SVG inline : héritent de la couleur du texte, alignées à la ligne. */
.ic { display: inline-block; vertical-align: -0.18em; flex: none; }
.ic-text { display: inline-flex; align-items: center; gap: 7px; }
.sidebar-foot { margin-top: auto; padding: 12px 6px 0; border-top: 1px solid var(--border); }
.sidebar-user { font-size: 13px; color: var(--muted); }
.sidebar-user b { display: block; color: var(--text); font-weight: 600; margin-bottom: 2px; }

/* Sélecteur de langue */
.lang-switch { display: flex; gap: 6px; flex-wrap: wrap; }
.lang-switch a {
  font-size: 12px; color: var(--muted); padding: 3px 9px; border-radius: 20px;
  border: 1px solid var(--border);
}
.lang-switch a:hover { background: var(--bg); text-decoration: none; }
.lang-switch a.active { background: #eef3ff; color: var(--accent); border-color: #cdddff; }

.content { flex: 1; padding: 34px 40px; max-width: 900px; display: flex; flex-direction: column; }

/* Pied de page du portail (liens légaux) */
.portal-foot {
  margin-top: auto; padding-top: 28px;
  display: flex; gap: 16px; flex-wrap: wrap; align-items: center;
  font-size: 12.5px; color: var(--muted);
}
.portal-foot a { color: var(--muted); }
.portal-foot a:hover { color: var(--accent); }
.portal-foot-copy { margin-left: auto; }
[dir="rtl"] .portal-foot-copy { margin-left: 0; margin-right: auto; }
.page-title { font-size: 24px; font-weight: 700; margin: 0 0 4px; }
.page-sub { color: var(--muted); margin: 0 0 26px; }

/* ── Cartes ─────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
  margin-bottom: 18px;
}
.card h2 { font-size: 15px; margin: 0 0 14px; }

/* Solde de crédits (bloc vedette) */
.balance-card {
  background: linear-gradient(135deg, #eef5ff, #dfeaff);
  border: 1px solid #cdd9ff;
}
.balance-value { font-size: 40px; font-weight: 800; color: var(--accent); line-height: 1; }
.balance-label { color: var(--muted); font-size: 13.5px; margin-top: 6px; }

/* ── Boutons ────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 18px; border-radius: 10px; border: none;
  font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit;
  background: linear-gradient(90deg, var(--accent-2), var(--accent)); color: #fff;
  transition: filter .15s;
}
.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn-ghost { background: none; color: var(--accent); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg); filter: none; }
.btn-sm { padding: 8px 13px; font-size: 13px; }

/* ── Tableau (historique) ───────────────────────────── */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; color: var(--muted); font-weight: 600;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
}
.table td { padding: 11px 12px; border-bottom: 1px solid var(--border); }
.table tr:last-child td { border-bottom: none; }
.amount-pos { color: var(--ok); font-weight: 600; }
.amount-neg { color: var(--muted); }
.tx-type {
  display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; background: var(--bg); color: var(--muted);
}

/* ── Formulaires ────────────────────────────────────── */
label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
input[type="text"], input[type="email"], input[type="password"] {
  width: 100%; max-width: 340px; padding: 11px 13px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg); font-size: 14px;
  outline: none; font-family: inherit;
}
input:focus { border-color: var(--accent); background: #fff; }
.msg { margin-top: 14px; font-size: 13px; min-height: 18px; }
.msg.ok { color: var(--ok); }
.msg.error { color: var(--error); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* ── Page de connexion centrée ──────────────────────── */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 360px; background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 32px 28px; }
.auth-card .sidebar-logo { justify-content: flex-start; margin-bottom: 22px; }

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 760px) {
  .sidebar { position: fixed; z-index: 10; height: 100%; transform: translateX(-100%); transition: transform .2s; }
  .content { padding: 22px 18px; }
}

/* ── RTL (arabe, hébreu) ────────────────────────────── */
/* Le layout est en flex : l'ordre s'inverse tout seul. On corrige seulement
   les bordures directionnelles et l'alignement du texte. */
[dir="rtl"] .sidebar { border-right: none; border-left: 1px solid var(--border); }
[dir="rtl"] .table th, [dir="rtl"] .table td { text-align: right; }
[dir="rtl"] label { text-align: right; }
[dir="rtl"] .nav a { text-align: right; }
