/* =========================================================
   VARIABLES
   ========================================================= */

:root{
  --border:#e5e7eb;
  --muted:#6b7280;
  --link:#2563eb;
  --bg:#ffffff;
  --soft:#f9fafb;
  --text:#111827;

  --accent:#218D80;
  --sidebar:#173F35;

  --swal-content-width:380px;
}

/* =========================================================
   BASE LAYOUT
   ========================================================= */

*{
  box-sizing:border-box;
}

body{
  font-family:Arial, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  margin:0;
  height:100vh;
  display:flex;
  background:var(--bg);
  color:var(--text);
}

/* =========================================================
   SIDEBAR
   ========================================================= */

aside{
  width:320px;
  padding:24px 14px 14px 14px; /* avant 14px */

  display:flex;
  flex-direction:column;
  gap:12px;
  overflow:hidden;

  background:var(--sidebar);
  color:#fff;
  border-right:1px solid rgba(255,255,255,.12);
}

aside .muted{
  color:rgba(255,255,255,0.75);
}

aside select{
  background:rgba(255,255,255,0.10);
  border:1px solid rgba(255,255,255,0.18);
  color:#fff;
  border-radius:0;
}

aside select option{
  color:#111827;
}

/* =========================================================
   MAIN
   ========================================================= */

main{
  flex:1;
  padding:10px 14px 14px 14px; /* avant 14 partout */

  display:flex;
  flex-direction:column;
  gap:10px;

  min-width:0;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;

  gap:12px;

  min-height:42px; /* harmonise la hauteur */
}

/* réduit l'effet "grosse bande blanche" */

.title{
  font-weight:800;
  font-size:32px;

  letter-spacing:.2px;
  margin:0 0 24px 0;

  color:#d1b252; /* optionnel mais très classe */
  line-height:1;
}


/* =========================================================
   UI CONTROLS
   ========================================================= */

.btn{
  border:1px solid var(--border);
  background:#fff;
  padding:8px 10px;
  border-radius:0;
  cursor:pointer;
  font-size:13px;
}

.btn:hover{
  background:var(--soft);
}

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

select{
  width:100%;
  padding:10px;
  border:1px solid var(--border);
  border-radius:0;
  background:#fff;
}

/* =========================================================
   MENU
   ========================================================= */

#audienceWrap{
  margin-bottom:16px;
}

#menu{
  overflow:auto;
  padding-right:4px;
  padding-top:18px; /* avant 10px */
  border-top:none !important;
}

a.menu-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;

  padding:7px 0;

  text-decoration:none;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;

  border-bottom:1px solid rgba(255,255,255,.12);

  color:#fff;
  font-weight:700;
}

a.menu-item:hover{
  background:rgba(255,255,255,.06);
  text-decoration:none;
}

a.menu-item .count{
  color:rgba(255,255,255,.75);
  font-weight:600;
  font-size:12px;
  flex:0 0 auto;
}

a.menu-item.active{
  background:var(--accent);
  border-radius:0;
  padding-left:10px;
  padding-right:10px;
}

a.menu-item.active .count{
  color:rgba(255,255,255,.9);
}

/* =========================================================
   PILLS
   ========================================================= */

.pill{
  display:inline-block;
  padding:2px 8px;
  border:1px solid var(--border);
  border-radius:0;
  font-size:12px;
  color:var(--muted);

  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:100%;
}

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

#fixedTop{
  margin-bottom:4px;
}

#fixedBottom{
  margin-top:6px;
  margin-bottom:12px;
}

#fixedTop,
#fixedBottom{
  border:0 !important;
  padding:0;
}

/* =========================================================
   IFRAME
   ========================================================= */

#frameWrap{
  position:relative;
  flex:1;
  min-height:0;
}

iframe{
  width:100%;
  height:100%;
  border:none;
  border-radius:0;
}

/* =========================================================
   SPINNER
   ========================================================= */

#spinner{
  position:absolute;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  background:rgba(255,255,255,.75);
  backdrop-filter:blur(2px);
  z-index:10;
}

#spinner .dot{
  width:34px;
  height:34px;

  border:4px solid #ddd;
  border-top-color:var(--link);

  border-radius:0;

  display:inline-block;
  animation:spin .8s linear infinite;
}

#spinner .label{
  margin-top:10px;
  color:var(--muted);
  font-size:13px;
  text-align:center;
}

@keyframes spin{
  to{
    transform:rotate(360deg);
  }
}

/* =========================================================
   STATUS
   ========================================================= */

#status{
  color:var(--muted);
  font-size:12px;
}

.danger{
  color:#b91c1c;
}

/* =========================================================
   SWEETALERT2
   ========================================================= */

body.swal2-shown.swal2-height-auto{
  height:100vh !important;
  padding-bottom:0 !important;
}

.swal2-container,
.swal2-popup,
.swal2-title,
.swal2-html-container,
.swal2-input,
.swal2-validation-message,
.swal2-confirm,
.swal2-deny,
.swal2-cancel{
  font-family:inherit !important;
}

.swal2-popup{
  box-sizing:border-box !important;
  border-radius:0 !important;
  width:min(92vw,480px) !important;
  max-width:480px !important;
  padding:22px 22px 18px 22px !important;
  box-shadow:0 12px 34px rgba(0,0,0,.22) !important;
  text-align:left !important;
}

.swal2-title,
.swal2-html-container,
.swal2-input,
.swal2-actions{
  width:100% !important;
  max-width:var(--swal-content-width) !important;
  margin-left:0 !important;
  margin-right:0 !important;
}

.swal2-title{
  color:var(--text) !important;
  font-size:22px !important;
  font-weight:750 !important;
  line-height:1.2 !important;
  text-align:left !important;
  margin:0 0 14px 0 !important;
  padding:0 !important;
}

.swal2-html-container{
  color:var(--text) !important;
  font-size:13px !important;
  line-height:1.5 !important;
  font-weight:500 !important;

  text-align:left !important;

  margin:0 0 14px 0 !important;
  padding:0 !important;
}

.swal2-input{
  width:100% !important;
  height:38px !important;
  margin:8px 0 14px 0 !important;
  padding:8px 10px !important;

  border-radius:0 !important;
  border:1px solid rgba(15,23,42,.18) !important;
  box-shadow:none !important;
}

.swal2-input:focus{
  border-color:rgba(33,141,128,.55) !important;
  box-shadow:0 0 0 2px rgba(33,141,128,.12) !important;
}

.swal2-confirm{
  background:var(--sidebar) !important;
  color:#fff !important;
}

.swal2-deny{
  background:#EEA000 !important;
  color:#fff !important;
}

.swal2-cancel{
  background:#6b7280 !important;
  color:#fff !important;
}

.swal2-confirm,
.swal2-deny,
.swal2-cancel{
  height:36px !important;
  min-width:110px !important;
  padding:0 14px !important;

  border:none !important;
  border-radius:0 !important;

  font-size:13px !important;
  font-weight:700 !important;
}

.swal2-actions{
  display:flex !important;
  flex-wrap:nowrap !important;
  justify-content:flex-start !important;
  align-items:center !important;
  gap:10px !important;
  margin:14px 0 0 0 !important;
}

.swal-email{
  margin:0 0 10px 0 !important;
  font-weight:700 !important;
  color:var(--text) !important;
  font-size:13px !important;
}

.swal2-backdrop-show{
  background:rgba(0,0,0,.32) !important;
}

/* =========================================================
   MOBILE
   ========================================================= */

#btnMenu{
  display:none;
}

@media (max-width:820px){

  body{
    display:block;
    height:100vh;
    overflow:hidden;
  }

  main{
    height:100vh;
    padding:10px;
  }

  .topbar{
    position:sticky;
    top:0;
    z-index:5;
    background:var(--bg);
    padding:10px 0;
  }

  aside{
    position:fixed;
    top:0;
    left:0;
    height:100vh;
    width:min(86vw,360px);

    z-index:20;

    transform:translateX(-105%);
    transition:transform .22s ease;

    box-shadow:0 10px 30px rgba(0,0,0,.25);
  }

  body.menu-open aside{
    transform:translateX(0);
  }

  #overlay{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.35);
    z-index:15;
    display:none;
  }

  body.menu-open #overlay{
    display:block;
  }

  #frameWrap{
    height:calc(100vh - 64px);
  }

  #btnMenu{
    display:inline-block;
  }
}