/* ================================================================
   PÈSSÈ AWARDS — Admin CSS v3 — Design clair professionnel
   ================================================================ */

.admin-body {
  background: #F5F3EF;
  font-family: 'DM Sans', system-ui, sans-serif;
  color: #2D2618;
  min-height: 100vh;
}

/* ── Layout ──────────────────────────────────────────────────── */
.admin-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.admin-sidebar {
  background: #1A1208;
  color: #CEC9BC;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: none;
}
.admin-sidebar::-webkit-scrollbar { display:none; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.sidebar-brand-img { height: 40px; width: 40px; border-radius: 8px; object-fit: cover; border: 2px solid rgba(184,134,11,.4); }
.sidebar-brand-name { font-family: 'Playfair Display', serif; font-size: 1rem; font-weight: 700; color: #FAF8F4; line-height: 1.2; }
.sidebar-brand-sub  { font-size: .65rem; color: #7A6E58; letter-spacing: 1.5px; text-transform: uppercase; }

.sidebar-nav { flex: 1; padding: 1rem .75rem; display: flex; flex-direction: column; gap: .15rem; }
.sidebar-section-label {
  font-size: .62rem; letter-spacing: 2px; text-transform: uppercase;
  color: #5A5040; padding: 1rem .5rem .4rem; font-weight: 600;
}
.sidebar-link {
  display: flex; align-items: center; gap: .7rem;
  padding: .6rem .85rem; border-radius: 8px;
  font-size: .84rem; font-weight: 500; color: #ADA28E;
  transition: all .2s; cursor: pointer; position: relative;
  text-decoration: none;
}
.sidebar-link:hover { background: rgba(255,255,255,.06); color: #FAF8F4; }
.sidebar-link.active { background: rgba(184,134,11,.18); color: #D4A017; }
.sidebar-link .sidebar-icon { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }
.sidebar-badge {
  margin-left: auto; background: #C0392B; color: #fff;
  border-radius: 100px; padding: .15rem .5rem; font-size: .68rem; font-weight: 700; min-width: 20px; text-align: center;
}
.sidebar-link-danger { color: #E57373 !important; }
.sidebar-link-danger:hover { background: rgba(192,57,43,.15) !important; color: #E57373 !important; }
.sidebar-sep { height: 1px; background: rgba(255,255,255,.07); margin: .5rem 0; }

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: .78rem; color: #5A5040;
}
.sidebar-footer strong { color: #CEC9BC; }

/* ── Main area ───────────────────────────────────────────────── */
.admin-main { display: flex; flex-direction: column; min-height: 100vh; overflow: hidden; }

.admin-topbar {
  background: #FFFFFF;
  border-bottom: 1px solid #E4DDD0;
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  flex-shrink: 0;
}
.admin-page-title { font-size: 1.05rem; font-weight: 700; color: #1A1208; }
.admin-topbar-right { display: flex; align-items: center; gap: 1rem; }
.admin-topbar-date { font-size: .8rem; color: #7A6E58; }
.admin-topbar-user { display: flex; align-items: center; gap: .5rem; font-size: .85rem; font-weight: 600; color: #1A1208; }
.admin-topbar-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, #D4A017, #B8860B);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: .85rem;
}

.admin-content { padding: 2rem; flex: 1; overflow: auto; }

/* ── Stat Cards ──────────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.25rem; margin-bottom: 2rem; }

.stat-card {
  background: #FFFFFF;
  border: 1px solid #E4DDD0;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
  display: flex;
  flex-direction: column;
  gap: .5rem;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent1, #B8860B), var(--accent2, #D4A017));
}
.stat-icon { font-size: 1.6rem; }
.stat-label { font-size: .75rem; color: #7A6E58; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
.stat-value { font-family: 'Playfair Display', serif; font-size: 2rem; font-weight: 700; color: #1A1208; }
.stat-sub   { font-size: .78rem; color: #7A6E58; }
.stat-card.green  { --accent1: #009A44; --accent2: #00C957; }
.stat-card.blue   { --accent1: #1565C0; --accent2: #2196F3; }
.stat-card.red    { --accent1: #CE1126; --accent2: #F44336; }
.stat-card.purple { --accent1: #7B1FA2; --accent2: #AB47BC; }

/* ── Tables ──────────────────────────────────────────────────── */
.admin-table-wrap {
  background: #FFFFFF;
  border: 1px solid #E4DDD0;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
  overflow: hidden;
}
.table-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #E4DDD0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.table-header-title { font-size: .95rem; font-weight: 700; color: #1A1208; }
.table-header-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
  background: #F7F4EF; padding: .75rem 1rem;
  font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  color: #7A6E58; text-align: left; border-bottom: 1px solid #E4DDD0;
  white-space: nowrap;
}
.admin-table td {
  padding: .85rem 1rem; border-bottom: 1px solid #F3EFE6;
  font-size: .85rem; color: #2D2618; vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #FAFAF8; }
.admin-table .td-actions { display: flex; gap: .4rem; flex-wrap: wrap; }

/* ── Status badges in table ──────────────────────────────────── */
.status-badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .25rem .7rem; border-radius: 100px; font-size: .72rem; font-weight: 600; white-space: nowrap;
}
.status-confirmed { background: #EAF7EF; color: #1A7A4A; }
.status-pending   { background: #FEF9EA; color: #B8860B; }
.status-failed    { background: #FDEDEC; color: #C0392B; }
.status-approved  { background: #EAF7EF; color: #1A7A4A; }
.status-rejected  { background: #FDEDEC; color: #C0392B; }
.status-active    { background: #E8F7EE; color: #009A44; }
.status-inactive  { background: #F3EFE6; color: #7A6E58; }
.status-open      { background: #E8F0FE; color: #1565C0; }

/* ── Forms (admin) ───────────────────────────────────────────── */
.admin-form-wrap {
  background: #FFFFFF;
  border: 1px solid #E4DDD0;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
  max-width: 700px;
}
.admin-form-wrap.wide { max-width: 100%; }
.form-section { margin-bottom: 2rem; padding-bottom: 2rem; border-bottom: 1px solid #F3EFE6; }
.form-section:last-child { border-bottom: none; margin-bottom: 0; }
.form-section-title { font-size: .85rem; font-weight: 700; color: #7A6E58; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 1.25rem; }

.a-form-group { margin-bottom: 1.25rem; }
.a-form-label { font-size: .85rem; font-weight: 600; color: #2D2618; margin-bottom: .4rem; display: block; }
.a-form-label span { color: #C0392B; margin-left: .15rem; }
.a-form-control {
  width: 100%; padding: .65rem .9rem;
  border: 1.5px solid #E4DDD0; border-radius: 8px;
  font-size: .88rem; background: #FAF8F4; color: #1A1208;
  transition: border-color .2s;
}
.a-form-control:focus { border-color: #B8860B; outline: none; background: #FFFFFF; }
.a-form-hint { font-size: .75rem; color: #7A6E58; margin-top: .3rem; }
.a-form-row  { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
textarea.a-form-control { min-height: 90px; resize: vertical; }
select.a-form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237A6E58' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .75rem center; padding-right: 2.5rem; }

/* Preview image upload */
.img-upload-wrap { position: relative; }
.img-preview { width: 100%; max-height: 160px; object-fit: cover; border-radius: 8px; border: 1px solid #E4DDD0; margin-top: .5rem; display: none; }
.img-preview.show { display: block; }

/* ── Alert / Flash ───────────────────────────────────────────── */
.admin-alert {
  padding: .85rem 1.25rem; border-radius: 8px; margin-bottom: 1.25rem;
  display: flex; align-items: center; gap: .6rem; font-size: .88rem;
}
.admin-alert.success { background: #EAF7EF; color: #1A7A4A; border: 1px solid #B7E4C7; }
.admin-alert.error   { background: #FDEDEC; color: #C0392B; border: 1px solid #F5C6C2; }
.admin-alert.warning { background: #FEF9EA; color: #B8860B; border: 1px solid #F7E1A0; }
.admin-alert.info    { background: #E8F0FE; color: #1565C0; border: 1px solid #B3CDF5; }

/* ── Dashboard widgets ───────────────────────────────────────── */
.dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; }
.dashboard-wide { grid-column: 1 / -1; }

.widget {
  background: #FFFFFF; border: 1px solid #E4DDD0;
  border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.05); overflow: hidden;
}
.widget-header {
  padding: 1.1rem 1.5rem; border-bottom: 1px solid #F3EFE6;
  display: flex; align-items: center; justify-content: space-between;
}
.widget-title { font-size: .9rem; font-weight: 700; color: #1A1208; }
.widget-body  { padding: 1.25rem 1.5rem; }

/* Leaderboard widget */
.lb-widget-item {
  display: flex; align-items: center; gap: .85rem;
  padding: .65rem 0; border-bottom: 1px solid #F3EFE6;
}
.lb-widget-item:last-child { border-bottom: none; }
.lb-widget-rank {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; flex-shrink: 0;
}
.lb-w-r1 { background: #B8860B; color: #fff; }
.lb-w-r2 { background: #9AAABE; color: #fff; }
.lb-w-r3 { background: #C0956C; color: #fff; }
.lb-w-rn { background: #E4DDD0; color: #7A6E58; }
.lb-widget-photo { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.lb-widget-info  { flex: 1; }
.lb-widget-name  { font-size: .85rem; font-weight: 600; color: #1A1208; }
.lb-widget-cat   { font-size: .75rem; color: #7A6E58; }
.lb-widget-votes { font-size: .85rem; font-weight: 700; color: #B8860B; white-space: nowrap; }

/* Votes open toggle */
.votes-toggle-card {
  background: linear-gradient(135deg, #1A1208, #2D2618);
  border-radius: 12px; padding: 1.5rem; color: #FAF8F4; margin-bottom: 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.votes-toggle-status { display: flex; align-items: center; gap: .6rem; }
.votes-toggle-dot { width: 10px; height: 10px; border-radius: 50%; }
.votes-toggle-dot.on  { background: #00C957; animation: blink 1.4s infinite; }
.votes-toggle-dot.off { background: #7A6E58; }
.votes-toggle-text strong { font-size: 1rem; }
.votes-toggle-text small  { font-size: .78rem; color: #7A6E58; display: block; }

/* ── Image thumb in table ────────────────────────────────────── */
.table-thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; border: 1px solid #E4DDD0; }
.table-thumb-round { border-radius: 50%; }

/* ── Nominee name in table ───────────────────────────────────── */
.td-nom { display: flex; align-items: center; gap: .7rem; }
.td-nom-info .td-nom-name { font-weight: 600; font-size: .88rem; color: #1A1208; }
.td-nom-info .td-nom-sub  { font-size: .75rem; color: #7A6E58; }

/* ── Pagination ──────────────────────────────────────────────── */
.pagination { display: flex; gap: .4rem; justify-content: center; padding: 1.25rem; }
.page-btn {
  padding: .4rem .8rem; border-radius: 6px; border: 1px solid #E4DDD0;
  font-size: .82rem; cursor: pointer; background: #FFFFFF; color: #3D3520; transition: all .2s;
}
.page-btn:hover, .page-btn.active { background: #B8860B; border-color: #B8860B; color: #fff; }

/* ── Search / Filter bar ─────────────────────────────────────── */
.filter-bar {
  display: flex; gap: .75rem; margin-bottom: 1.25rem; flex-wrap: wrap;
}
.filter-input {
  flex: 1; min-width: 180px; padding: .55rem .9rem;
  border: 1.5px solid #E4DDD0; border-radius: 8px; font-size: .85rem;
  background: #FFFFFF; color: #1A1208;
}
.filter-input:focus { border-color: #B8860B; outline: none; }
.filter-select {
  padding: .55rem .9rem; border: 1.5px solid #E4DDD0; border-radius: 8px;
  font-size: .85rem; background: #FFFFFF; color: #1A1208; cursor: pointer;
}
.filter-select:focus { border-color: #B8860B; outline: none; }

/* ── Application card ────────────────────────────────────────── */
.app-card {
  background: #FFFFFF; border: 1px solid #E4DDD0; border-radius: 12px;
  overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.05);
  margin-bottom: 1rem;
}
.app-card-header {
  padding: 1rem 1.25rem; background: #F7F4EF;
  border-bottom: 1px solid #E4DDD0;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
}
.app-card-body { padding: 1.25rem; display: grid; grid-template-columns: auto 1fr; gap: 1.25rem; align-items: start; }
.app-card-photo { width: 80px; height: 80px; border-radius: 10px; object-fit: cover; border: 1px solid #E4DDD0; }
.app-card-info  { font-size: .85rem; color: #3D3520; }
.app-card-name  { font-size: 1rem; font-weight: 700; color: #1A1208; margin-bottom: .35rem; }
.app-card-detail { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-bottom: .75rem; }
.app-card-detail span { color: #7A6E58; }
.app-card-bio   { font-size: .82rem; color: #7A6E58; line-height: 1.6; margin-bottom: .75rem; }
.app-card-footer { padding: 1rem 1.25rem; border-top: 1px solid #F3EFE6; display: flex; gap: .5rem; flex-wrap: wrap; }

/* ── Settings page ───────────────────────────────────────────── */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.settings-section {
  background: #FFFFFF; border: 1px solid #E4DDD0; border-radius: 12px;
  padding: 1.75rem; box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.settings-section.full { grid-column: 1 / -1; }
.settings-section-title { font-size: .95rem; font-weight: 700; color: #1A1208; margin-bottom: 1.25rem; padding-bottom: .75rem; border-bottom: 1px solid #F3EFE6; }

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 4rem 2rem; }
.empty-state-icon { font-size: 3.5rem; margin-bottom: 1rem; }
.empty-state-title { font-size: 1.1rem; font-weight: 700; color: #1A1208; margin-bottom: .5rem; }
.empty-state-desc  { font-size: .88rem; color: #7A6E58; }

/* ── Responsive admin ────────────────────────────────────────── */
@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .a-form-row { grid-template-columns: 1fr; }
}

@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.3} }
