/* =============================================================
   PORTFOLIO DIEUDONNÉ YETO — Administration CSS
   ============================================================= */

:root {
  --admin-sidebar-w: 260px;
  --admin-topbar-h: 64px;
  --admin-primary:  #0D6EFD;
  --admin-gold:     #FFC107;
  --admin-bg:       #f0f4f8;
  --admin-card-bg:  #ffffff;
  --admin-sidebar-bg: #0f172a;
  --admin-border:   #e2e8f0;
  --admin-text:     #1e293b;
  --admin-muted:    #64748b;
  --admin-radius:   10px;
  --admin-shadow:   0 2px 12px rgba(0,0,0,.07);
}

* { box-sizing: border-box; }
body { font-family: 'Poppins', sans-serif; font-size: 14px; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-body {
  background: #060d2e;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}
.login-bg {
  position: fixed; inset: 0;
  pointer-events: none;
}
.login-orb {
  position: absolute; border-radius: 50%;
}
.login-orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(13,110,253,.2) 0%, transparent 70%);
  top: -200px; right: -100px;
}
.login-orb-2 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(255,193,7,.1) 0%, transparent 70%);
  bottom: -100px; left: -50px;
}
.login-card {
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 30px 80px rgba(0,0,0,.4);
  overflow: hidden;
}
.login-header {
  background: linear-gradient(135deg, #0D6EFD 0%, #0040c0 100%);
  padding: 28px;
}
.login-brand {
  display: flex; align-items: center; gap: 14px;
}
.login-brand-name {
  font-size: 1.4rem; font-weight: 800; color: #fff;
}
.login-brand-name span { color: #FFC107; }
.login-brand-sub {
  font-size: .75rem; color: rgba(255,255,255,.6);
  text-transform: uppercase; letter-spacing: 1px;
}
.login-body-inner { padding: 32px; }

.login-body-inner .form-control {
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: .9rem;
}
.login-body-inner .form-control:focus {
  border-color: #0D6EFD;
  box-shadow: 0 0 0 3px rgba(13,110,253,.1);
}
.login-body-inner .input-group-text {
  border: 1.5px solid #e2e8f0;
  border-right: none;
}
.login-body-inner .input-group .form-control {
  border-left: none;
}

/* ============================================================
   LAYOUT ADMIN
   ============================================================ */
.admin-body {
  background: var(--admin-bg);
  color: var(--admin-text);
  min-height: 100vh;
}
.admin-wrapper {
  display: flex;
  min-height: 100vh;
}
.admin-content {
  flex: 1;
  margin-left: var(--admin-sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left .3s ease;
}
.admin-main {
  padding: 24px;
  flex: 1;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.admin-sidebar {
  width: var(--admin-sidebar-w);
  background: var(--admin-sidebar-bg);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1050;
  display: flex; flex-direction: column;
  transition: transform .3s ease;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.brand-icon {
  width: 38px; height: 38px;
  background: #0D6EFD;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: #fff;
  flex-shrink: 0;
}
.brand-name {
  font-size: 1.2rem; font-weight: 800; color: #fff; line-height: 1;
}
.brand-name span { color: #FFC107; }
.brand-sub { font-size: .65rem; color: rgba(255,255,255,.45); text-transform: uppercase; letter-spacing: 1px; margin-top: 2px; }

.sidebar-menu {
  list-style: none;
  padding: 14px 10px;
  margin: 0;
  flex: 1;
}
.sidebar-item { margin-bottom: 2px; }
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  color: rgba(255,255,255,.6);
  text-decoration: none;
  font-size: .87rem;
  font-weight: 500;
  transition: all .25s ease;
  position: relative;
}
.sidebar-link:hover {
  color: #fff;
  background: rgba(255,255,255,.07);
}
.sidebar-link.active {
  color: #fff;
  background: rgba(13,110,253,.25);
  box-shadow: inset 3px 0 0 #0D6EFD;
}
.sidebar-link i { font-size: 1rem; flex-shrink: 0; }
.sidebar-badge {
  margin-left: auto;
  background: #dc3545;
  color: #fff;
  border-radius: 50px;
  padding: 1px 7px;
  font-size: .7rem;
  font-weight: 700;
}

.sidebar-footer {
  padding: 10px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-close { color: rgba(255,255,255,.7); }

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1049;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.admin-topbar {
  height: var(--admin-topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  position: sticky; top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.topbar-title { font-weight: 700; font-size: 1rem; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.admin-avatar {
  width: 36px; height: 36px;
  background: var(--admin-primary);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem;
}

.btn-icon {
  width: 38px; height: 38px;
  border: none;
  background: none;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--admin-text);
}
.btn-icon:hover { background: var(--admin-bg); }

/* ============================================================
   CARDS
   ============================================================ */
.card-admin {
  background: var(--admin-card-bg);
  border-radius: var(--admin-radius);
  box-shadow: var(--admin-shadow);
  border: 1px solid var(--admin-border);
  overflow: hidden;
}
.card-admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--admin-border);
}

/* ============================================================
   STAT WIDGETS
   ============================================================ */
.stat-widget {
  background: var(--admin-card-bg);
  border-radius: var(--admin-radius);
  box-shadow: var(--admin-shadow);
  border: 1px solid var(--admin-border);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
}
.stat-widget::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--stat-color);
}
.stat-widget-icon {
  width: 48px; height: 48px;
  background: color-mix(in srgb, var(--stat-color) 15%, transparent);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  color: var(--stat-color);
  position: relative;
}
.notif-dot {
  position: absolute; top: -3px; right: -3px;
  width: 10px; height: 10px;
  background: #dc3545;
  border-radius: 50%;
  border: 2px solid #fff;
}
.stat-widget-num { font-size: 1.7rem; font-weight: 800; line-height: 1.1; }
.stat-widget-label { font-size: .77rem; color: var(--admin-muted); text-transform: uppercase; letter-spacing: .8px; }
.stat-widget-link { font-size: .78rem; color: var(--stat-color); font-weight: 600; text-decoration: none; margin-top: 4px; }
.stat-widget-link:hover { text-decoration: underline; }

/* ============================================================
   TABLES
   ============================================================ */
.table { font-size: .85rem; }
.table th { font-weight: 600; color: var(--admin-muted); text-transform: uppercase; font-size: .72rem; letter-spacing: .8px; border-bottom: 1px solid var(--admin-border); }
.table-hover tbody tr:hover { background: #f8fafc; }
.btn-xs { padding: 3px 8px; font-size: .75rem; }

/* ── table-admin : style unifié ───────────────────────────── */
.table-admin { width:100%; border-collapse:separate; border-spacing:0; font-size:.85rem; margin:0; }

.table-admin thead th {
  background: #1e3a5f;
  color: rgba(255,255,255,.9);
  font-size: .69rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  padding: 13px 16px;
  border: none;
  border-right: 1px solid rgba(255,255,255,.15);
  white-space: nowrap;
}
.table-admin thead th:last-child { border-right: none; }

.table-admin tbody tr:nth-child(odd)  { background: #ffffff; }
.table-admin tbody tr:nth-child(even) { background: #f5f8ff; }
.table-admin tbody tr { transition: background .15s; }
.table-admin tbody tr:hover { background: #e8f0fe !important; cursor: pointer; }
.table-admin tbody tr.no-click:hover { cursor: default; background: inherit !important; }

.table-admin tbody td {
  padding: 13px 16px;
  border-top: 1px solid #eef0f5;
  border-right: 1px solid #eef0f5;
  vertical-align: middle;
}
.table-admin tbody td:last-child { border-right: none; }
.table-admin tbody td:first-child { padding-left: 20px; }
.table-admin thead th:first-child { padding-left: 20px; }

/* ============================================================
   FORMS ADMIN
   ============================================================ */
.admin-main .form-control,
.admin-main .form-select {
  border: 1.5px solid var(--admin-border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: .9rem;
  color: var(--admin-text);
}
.admin-main .form-control:focus,
.admin-main .form-select:focus {
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px rgba(13,110,253,.1);
}
.admin-main .form-label { font-weight: 600; font-size: .83rem; color: var(--admin-muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.admin-main .card-admin { padding: 24px; }

/* ============================================================
   BADGES
   ============================================================ */
.badge { font-size: .72rem; border-radius: 6px; padding: 4px 10px; }
.bg-published, .bg-success { background: #20c99720 !important; color: #20c997 !important; border: 1px solid #20c99740; }
.bg-draft, .bg-secondary { background: #6c757d20 !important; color: #6c757d !important; border: 1px solid #6c757d40; }

/* ============================================================
   UPLOAD
   ============================================================ */
.upload-zone {
  border: 2px dashed var(--admin-border);
  border-radius: var(--admin-radius);
  padding: 30px;
  text-align: center;
  cursor: pointer;
  transition: all .25s;
}
.upload-zone:hover { border-color: var(--admin-primary); background: rgba(13,110,253,.04); }

/* ============================================================
   PAGINATION ADMIN
   ============================================================ */
.page-link { font-size: .82rem; padding: 5px 12px; border-radius: 6px !important; margin: 0 2px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 991px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .admin-content { margin-left: 0; }
}
