/* ===== TeamSuite (portail) — même charte que TeamWiki ===== */
:root {
  --bg:         #f6f7f9;
  --surface:    #ffffff;
  --surface-2:  #f4f5f8;
  --surface-3:  #eceef3;
  --border:     #e9eaf0;
  --border-2:   #dfe1ea;
  --text:       #1b1d24;
  --muted:      #71757f;
  --faint:      #9a9ea8;
  --primary:    #6366f1;
  --primary-d:  #4f46e5;
  --primary-soft: #eef0fe;
  --danger:     #ef4444;
  --radius:     12px;
  --radius-sm:  8px;
  --radius-xs:  6px;
  --shadow-sm:  0 1px 2px rgba(20,22,40,.05);
  --shadow:     0 1px 2px rgba(20,22,40,.04), 0 6px 20px rgba(20,22,40,.06);
  --shadow-lg:  0 12px 40px rgba(20,22,40,.16);
  --ring:       0 0 0 3px rgba(99,102,241,.18);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; color: var(--text); background: var(--bg); font-size: 14px;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
a { color: var(--primary-d); }

/* Boutons */
.btn {
  border: 1px solid var(--border-2); background: var(--surface); color: var(--text);
  padding: 8px 14px; border-radius: var(--radius-sm); cursor: pointer; font-size: 13px;
  font-weight: 500; font-family: inherit; text-decoration: none; display: inline-flex;
  align-items: center; justify-content: center; transition: background .14s, border-color .14s;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-d); border-color: var(--primary-d); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-block { width: 100%; padding: 11px; }

/* Connexion / définition du mot de passe */
.login-body {
  display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 16px;
  background: radial-gradient(1200px 600px at 50% -10%, #eef0ff 0%, var(--bg) 55%);
}
.login-card {
  background: var(--surface); padding: 40px 36px; border-radius: 18px; width: 380px; max-width: 100%;
  box-shadow: var(--shadow-lg); text-align: center; border: 1px solid var(--border);
}
.login-logo {
  width: 56px; height: 56px; margin: 0 auto 4px; border-radius: 16px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex; align-items: center; justify-content: center; font-size: 28px;
  box-shadow: 0 8px 20px rgba(99,102,241,.35);
}
.login-card h1 { margin: 14px 0 2px; font-size: 23px; font-weight: 700; letter-spacing: -.02em; }
.login-sub { color: var(--muted); margin: 0 0 24px; font-size: 13.5px; }
.login-card label { display: block; text-align: left; font-size: 12.5px; font-weight: 500; color: var(--muted); margin-bottom: 14px; }
.login-card input {
  width: 100%; margin-top: 6px; padding: 11px 12px; border: 1px solid var(--border-2);
  border-radius: var(--radius-sm); font-size: 14px; font-family: inherit; background: var(--surface);
}
.login-card input:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.login-card input:disabled { background: var(--surface-2); color: var(--muted); }
.login-error { color: var(--danger); font-size: 13px; min-height: 18px; margin-bottom: 6px; }
.login-hint { font-size: 12px; color: var(--faint); margin: -6px 0 10px; text-align: left; }
.login-card .env-badge { display: inline-block; margin-top: 20px; }

/* Champ mot de passe + bouton œil */
.pw-wrap { position: relative; display: block; margin-top: 6px; }
.pw-wrap input { margin-top: 0 !important; padding-right: 42px !important; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: none; background: transparent; cursor: pointer; font-size: 15px;
  padding: 4px 7px; border-radius: var(--radius-xs); opacity: .6; line-height: 1;
}
.pw-toggle:hover, .pw-toggle.active { opacity: 1; }

/* Barre haute */
.topbar {
  height: 60px; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 20px; gap: 18px;
}
.topbar-brand { font-weight: 700; font-size: 17px; letter-spacing: -.02em; display: flex; align-items: center; gap: 9px; }
.topbar-right { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.topbar-right form { margin: 0; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-chip-avatar {
  width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px;
}
.user-chip-info { line-height: 1.25; }
.user-chip-name { font-size: 13px; font-weight: 600; }
.user-chip-role { font-size: 11px; color: var(--faint); }
.env-badge { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; line-height: 1; white-space: nowrap; }
.env-dev  { background: #64748b; color: #fff; }
.env-prod { background: #dc2626; color: #fff; box-shadow: 0 0 0 2px rgba(220,38,38,.18); }
.env-recette { background: #d97706; color: #fff; }   /* ambre = recette (home-server) */

/* Aiguillage : tuiles des applications */
.home { max-width: 920px; margin: 0 auto; padding: 48px 24px 60px; }
.home-h1 { font-size: 26px; font-weight: 700; letter-spacing: -.025em; margin: 0 0 4px; }
.home-lead { color: var(--muted); margin: 0 0 24px; font-size: 14px; }
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.app-tile {
  display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 22px 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); color: var(--text); text-decoration: none;
  transition: border-color .14s, box-shadow .14s, transform .06s;
}
.app-tile:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-1px); }
.app-icon { font-size: 30px; line-height: 1; }
.app-name { font-size: 16px; font-weight: 650; margin-top: 6px; }
.app-desc { font-size: 13px; color: var(--muted); }
.home-admin { margin-top: 28px; font-size: 13px; color: var(--muted); }
.no-apps { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; }
.no-apps p { margin: 0 0 6px; }

@media (max-width: 640px) {
  .topbar { padding: 0 12px; gap: 10px; }
  .topbar-brand span, .user-chip-info { display: none; }
  .home { padding: 28px 16px 48px; }
  .home-h1 { font-size: 22px; }
  .app-grid { grid-template-columns: 1fr; }
}
