/* Portail administrateur.
   Reprend les jetons de style.css ; seule la largeur change, le tableau a
   besoin de place là où le formulaire tient dans une carte étroite. */

.page--wide { max-width: 1040px; }

/* ── En-tête ── */
.admin-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.admin-subtitle {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-actions .lang-switch { margin-bottom: 0; }

.admin-back,
.btn-ghost {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  padding: 0 12px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.admin-back:hover,
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Connexion ── */
.admin-login { max-width: 420px; }

.admin-login-hint {
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ── Navigation mensuelle ── */
.month-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}

.month-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--accent);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.month-btn:hover:not(:disabled) {
  background: var(--bg);
  border-color: var(--accent);
}

.month-btn:disabled { opacity: 0.4; cursor: default; }

.month-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 200px;
}

.month-name {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}

.month-today {
  border: none;
  background: none;
  padding: 0;
  color: var(--accent);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

/* ── Messages ── */
.admin-status {
  margin-bottom: 16px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.admin-note {
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.6;
}

/* ── Tableau récapitulatif ── */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.recap {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.recap th,
.recap td {
  padding: 10px 8px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.recap thead th {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: bottom;
}

.recap .col-person { text-align: left; padding-left: 4px; }

.recap thead .col-week { line-height: 1.3; }

.th-main { display: block; }

.th-sub {
  display: block;
  margin-top: 2px;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: #99A0BC;
}

.recap-row { cursor: pointer; transition: background 0.12s ease; }
.recap-row:hover { background: var(--bg); }

.recap-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.person-name { font-weight: 600; }

.person-tag {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
}

.recap .is-zero { color: #B0B7CC; }
.recap .is-total { font-weight: 700; color: var(--accent); }
.recap .col-expenses { font-variant-numeric: tabular-nums; }
.recap .col-week,
.recap .col-total { font-variant-numeric: tabular-nums; }

.recap tfoot th,
.recap tfoot td {
  border-bottom: none;
  border-top: 2px solid var(--accent);
  padding-top: 12px;
  font-weight: 700;
  color: var(--accent);
}

/* ── Détail déplié ── */
.detail-row > td {
  padding: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  white-space: normal;
  text-align: left;
}

.detail { padding: 16px 12px 20px; }

.detail-summary {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.82rem;
}

.detail-block + .detail-block { margin-top: 18px; }

.detail-title {
  margin-bottom: 6px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
}

.detail-empty { color: var(--muted); font-size: 0.82rem; }

.detail-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-size: 0.82rem;
}

.detail-table th,
.detail-table td {
  padding: 7px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.detail-table tbody tr:last-child th,
.detail-table tbody tr:last-child td { border-bottom: none; }

.detail-table th {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.detail-table .is-amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.detail-table a { color: var(--accent); font-weight: 600; }

/* ── Export ── */
.export-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.export-bar .btn-inline,
.export-bar .btn-ghost {
  text-decoration: none;
  height: 36px;
  display: inline-flex;
  align-items: center;
}

/* ── Collaborateurs ── */
.team-toolbar { margin-bottom: 16px; }

.btn-inline {
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #FFFFFF;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-inline:hover { background: var(--accent-hover); }

.team-form {
  margin-bottom: 20px;
  padding: 18px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.team-form .detail-title { margin-bottom: 14px; }

.field-hint {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

.team-form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.btn-submit--inline {
  width: auto;
  min-width: 160px;
  margin-top: 0;
}

.team-form-actions .btn-ghost { height: 46px; padding: 0 18px; }

.team-table td { text-align: left; }
.team-table .col-actions { white-space: nowrap; }

/* Un compte désactivé reste lisible mais s'efface visuellement. */
.team-table .is-inactive td { color: var(--muted); }
.team-table .is-inactive .col-person { font-weight: 500; }

.link-btn {
  border: none;
  background: none;
  padding: 0;
  margin-right: 14px;
  color: var(--accent);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.link-btn:last-child { margin-right: 0; color: var(--muted); }
.link-btn:hover { color: var(--accent-hover); }

.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 600;
}

.pill--on  { background: #E4F2EC; color: var(--success); }
.pill--off { background: var(--bg); color: var(--muted); }

@media (max-width: 640px) {
  .team-form-actions { flex-wrap: wrap; }
  .btn-submit--inline { width: 100%; }
  /* Sur un écran étroit, les trois commandes passent à la ligne plutôt que
     de comprimer leur libellé sur deux lignes chacune. */
  .admin-header { flex-direction: column; }
  .admin-actions { flex-wrap: wrap; row-gap: 8px; }
  .month-label { min-width: 140px; }
  .month-name { font-size: 1rem; }
  .recap { font-size: 0.8rem; }
  .recap th, .recap td { padding: 8px 6px; }
  .detail { padding: 12px 8px 16px; }
}
