/* =========================================================
   VARIABLES
========================================================= */
:root{
  --dark:#1c1c1c;
  --darker:#121212;
  --light:#f4f4f4;

  --text:#222;
  --text-muted:#888;
  --white:#fff;

  --orange:#f57c00;
  --orange-hover:#ff9800;

  --radius:10px;
  --shadow:0 10px 25px rgba(0,0,0,.12);

  --header-h:60px;
  --sidebar-w:230px;

  --font:"Segoe UI",Roboto,Arial,sans-serif;
}

/* =========================================================
   RESET
========================================================= */
*{
  margin:0;
  padding:0;
  box-sizing:border-box;
}

html,body{
  height:100%;
}

a{
  text-decoration:none !important;
  color:inherit;
}

/* =========================================================
   BODY
========================================================= */
body.admin-body{
  font-family:var(--font);
  background:var(--light);
  color:var(--text);
}

/* =========================================================
   HEADER
========================================================= */
.admin-topbar{
  height:var(--header-h);
  background:linear-gradient(90deg,#0f0f0f,#1c1c1c);
  border-bottom:3px solid var(--orange);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 25px;
  color:var(--white);
}

.admin-brand{
  font-size:20px;
  font-weight:800;
  letter-spacing:.5px;
}

.admin-brand span{
  color:var(--orange);
}

.admin-user{
  font-size:14px;
  opacity:.85;
}

/* =========================================================
   LAYOUT
========================================================= */
.admin-layout{
  display:flex;
  min-height:calc(100vh - var(--header-h));
}

/* =========================================================
   SIDEBAR
========================================================= */
.admin-sidebar{
  width:var(--sidebar-w);
  background:var(--dark);
  padding:18px 14px;
}

.admin-sidebar ul{
  list-style:none;
}

.admin-sidebar li{
  margin-bottom:6px;
}

.admin-sidebar a{
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px 15px;
  font-size:14px;
  color:#eee;
  border-radius:8px;
  transition:.2s;
}

.admin-sidebar a:hover,
.admin-sidebar a.active{
  background:var(--orange);
  color:#fff;
}

.admin-sidebar .logout a{
  background:#2b1a1a;
  color:#ffb3b3;
}

.admin-sidebar .logout a:hover{
  background:#3a1a1a;
}

/* =========================================================
   CONTENT
========================================================= */
.admin-content{
  flex:1;
  padding:30px;
  background:var(--light);
}

.admin-content h1{
  font-size:26px;
  margin-bottom:10px;
}

.admin-content p{
  color:#555;
  margin-bottom:25px;
}

/* =========================================================
   DASHBOARD CARDS (BOUTONS)
========================================================= */
.admin-cards{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
  gap:22px;
}

.admin-card{
  background:#fff;
  padding:22px;
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  border-left:6px solid var(--orange);
  transition:.2s;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.admin-card:hover{
  transform:translateY(-4px);
  box-shadow:0 16px 30px rgba(0,0,0,.18);
}

.admin-card h3{
  font-size:17px;
  font-weight:700;
  display:flex;
  align-items:center;
  gap:10px;
}

/* ICÔNES PLUS GRANDES */
.admin-card h3 span,
.admin-card h3 i{
  font-size:26px;
}

.admin-card p{
  font-size:14px;
  color:#666;
}

/* =========================================================
   TABLES
========================================================= */
table{
  width:100%;
  border-collapse:collapse;
  background:#fff;
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden;
}

th{
  background:#eee;
  padding:12px;
  font-size:13px;
  text-align:left;
}

td{
  padding:12px;
  border-bottom:1px solid #ddd;
}

tr:hover td{
  background:#fafafa;
}

/* =========================================================
   FORMULAIRES
========================================================= */
label{
  display:block;
  margin-bottom:6px;
  font-size:13px;
  color:#444;
}

input,textarea,select{
  width:100%;
  padding:11px 12px;
  margin-bottom:16px;
  border-radius:8px;
  border:1px solid #ccc;
  font-family:var(--font);
}

input:focus,
textarea:focus,
select:focus{
  outline:none;
  border-color:var(--orange);
}

button,
.btn-secondary{
  display:inline-block;
  padding:10px 18px;
  border-radius:8px;
  font-weight:700;
  cursor:pointer;
}

button{
  background:var(--orange);
  border:none;
  color:#fff;
}

button:hover{
  background:var(--orange-hover);
}

.btn-secondary{
  background:#ddd;
  color:#222;
}

.btn-secondary:hover{
  background:#ccc;
}

/* =========================================================
   LOGIN
========================================================= */
.admin-login-page{
  display:flex;
  justify-content:center;
  align-items:center;
  background:linear-gradient(135deg,#0e0e0e,#2a2a2a);
}

.admin-login-box{
  width:380px;
  background:#1b1b1b;
  padding:35px;
  border-radius:12px;
  box-shadow:0 20px 40px rgba(0,0,0,.6);
  color:#fff;
}

.admin-login-title{
  text-align:center;
  font-size:24px;
}

.admin-login-title span{
  color:var(--orange);
}

.admin-login-subtitle{
  text-align:center;
  color:#aaa;
  margin-bottom:25px;
}

.admin-login-box input{
  background:#111;
  border:1px solid #333;
  color:#fff;
}

.admin-login-box button{
  width:100%;
}

.admin-back{
  display:block;
  margin-top:18px;
  text-align:center;
  color:var(--orange);
}

a {
  text-decoration: none;
}

.admin-card {
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}

.admin-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0,0,0,.15);
}

.btn {
  display:inline-block;
  background:#f57c00;
  color:#fff;
  padding:10px 16px;
  border-radius:6px;
  font-weight:600;
}

.btn:hover {
  background:#ff9800;
}

.admin-alert {
  padding:15px;
  border-radius:6px;
  margin-bottom:20px;
}

.admin-alert.error {
  background:#ffe0e0;
  color:#900;
}

.admin-alert.info {
  background:#eef4ff;
  color:#224;
}

.admin-card {
  background:#fff;
  padding:25px;
  border-radius:10px;
  box-shadow:0 10px 25px rgba(0,0,0,.08);
  margin-bottom:25px;
}

.admin-card-danger {
  border-left:5px solid #f57c00;
  background:#fffaf5;
}

.card-head {
  display:flex;
  justify-content:space-between;
  align-items:center;
}

.badge-warning {
  background:#ff9800;
  color:#fff;
  padding:4px 10px;
  border-radius:20px;
  font-size:12px;
}

.help {
  font-size:13px;
  color:#666;
  margin-top:8px;
}

.form-actions {
  margin-top:30px;
}

.admin-table{
  margin-bottom:30px;
}

.admin-table td,
.admin-table th{
  vertical-align:middle;
}

.center{
  text-align:center;
}

/* INPUTS */
.admin-table input,
.admin-table select{
  height:38px;
  margin:0;
}

/* CELL PASSWORD */
.password-cell{
  display:flex;
  align-items:center;
  gap:6px;
}

/* ROLE CELL */
.role-cell form{
  display:flex;
  gap:6px;
  align-items:center;
}

/* ACTIONS */
.actions-cell{
  display:flex;
  justify-content:center;
}

/* ICON BUTTONS */
.icon-btn{
  width:36px;
  height:36px;
  border-radius:6px;
  border:none;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:16px;
}

.icon-btn.success{ background:#f57c00;color:#fff; }
.icon-btn.warning{ background:#ff9800;color:#fff; }
.icon-btn.danger{ background:#d32f2f;color:#fff; }
.icon-btn:hover{ opacity:.85; }

/* PASSWORD TOGGLE */
.toggle-pwd{
  background:#eee;
}

/* MUTED */
.muted{
  color:#999;
}

/* ==== Admin UI fixes ==== */
.admin-table select{
  background:#fff;
  min-width:220px;
}

.admin-table .actions-row,
.actions-row{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  flex-wrap:wrap;
}

.icon-btn{
  width:38px;
  height:38px;
  border-radius:8px;
}

.table-wrap{
  border-left:6px solid var(--orange);
  border-radius:var(--radius);
  overflow:hidden;
  box-shadow:var(--shadow);
  background:#fff;
}

/* ================================
   MESSAGERIE – TABLE AVEC EFFET ORANGE
================================ */

.admin-content > table {
  width: 100%;
  border-collapse: collapse;

  /* effet card */
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0,0,0,.12);

  /* BARRE ORANGE */
  border-left: 6px solid var(--orange);

  overflow: hidden;
}

/* HEADER */
.admin-content > table th {
  background: #f0f0f0;
  padding: 12px;
  font-size: 13px;
  text-align: left;
}

/* CELLULES */
.admin-content > table td {
  padding: 12px;
  border-bottom: 1px solid #e0e0e0;
  vertical-align: middle;
}

/* SURVOL */
.admin-content > table tr:hover td {
  background: #fafafa;
}

/* EMAIL EN GRIS */
.admin-content table small {
  color: #777;
}

/* BOUTON OUVRIR ALIGNÉ */
.admin-content table td:last-child {
  text-align: right;
}

/* ================================
   MESSAGERIE – BARRE ORANGE FINALE
================================ */

/* La table est déjà en card → on ajoute juste l’accent Impact */
.admin-content table {
  border-left: 6px solid var(--orange);
}

/* Optionnel : arrondi propre côté gauche */
.admin-content table {
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}

/* =====================================
   MESSAGERIE – BARRE ORANGE GARANTIE
===================================== */

/* Neutralise le collapse UNIQUEMENT ici */
.admin-content > table {
  border-collapse: separate !important;
  border-spacing: 0;
  position: relative;

  background: #fff;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0,0,0,.12);
  overflow: hidden;
}

/* Barre orange via pseudo-élément (indestructible) */
.admin-content > table::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: var(--orange);
}

/* Ajustement padding pour ne pas coller la barre */
.admin-content > table th:first-child,
.admin-content > table td:first-child {
  padding-left: 18px;
}
