/* ============================================================
   NOVALYS — Styles du Panel Admin
   ============================================================ */

/* ── Layout général ── */
.admin-body {
  background: #f0ede8;
  min-height: 100vh;
  display: flex;
}

.screen { display: none; width: 100%; }
.screen.active { display: flex; }

/* ── Écran de connexion ── */
.login-wrap {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: #f0ede8;
}

.login-card {
  background: #fff;
  border: 1px solid #e8e5e0;
  border-radius: 18px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.07);
  text-align: center;
}

.login-logo {
  width: 52px;
  height: 52px;
  border-radius: 13px;
  background: linear-gradient(135deg, #1a1a2e 55%, #c9a84c 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Serif Display', serif;
  font-size: 22px;
  color: #f5ecd4;
  margin: 0 auto 1rem;
}

.login-title {
  font-family: 'DM Serif Display', serif;
  font-size: 26px;
  color: #1a1a1a;
  margin-bottom: 4px;
}

.login-sub {
  font-size: 13px;
  color: #aaa;
  margin-bottom: 2rem;
}

.login-error {
  background: #fce8e8;
  color: #8f2222;
  border: 1px solid #f5c2c2;
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  text-align: left;
}

/* ── Sidebar ── */
.a-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: #1a1a2e;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.a-sidebar-top { flex: 1; }

.a-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 0.5rem;
  margin-bottom: 2rem;
}

.a-logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, #2e2e50 50%, #c9a84c 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Serif Display', serif;
  font-size: 16px;
  color: #f5ecd4;
  flex-shrink: 0;
}

.a-brand-name {
  font-family: 'DM Serif Display', serif;
  font-size: 16px;
  color: #fff;
  letter-spacing: -0.2px;
}

.a-brand-sub {
  font-size: 10px;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-top: 1px;
}

.a-nav { display: flex; flex-direction: column; gap: 3px; }

.a-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  padding: 9px 12px;
  border-radius: 9px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
  position: relative;
}

.a-nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.8);
}

.a-nav-item.active {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.a-nav-icon {
  font-size: 14px;
  opacity: 0.7;
  flex-shrink: 0;
}

.a-nav-badge {
  margin-left: auto;
  background: #c9a84c;
  color: #1a1a2e;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
}

.a-sidebar-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 1rem;
}

.a-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 9px;
  margin-bottom: 8px;
}

.a-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(201,168,76,0.25);
  color: #c9a84c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.a-user-name {
  font-size: 13px;
  color: #fff;
  font-weight: 500;
}

.a-user-role {
  font-size: 10px;
  color: rgba(255,255,255,0.35);
  margin-top: 1px;
}

.a-logout {
  margin-left: auto;
  background: none;
  border: none;
  color: rgba(255,255,255,0.3);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  border-radius: 5px;
  transition: color 0.15s;
}

.a-logout:hover { color: #e88; }

.a-view-site {
  display: block;
  font-size: 12px;
  color: rgba(255,255,255,0.3);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 7px;
  transition: color 0.15s;
}

.a-view-site:hover { color: rgba(255,255,255,0.6); }

/* ── Main content ── */
.a-main {
  flex: 1;
  padding: 2rem;
  min-width: 0;
  overflow-y: auto;
  max-height: 100vh;
  position: relative;
}

/* ── Tabs ── */
.a-tab { display: none; }
.a-tab.active { display: block; }

/* ── Page header ── */
.a-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.8rem;
  gap: 1rem;
}

.a-page-header h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 26px;
  color: #1a1a1a;
  font-weight: 400;
}

.a-date {
  font-size: 13px;
  color: #aaa;
}

/* ── Stat cards ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: #fff;
  border: 1px solid #e8e5e0;
  border-radius: 14px;
  padding: 1.2rem;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: transform 0.12s;
}

.stat-card:hover { transform: translateY(-1px); }

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

.stat-num {
  font-family: 'DM Serif Display', serif;
  font-size: 26px;
  color: #1a1a1a;
  line-height: 1;
  margin-bottom: 3px;
}

.stat-lbl {
  font-size: 11px;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ── Dashboard grid ── */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

/* ── Cards ── */
.a-card {
  background: #fff;
  border: 1px solid #e8e5e0;
  border-radius: 14px;
  padding: 1.4rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.a-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}

.a-card-title {
  font-size: 13px;
  font-weight: 500;
  color: #1a1a1a;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.a-link {
  background: none;
  border: none;
  font-size: 12px;
  color: #c9a84c;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  padding: 0;
}

.a-link:hover { text-decoration: underline; }

/* ── Dept chart ── */
.dept-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 12px;
}

.dept-bar-label {
  width: 110px;
  flex-shrink: 0;
  color: #555;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dept-bar-track {
  flex: 1;
  height: 8px;
  background: #f0ede8;
  border-radius: 20px;
  overflow: hidden;
}

.dept-bar-fill {
  height: 100%;
  border-radius: 20px;
  transition: width 0.5s ease;
}

.dept-bar-count {
  width: 24px;
  text-align: right;
  color: #aaa;
  flex-shrink: 0;
}

/* ── Recent candidatures ── */
.recent-cand-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid #f0ede8;
  font-size: 13px;
}

.recent-cand-item:last-child { border-bottom: none; }

.cand-avatar-sm {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #eeedfe;
  color: #534ab7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.cand-info { flex: 1; min-width: 0; }

.cand-name {
  font-weight: 500;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cand-poste {
  font-size: 11px;
  color: #aaa;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Toolbar ── */
.offre-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.toolbar-filters {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.filter-pill {
  background: #f4f2ef;
  border: 1px solid transparent;
  color: #666;
  font-size: 12px;
  padding: 5px 13px;
  border-radius: 20px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.13s;
}

.filter-pill:hover { background: #ebe8e2; color: #1a1a1a; }

.filter-pill.active {
  background: #1a1a2e;
  color: #f5ecd4;
  border-color: #1a1a2e;
}

/* ── Table ── */
.a-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.a-table th {
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: #aaa;
  font-weight: 500;
  padding: 0 12px 12px 0;
  border-bottom: 1px solid #f0ede8;
  white-space: nowrap;
}

.a-table td {
  padding: 12px 12px 12px 0;
  border-bottom: 1px solid #f8f6f3;
  vertical-align: middle;
  color: #333;
}

.a-table tr:last-child td { border-bottom: none; }

.a-table tr:hover td { background: #fdfcfb; }

.t-title { font-weight: 500; color: #1a1a1a; }
.t-sub { font-size: 11px; color: #aaa; margin-top: 2px; }

/* Statut pills */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity 0.13s;
}

.status-pill:hover { opacity: 0.8; }

.status-ouvert  { background: #eaf3de; color: #3b6d11; }
.status-fermé   { background: #f1efe8; color: #5f5e5a; }
.status-urgent  { background: #fce8e8; color: #8f2222; }

/* Candidature status */
.cstatus-nouvelle  { background: #eeedfe; color: #534ab7; }
.cstatus-en_cours  { background: #faeeda; color: #854f0b; }
.cstatus-acceptée  { background: #eaf3de; color: #3b6d11; }
.cstatus-refusée   { background: #fce8e8; color: #8f2222; }

/* Actions */
.t-actions { display: flex; gap: 6px; align-items: center; }

.btn-icon {
  background: none;
  border: 1px solid #e8e5e0;
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  color: #555;
  transition: all 0.13s;
  white-space: nowrap;
}

.btn-icon:hover { background: #f4f2ef; border-color: #ccc; }

.btn-icon.danger:hover { background: #fce8e8; border-color: #f5c2c2; color: #8f2222; }

/* ── Candidature cards ── */
.cand-card {
  background: #fff;
  border: 1px solid #e8e5e0;
  border-radius: 14px;
  padding: 1.2rem 1.4rem;
  margin-bottom: 10px;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  cursor: pointer;
  transition: border-color 0.13s, transform 0.1s;
}

.cand-card:hover {
  border-color: #ccc;
  transform: translateY(-1px);
}

.cand-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #eeedfe;
  color: #534ab7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Serif Display', serif;
  font-size: 16px;
  flex-shrink: 0;
}

.cand-body { flex: 1; min-width: 0; }

.cand-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}

.cand-pseudo { font-size: 15px; font-weight: 500; color: #1a1a1a; }

.cand-discord { font-size: 12px; color: #aaa; margin-bottom: 6px; }

.cand-excerpt {
  font-size: 13px;
  color: #666;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cand-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.cand-meta-tag {
  font-size: 11px;
  color: #aaa;
}

/* ── Modale détail candidature ── */
.cand-detail-section { margin-bottom: 1.4rem; }

.cand-detail-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #bbb;
  font-weight: 500;
  margin-bottom: 5px;
}

.cand-detail-val {
  font-size: 14px;
  color: #333;
  line-height: 1.65;
}

.cand-status-select {
  background: #faf9f7;
  border: 1px solid #e8e5e0;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  color: #1a1a1a;
  outline: none;
  cursor: pointer;
}

/* ── Modales ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(10,10,20,0.45);
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  backdrop-filter: blur(3px);
}

.modal-overlay.open { display: flex; }

.modal {
  background: #fff;
  border-radius: 18px;
  border: 1px solid #e8e5e0;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modal-in 0.2s ease;
}

.modal-lg { max-width: 640px; }

@keyframes modal-in {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem 1.6rem 1rem;
  border-bottom: 1px solid #f0ede8;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

.modal-header h3 {
  font-family: 'DM Serif Display', serif;
  font-size: 20px;
  font-weight: 400;
  color: #1a1a1a;
}

.modal-close {
  background: none;
  border: 1px solid #e8e5e0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  color: #888;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.13s;
}

.modal-close:hover { background: #f4f2ef; color: #1a1a1a; }

.modal-body { padding: 1.6rem; }

.modal-footer {
  padding: 1rem 1.6rem 1.4rem;
  border-top: 1px solid #f0ede8;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* ── Formulaire grille 3 col ── */
.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.fg-span2 { grid-column: span 2; }
.fg-full  { grid-column: 1 / -1; }

/* ── Boutons ── */
.btn-primary {
  background: #1a1a2e;
  color: #f5ecd4;
  border: none;
  border-radius: 9px;
  padding: 10px 20px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.13s;
  white-space: nowrap;
}

.btn-primary:hover { background: #14142a; }

.btn-ghost {
  background: none;
  border: 1px solid #e8e5e0;
  color: #555;
  border-radius: 9px;
  padding: 10px 20px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.13s;
}

.btn-ghost:hover { background: #f4f2ef; border-color: #ccc; }

.w-full { width: 100%; }

/* ── Toast notification ── */
.a-toast {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  background: #1a1a2e;
  color: #f5ecd4;
  font-size: 13px;
  padding: 12px 20px;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  z-index: 999;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  max-width: 320px;
}

.a-toast.show { opacity: 1; transform: translateY(0); }

/* ── Responsive ── */
@media (max-width: 900px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
  .form-grid-3 { grid-template-columns: 1fr 1fr; }
  .fg-span2 { grid-column: span 1; }
}

@media (max-width: 640px) {
  .a-sidebar { width: 200px; }
  .stat-grid { grid-template-columns: 1fr; }
  .form-grid-3 { grid-template-columns: 1fr; }
  .fg-span2, .fg-full { grid-column: 1; }
}
