/* TALENT GN Back-Office — Thème pro, charte bleu / jaune / blanc */

:root {
  --tg-blue: #0d9488;
  --tg-teal: #14b8a6;
  --tg-teal-light: #2dd4bf;
  --tg-yellow: #facc15;
  --tg-white: #f8fafc;
  --tg-black: #0f172a;
  --tg-gray-900: #0f172a;
  --tg-gray-800: #1e293b;
  --tg-gray-700: #334155;
  --tg-gray-500: #64748b;
  --tg-gray-400: #94a3b8;
  --sidebar-width: 240px;
  --radius: 10px;
  --font: 'Plus Jakarta Sans', -apple-system, sans-serif;
}

* { box-sizing: border-box; }

img, video {
  max-width: 100%;
  height: auto;
}

html {
  overflow-x: hidden;
  max-width: 100%;
}

body.backoffice {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--tg-white);
  background: var(--tg-gray-800);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  max-width: 100%;
  overflow-x: hidden;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--tg-black);
  border-right: 1px solid var(--tg-gray-700);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-logo {
  padding: 20px;
  border-bottom: 1px solid var(--tg-gray-800);
}

.sidebar-logo img {
  display: block;
  height: 32px;
  width: auto;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: var(--tg-gray-400);
  text-decoration: none;
  border-radius: var(--radius);
  margin-bottom: 4px;
  transition: background 0.2s, color 0.2s;
}

.nav-item:hover {
  background: var(--tg-gray-800);
  color: var(--tg-white);
}

.nav-item.active {
  background: rgba(20, 184, 166, 0.15);
  color: var(--tg-teal-light);
}

.nav-item .icon {
  font-size: 1.1rem;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--tg-gray-800);
}

.sidebar-footer .nav-item {
  margin-bottom: 4px;
}

/* Main area */
.main-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  padding: 16px 24px;
  background: var(--tg-gray-800);
  border-bottom: 1px solid var(--tg-gray-700);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.page-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--tg-white);
}

.topbar-user {
  font-size: 14px;
  color: var(--tg-gray-400);
}

.content {
  flex: 1;
  padding: 24px;
  overflow-x: hidden;
  overflow-y: auto;
  max-width: 100%;
  word-wrap: break-word;
}

/* Login (pas de sidebar) */
body.backoffice.login-page {
  justify-content: center;
  align-items: center;
}

.login-box {
  width: 100%;
  max-width: 400px;
  padding: 40px;
  background: var(--tg-gray-800);
  border: 1px solid var(--tg-gray-700);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.login-box h1 {
  margin: 0 0 8px;
  font-size: 1.5rem;
  color: var(--tg-white);
}

.login-box .subtitle {
  color: var(--tg-gray-500);
  font-size: 14px;
  margin-bottom: 24px;
}

.login-box .logo {
  margin-bottom: 24px;
}

.login-box .logo img {
  height: 40px;
}

.login-box form label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--tg-gray-400);
}

.login-box form input {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 16px;
  border: 1px solid var(--tg-gray-700);
  border-radius: 8px;
  background: var(--tg-black);
  color: var(--tg-white);
  font-size: 15px;
}

.login-box form input:focus {
  outline: none;
  border-color: var(--tg-teal);
}

.login-box form button {
  width: 100%;
  padding: 12px;
  background: var(--tg-teal);
  color: var(--tg-black);
  border: 0;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.login-box form button:hover {
  background: var(--tg-teal-light);
}

.login-box .back-link {
  display: block;
  text-align: center;
  margin-top: 16px;
  color: var(--tg-gray-400);
  font-size: 14px;
}

.login-box .back-link:hover {
  color: var(--tg-teal-light);
}

/* Dashboard cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.card {
  background: var(--tg-gray-800);
  border: 1px solid var(--tg-gray-700);
  border-radius: var(--radius);
  padding: 20px;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--tg-gray-400);
}

.card .value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--tg-teal-light);
}

/* Tables */
.table-wrap {
  background: var(--tg-gray-800);
  border: 1px solid var(--tg-gray-700);
  border-radius: var(--radius);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--tg-gray-700);
}

th {
  background: var(--tg-black);
  font-size: 12px;
  font-weight: 600;
  color: var(--tg-gray-400);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tr:last-child td { border-bottom: 0; }

tr:hover td {
  background: rgba(20, 184, 166, 0.05);
}

td {
  font-size: 14px;
  color: var(--tg-white);
}

.messages {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}

.message {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 8px;
}

.message.success { background: rgba(34, 197, 94, 0.2); color: #86efac; }
.message.error { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }

/* ── New elements ─────────────────────────────────────────────────────────── */

.card-link {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  color: var(--tg-teal-light);
  text-decoration: none;
}
.card-link:hover { text-decoration: underline; }

.card--alert {
  border-color: #f59e0b;
}
.card--alert .value { color: #fcd34d; }

.sidebar-badge {
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 99px;
  padding: 1px 6px;
  margin-left: auto;
}

.btn-table {
  display: inline-block;
  padding: 5px 12px;
  background: var(--tg-gray-700);
  color: var(--tg-white);
  border: 1px solid var(--tg-gray-500);
  border-radius: 6px;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn-table:hover { background: var(--tg-gray-900); }
.btn-table--sm { padding: 3px 8px; font-size: 12px; }
.btn-table--active { background: var(--tg-teal); border-color: var(--tg-teal); color: #fff; }
.btn-table--success { background: #166534; border-color: #16a34a; color: #bbf7d0; }
.btn-table--success:hover { background: #14532d; }
.btn-table--danger { background: #7f1d1d; border-color: #dc2626; color: #fecaca; }
.btn-table--danger:hover { background: #6b1c1c; }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
@media (max-width: 768px) {
  .detail-grid { grid-template-columns: 1fr; }
}

.detail-card {
  background: var(--tg-gray-800);
  border: 1px solid var(--tg-gray-700);
  border-radius: var(--radius);
  padding: 20px;
}
.detail-card h2 {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 600;
}
.detail-card h3 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--tg-gray-400);
}

.detail-table { width: 100%; border-collapse: collapse; }
.detail-table th, .detail-table td { padding: 8px 0; font-size: 14px; border-bottom: 1px solid var(--tg-gray-700); }
.detail-table th { color: var(--tg-gray-400); font-weight: 500; width: 40%; padding-right: 12px; }
.detail-table tr:last-child th, .detail-table tr:last-child td { border-bottom: none; }

.action-group { display: flex; flex-direction: column; gap: 8px; }
.action-group form { display: contents; }

.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
}
.status-badge--pending { background: rgba(251,191,36,.15); color: #fbbf24; }
.status-badge--approved, .status-badge--paid, .status-badge--completed { background: rgba(34,197,94,.15); color: #86efac; }
.status-badge--rejected, .status-badge--failed, .status-badge--closed { background: rgba(239,68,68,.15); color: #fca5a5; }
.status-badge--open { background: rgba(239,68,68,.2); color: #f87171; }
.status-badge--investigating { background: rgba(251,146,60,.15); color: #fb923c; }
.status-badge--resolved_client, .status-badge--resolved_provider { background: rgba(34,197,94,.15); color: #86efac; }
.status-badge--cancelled, .status-badge--refunded { background: rgba(148,163,184,.15); color: #94a3b8; }

.muted { color: var(--tg-gray-400); font-size: 12px; }

.card--warn {
  border-color: #94a3b8;
}
.card--warn .value { color: #94a3b8; }
