/* =========================================================
   MFACADEMY ADMIN
   DESIGN NOIR / ORANGE
========================================================= */

:root {

  --orange: #F9650D;
  --orange-dark: #D84F00;

  --black: #090909;
  --black-2: #101010;
  --black-3: #151515;

  --white: #ffffff;

  --text: #222222;
  --muted: #777777;

  --border: #eeeeee;

  --green: #16a34a;
  --yellow: #d97706;
  --red: #dc2626;

  --sidebar-width: 255px;

}


/* =========================================================
   RESET
========================================================= */

* {

  box-sizing: border-box;

}


html,
body {

  margin: 0;

  padding: 0;

  font-family:
    "Inter",
    Arial,
    sans-serif;

}


body {

  background: #f6f7f9;

  color: var(--text);

}


button,
input,
select {

  font-family: inherit;

}


/* =========================================================
   LOGIN
========================================================= */

.admin-login-page {

  min-height: 100vh;

  display: flex;

  align-items: center;

  justify-content: center;

  position: relative;

  overflow: hidden;

  background:
    radial-gradient(
      circle at 15% 20%,
      rgba(249,101,13,.15),
      transparent 30%
    ),
    radial-gradient(
      circle at 85% 80%,
      rgba(249,101,13,.08),
      transparent 30%
    ),
    #080808;

}


.login-background {

  position: absolute;

  inset: 0;

  pointer-events: none;

}


.login-orb {

  position: absolute;

  border: 1px solid
    rgba(249,101,13,.12);

  border-radius: 50%;

}


.login-orb-1 {

  width: 600px;

  height: 600px;

  top: -350px;

  left: -200px;

}


.login-orb-2 {

  width: 500px;

  height: 500px;

  right: -250px;

  bottom: -280px;

}


.login-wrapper {

  position: relative;

  z-index: 2;

  width: 100%;

  max-width: 450px;

  padding: 20px;

}


.login-card {

  padding: 40px;

  border: 1px solid
    rgba(255,255,255,.09);

  border-radius: 22px;

  background:
    rgba(18,18,18,.95);

  box-shadow:
    0 30px 80px
    rgba(0,0,0,.45);

}


.login-brand,
.sidebar-brand {

  display: flex;

  align-items: center;

  gap: 12px;

}


.brand-icon {

  width: 45px;

  height: 45px;

  display: flex;

  align-items: center;

  justify-content: center;

  border-radius: 12px;

  background: var(--orange);

  color: white;

  font-weight: 800;

  font-size: 15px;

}


.login-brand strong,
.sidebar-brand strong {

  display: block;

  color: white;

  font-size: 17px;

  font-weight: 800;

}


.login-brand span,
.sidebar-brand span {

  display: block;

  margin-top: 3px;

  color: #777;

  font-size: 9px;

  font-weight: 700;

  letter-spacing: 1px;

}


.login-header {

  text-align: center;

  margin: 40px 0 28px;

}


.login-lock {

  width: 58px;

  height: 58px;

  display: flex;

  align-items: center;

  justify-content: center;

  margin: auto;

  border-radius: 16px;

  background: rgba(249,101,13,.1);

  font-size: 25px;

}


.login-header h1 {

  margin: 18px 0 7px;

  color: white;

  font-size: 28px;

}


.login-header p {

  margin: 0;

  color: #888;

  font-size: 14px;

  line-height: 1.6;

}


.input-group {

  margin-bottom: 20px;

}


.input-group label {

  display: block;

  margin-bottom: 8px;

  color: #ddd;

  font-size: 13px;

  font-weight: 600;

}


.input-wrapper {

  display: flex;

  align-items: center;

  gap: 10px;

  padding: 0 14px;

  border: 1px solid #292929;

  border-radius: 11px;

  background: #111;

}


.input-wrapper > span {

  color: #777;

}


.input-wrapper input {

  width: 100%;

  height: 52px;

  border: 0;

  outline: 0;

  background: transparent;

  color: white;

  font-size: 14px;

}


.input-wrapper input::placeholder {

  color: #555;

}


.input-wrapper:focus-within {

  border-color: var(--orange);

  box-shadow:
    0 0 0 3px
    rgba(249,101,13,.08);

}


.password-toggle {

  border: 0;

  background: transparent;

  cursor: pointer;

  color: #777;

}


.login-button {

  width: 100%;

  height: 54px;

  border: 0;

  border-radius: 11px;

  background: var(--orange);

  color: white;

  cursor: pointer;

  font-weight: 800;

  transition: .2s;

}


.login-button:hover {

  background: var(--orange-dark);

  transform: translateY(-1px);

}


.login-button:disabled {

  opacity: .6;

  cursor: not-allowed;

}


.button-loader {

  display: none;

}


.login-message {

  display: none;

  margin-bottom: 15px;

  padding: 12px;

  border-radius: 9px;

  text-align: center;

  font-size: 13px;

}


.login-message.error {

  display: block;

  background: rgba(220,38,38,.1);

  color: #ff7777;

}


.login-message.success {

  display: block;

  background: rgba(22,163,74,.1);

  color: #5ee38a;

}


.login-footer {

  display: flex;

  justify-content: space-between;

  gap: 10px;

  margin-top: 25px;

  color: #555;

  font-size: 10px;

}


/* =========================================================
   ADMIN LAYOUT
========================================================= */

.admin-page {

  min-height: 100vh;

}


.sidebar {

  position: fixed;

  left: 0;

  top: 0;

  bottom: 0;

  width: var(--sidebar-width);

  display: flex;

  flex-direction: column;

  padding: 25px 15px;

  background: var(--black);

  z-index: 1000;

}


.sidebar-brand {

  padding: 5px 12px 35px;

}


.admin-nav {

  display: flex;

  flex-direction: column;

  gap: 5px;

}


.nav-item {

  display: flex;

  align-items: center;

  gap: 12px;

  min-height: 48px;

  padding: 0 14px;

  border-radius: 10px;

  color: #858585;

  text-decoration: none;

  border: 0;

  background: transparent;

  cursor: pointer;

  font-size: 13px;

  font-weight: 600;

  transition: .2s;

}


.nav-item:hover {

  color: white;

  background: #171717;

}


.nav-item.active {

  color: white;

  background: var(--orange);

}


.nav-icon {

  width: 22px;

  text-align: center;

  font-size: 16px;

}


.sidebar-bottom {

  margin-top: auto;

}


.logout-button {

  width: 100%;

  display: flex;

  align-items: center;

  gap: 12px;

  min-height: 48px;

  padding: 0 14px;

  border: 0;

  border-radius: 10px;

  background: transparent;

  color: #888;

  cursor: pointer;

  text-align: left;

  font-size: 13px;

  font-weight: 600;

}


.logout-button:hover {

  background: #171717;

  color: #ff7777;

}


.admin-main {

  margin-left: var(--sidebar-width);

  min-height: 100vh;

}


.admin-header {

  min-height: 85px;

  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 20px;

  padding: 18px 35px;

  background: white;

  border-bottom: 1px solid #eee;

}


.header-label {

  margin: 0 0 4px;

  color: var(--orange);

  font-size: 9px;

  font-weight: 800;

  letter-spacing: 1px;

}


.admin-header h1 {

  margin: 0;

  font-size: 22px;

}


.admin-user {

  display: flex;

  align-items: center;

  gap: 10px;

}


.user-avatar {

  width: 42px;

  height: 42px;

  display: flex;

  align-items: center;

  justify-content: center;

  border-radius: 50%;

  background: #fff0e8;

  color: var(--orange);

  font-weight: 800;

  font-size: 12px;

}


.user-info strong {

  display: block;

  font-size: 12px;

}


.user-info span {

  display: block;

  margin-top: 3px;

  color: #888;

  font-size: 10px;

}


.mobile-menu {

  display: none;

  border: 0;

  background: transparent;

  font-size: 22px;

  cursor: pointer;

}


.admin-content {

  padding: 30px 35px;

  max-width: 1500px;

  margin: auto;

}


/* =========================================================
   SECTIONS
========================================================= */

.admin-section {

  display: none;

}


.admin-section.active {

  display: block;

}


.welcome-card {

  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 25px;

  padding: 28px 30px;

  border-radius: 18px;

  color: white;

  background:
    linear-gradient(
      120deg,
      #111,
      #1c1c1c
    );

  overflow: hidden;

}


.welcome-card > div:first-child {

  position: relative;

  z-index: 2;

}


.welcome-card span {

  color: var(--orange);

  font-size: 10px;

  font-weight: 800;

  letter-spacing: 1px;

}


.welcome-card h2 {

  margin: 8px 0;

  font-size: 22px;

}


.welcome-card p {

  margin: 0;

  color: #aaa;

  font-size: 13px;

}


.welcome-icon {

  font-size: 65px;

  opacity: .7;

}


/* =========================================================
   STATISTICS
========================================================= */

.stats-grid {

  display: grid;

  grid-template-columns:
    repeat(4, minmax(0, 1fr));

  gap: 15px;

  margin-top: 20px;

}


.stat-card {

  display: flex;

  align-items: center;

  gap: 14px;

  min-height: 115px;

  padding: 20px;

  border: 1px solid #eee;

  border-radius: 15px;

  background: white;

}


.stat-card-large {

  grid-column: span 2;

}


.stat-icon {

  width: 48px;

  height: 48px;

  display: flex;

  align-items: center;

  justify-content: center;

  flex-shrink: 0;

  border-radius: 13px;

  font-size: 21px;

}


.stat-icon.orange {

  background: #fff0e8;

}


.stat-icon.blue {

  background: #eaf3ff;

}


.stat-icon.green {

  background: #eaf9ef;

}


.stat-icon.purple {

  background: #f2ebff;

}


.stat-icon.yellow {

  background: #fff6df;

}


.stat-card span {

  display: block;

  color: #888;

  font-size: 9px;

  font-weight: 800;

  letter-spacing: .6px;

}


.stat-card strong {

  display: block;

  margin-top: 7px;

  color: #171717;

  font-size: 25px;

  font-weight: 800;

}


/* =========================================================
   CONTENT CARD
========================================================= */

.content-card {

  margin-top: 20px;

  border: 1px solid #eee;

  border-radius: 16px;

  background: white;

  overflow: hidden;

}


.card-header {

  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 15px;

  padding: 20px 22px;

  border-bottom: 1px solid #eee;

}


.card-header span,
.section-heading > div > span {

  color: var(--orange);

  font-size: 9px;

  font-weight: 800;

  letter-spacing: 1px;

}


.card-header h3 {

  margin: 5px 0 0;

  font-size: 17px;

}


.small-button {

  border: 0;

  border-radius: 8px;

  padding: 9px 13px;

  background: #fff0e8;

  color: var(--orange);

  cursor: pointer;

  font-size: 11px;

  font-weight: 700;

}


/* =========================================================
   TABLE
========================================================= */

.table-wrapper {

  width: 100%;

  overflow-x: auto;

}


table {

  width: 100%;

  min-width: 800px;

  border-collapse: collapse;

}


th {

  padding: 14px 18px;

  background: #fafafa;

  color: #777;

  font-size: 9px;

  font-weight: 800;

  text-align: left;

  text-transform: uppercase;

  white-space: nowrap;

}


td {

  padding: 15px 18px;

  border-top: 1px solid #f0f0f0;

  color: #444;

  font-size: 12px;

  white-space: nowrap;

}


tbody tr:hover {

  background: #fffaf7;

}


.status {

  display: inline-flex;

  align-items: center;

  padding: 5px 9px;

  border-radius: 20px;

  font-size: 9px;

  font-weight: 800;

}


.status.paye {

  background: #eaf9ef;

  color: var(--green);

}


.status.attente {

  background: #fff6df;

  color: var(--yellow);

}


.delete-row {

  border: 0;

  border-radius: 7px;

  padding: 7px 9px;

  background: #fff0f0;

  color: var(--red);

  cursor: pointer;

}


.delete-row:hover {

  background: #ffe0e0;

}


/* =========================================================
   SECTION HEADING
========================================================= */

.section-heading {

  display: flex;

  align-items: flex-end;

  justify-content: space-between;

  gap: 20px;

  margin-bottom: 20px;

}


.section-heading h2 {

  margin: 5px 0;

  font-size: 27px;

}


.section-heading p {

  margin: 0;

  color: #888;

  font-size: 13px;

}


.section-count {

  padding: 9px 13px;

  border-radius: 20px;

  background: #fff0e8;

  color: var(--orange);

  font-size: 11px;

  font-weight: 700;

}


/* =========================================================
   FILTERS
========================================================= */

.filters {

  display: flex;

  align-items: center;

  gap: 10px;

  flex-wrap: wrap;

  padding: 18px;

  border-bottom: 1px solid #eee;

}


.search-box {

  min-width: 270px;

  flex: 1;

  display: flex;

  align-items: center;

  gap: 8px;

  padding: 0 12px;

  border: 1px solid #ddd;

  border-radius: 9px;

}


.search-box input {

  width: 100%;

  height: 42px;

  border: 0;

  outline: 0;

  font-size: 12px;

}


.filters select {

  height: 42px;

  padding: 0 12px;

  border: 1px solid #ddd;

  border-radius: 9px;

  background: white;

  color: #555;

  outline: 0;

  cursor: pointer;

  font-size: 12px;

}


.refresh-button {

  height: 42px;

  padding: 0 14px;

  border: 0;

  border-radius: 9px;

  background: var(--orange);

  color: white;

  cursor: pointer;

  font-size: 11px;

  font-weight: 700;

}


/* =========================================================
   FORMATIONS
========================================================= */

.formation-admin-grid {

  display: grid;

  grid-template-columns:
    repeat(3, minmax(0, 1fr));

  gap: 18px;

}


.formation-admin-card {

  display: flex;

  gap: 15px;

  padding: 22px;

  border: 1px solid #eee;

  border-radius: 15px;

  background: white;

}


.formation-admin-icon {

  width: 55px;

  height: 55px;

  display: flex;

  align-items: center;

  justify-content: center;

  flex-shrink: 0;

  border-radius: 14px;

  background: #fff5ee;

  font-size: 27px;

}


.formation-admin-card span {

  color: var(--orange);

  font-size: 8px;

  font-weight: 800;

  letter-spacing: 1px;

}


.formation-admin-card h3 {

  margin: 4px 0;

  font-size: 18px;

}


.formation-admin-card p {

  margin: 0 0 12px;

  color: #888;

  font-size: 11px;

  line-height: 1.6;

}


.formation-admin-card strong {

  color: var(--orange);

  font-size: 16px;

}


.info-box {

  margin-top: 20px;

  padding: 20px;

  border: 1px solid #ffe0cc;

  border-radius: 14px;

  background: #fff9f5;

}


.info-box strong {

  color: var(--orange);

}


.info-box p {

  margin: 8px 0 0;

  color: #777;

  font-size: 12px;

  line-height: 1.7;

}


/* =========================================================
   PAIEMENTS
========================================================= */

.payment-summary {

  display: grid;

  grid-template-columns:
    repeat(3, 1fr);

  gap: 15px;

}


.payment-summary-card {

  padding: 25px;

  border: 1px solid #eee;

  border-radius: 15px;

  background: white;

}


.payment-summary-card span {

  color: #888;

  font-size: 9px;

  font-weight: 800;

}


.payment-summary-card strong {

  display: block;

  margin-top: 8px;

  color: #111;

  font-size: 25px;

}


/* =========================================================
   DELETE MODAL
========================================================= */

.delete-modal {

  position: fixed;

  inset: 0;

  z-index: 99999;

  display: none;

  align-items: center;

  justify-content: center;

  padding: 20px;

  background:
    rgba(0,0,0,.65);

}


.delete-modal.active {

  display: flex;

}


.delete-modal-box {

  width: 100%;

  max-width: 400px;

  padding: 30px;

  border-radius: 18px;

  background: white;

  text-align: center;

  box-shadow:
    0 30px 80px
    rgba(0,0,0,.3);

}


.delete-icon {

  font-size: 35px;

}


.delete-modal-box h3 {

  margin: 15px 0 7px;

}


.delete-modal-box p {

  margin: 0;

  color: #888;

  font-size: 13px;

}


.delete-actions {

  display: flex;

  gap: 10px;

  margin-top: 25px;

}


.cancel-button,
.delete-button {

  flex: 1;

  height: 45px;

  border: 0;

  border-radius: 9px;

  cursor: pointer;

  font-weight: 700;

}


.cancel-button {

  background: #eee;

  color: #555;

}


.delete-button {

  background: var(--red);

  color: white;

}


/* =========================================================
   EMPTY / LOADING
========================================================= */

.empty-state {

  padding: 35px !important;

  text-align: center;

  color: #999;

}


.loading-row {

  text-align: center;

  padding: 30px !important;

  color: #999;

}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1100px) {

  .stats-grid {

    grid-template-columns:
      repeat(2, 1fr);

  }


  .stat-card-large {

    grid-column: span 1;

  }


  .formation-admin-grid {

    grid-template-columns:
      1fr;

  }

}


@media (max-width: 800px) {

  :root {

    --sidebar-width: 0px;

  }


  .sidebar {

    width: 260px;

    transform:
      translateX(-100%);

    transition:
      transform .25s ease;

  }


  .sidebar.mobile-open {

    transform:
      translateX(0);

  }


  .admin-main {

    margin-left: 0;

  }


  .admin-header {

    padding: 15px 18px;

  }


  .mobile-menu {

    display: block;

  }


  .admin-content {

    padding: 20px 15px;

  }


  .admin-user .user-info {

    display: none;

  }


  .welcome-card {

    padding: 22px;

  }


  .welcome-icon {

    display: none;

  }

}


@media (max-width: 600px) {

  .stats-grid {

    grid-template-columns: 1fr;

  }


  .stat-card {

    min-height: 95px;

  }


  .section-heading {

    align-items: flex-start;

    flex-direction: column;

  }


  .filters {

    flex-direction: column;

    align-items: stretch;

  }


  .search-box {

    min-width: 0;

  }


  .filters select,
  .refresh-button {

    width: 100%;

  }


  .payment-summary {

    grid-template-columns: 1fr;

  }


  .login-card {

    padding: 28px 20px;

  }


  .login-footer {

    flex-direction: column;

    text-align: center;

  }

}

/* =========================================================
   FORMATIONS - PRIX + COMPTE À REBOURS
   ========================================================= */

.formation-admin-card-content {
  min-width: 0;
  width: 100%;
}

.formation-admin-value-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.formation-admin-value-row > strong {
  color: var(--orange);
  font-size: 19px;
  font-weight: 800;
}

.formation-inscrits-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 9px;
  border-radius: 999px;
  background: #f7f7f7;
  color: #777;
  font-size: 10px;
  font-weight: 700;
}

.formation-admin-editor {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #eeeeee;
}

.formation-admin-editor label {
  display: block;
  margin: 0 0 6px;
  color: #666;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.formation-admin-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.formation-admin-input-row input {
  min-width: 0;
  flex: 1;
  height: 39px;
  padding: 0 10px;
  border: 1px solid #e8e8e8;
  border-radius: 9px;
  background: #fff;
  color: #222;
  outline: none;
  font-size: 12px;
}

.formation-admin-input-row input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(249,101,13,.08);
}

.formation-admin-editor small {
  display: block;
  margin: -2px 0 10px;
  color: #888;
  font-size: 10px;
  line-height: 1.5;
}

.formation-save-countdown {
  width: 100%;
  margin-top: 2px;
}

@media (max-width: 700px) {
  .formation-admin-input-row {
    flex-direction: column;
    align-items: stretch;
  }

  .formation-admin-input-row .small-button {
    width: 100%;
  }
}


/* =========================================================
   MFACADEMY — PAIEMENTS / ADMINS / DOCUMENTS
========================================================= */
.owner-only[hidden] { display: none !important; }
.admin-form-box { max-width: 680px; width: min(92vw, 680px); }
.admin-form-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin:16px 0; }
.admin-form-input { width:100%; box-sizing:border-box; border:1px solid #d7dce5; border-radius:10px; padding:12px 13px; font:inherit; background:#fff; }
.admin-form-input:focus { outline:none; border-color:#111827; box-shadow:0 0 0 3px rgba(17,24,39,.08); }
.permission-list { display:grid; grid-template-columns:1fr 1fr; gap:10px 16px; text-align:left; margin:14px 0 18px; }
.permission-list label { display:flex; gap:8px; align-items:flex-start; font-size:14px; line-height:1.35; }
.permission-list input { margin-top:3px; }
.admin-form-message { min-height:20px; margin-top:10px; font-size:14px; }
.admin-form-message.error { color:#b42318; }
.muted { opacity:.55; }
.validate-payment { white-space:nowrap; }
.document-download { white-space:nowrap; }
@media (max-width: 760px) {
  .admin-form-grid, .permission-list { grid-template-columns:1fr; }
}


/* Export buttons */
.export-button {
  white-space: nowrap;
}


/* Analytics ajouté sans modifier le reste du dashboard */
.analytics-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px;margin:20px 0;}
.analytics-card{background:#fff;border:1px solid #e7eaf0;border-radius:18px;padding:22px;display:flex;align-items:center;gap:16px;box-shadow:0 8px 24px rgba(15,23,42,.05);min-height:96px;}
.analytics-card-icon{width:50px;height:50px;border-radius:15px;display:grid;place-items:center;background:#f3f6fb;font-size:25px;flex:none;}
.analytics-card span{display:block;font-size:12px;font-weight:800;letter-spacing:.04em;color:#6b7280;margin-bottom:7px;}
.analytics-card strong{font-size:30px;line-height:1.1;color:#111827;font-weight:800;}
.analytics-message{min-height:0;margin:4px 0 0;color:#64748b;font-size:14px;}
.analytics-message.error{color:#b91c1c;}
.analytics-seven-card{margin-top:18px;}
.analytics-daily-list{display:grid;gap:0;padding:0;}
.analytics-day-row{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:16px 4px;border-bottom:1px solid #eef1f5;font-size:14px;}
.analytics-day-row:last-child{border-bottom:0;}
.analytics-day-row>span{color:#475569;font-weight:700;}
.analytics-day-count{display:flex;align-items:baseline;gap:7px;min-width:95px;justify-content:flex-end;}
.analytics-day-count strong{text-align:right;color:#111827;font-size:16px;}
.analytics-day-count em{font-style:normal;color:#64748b;font-size:13px;}
.analytics-bar{display:none;}
.analytics-empty{padding:24px 0;text-align:center;color:#94a3b8;}
@media (max-width:1100px){.analytics-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media (max-width:650px){.analytics-grid{grid-template-columns:1fr;} .analytics-day-row{padding:14px 0;}}
