:root{
  --bg:#f6f7fb;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#64748b;
  --nav:#2c3e50;
  --nav2:#34495e;
  --primary:#2a4eff;
  --border:#e6eaf2;
  --shadow:0 10px 30px rgba(2,6,23,.08);
  --radius:16px;
  --container:1200px;
}


.topbar{position:sticky;top:0;z-index:50;background:#2c3e50;color:#fff}
.topbar__inner{max-width:1200px;margin:0 auto;display:flex;align-items:center;gap:14px;padding:12px 16px}

.brand{color:#fff;text-decoration:none;font-weight:700;white-space:nowrap}

.burger{display:none;margin-left:auto;background:transparent;border:1px solid rgba(255,255,255,.25);
  color:#fff;border-radius:10px;padding:6px 10px;cursor:pointer}

.menu{flex:1;display:flex;align-items:center;gap:10px;flex-wrap:nowrap;min-width:0}
.menu a{color:#fff;text-decoration:none;padding:8px 10px;border-radius:10px;white-space:nowrap}
.menu a:hover{background:rgba(255,255,255,.12)}

.menu__right{margin-left:auto;display:flex;align-items:center;gap:10px;min-width:0}
.user{opacity:.9;white-space:nowrap}
.logout{background:rgba(255,255,255,.10)}

@media (max-width:768px){
  .burger{display:inline-flex}
  .menu{display:none;position:absolute;left:0;right:0;top:56px;background:#2c3e50;
        padding:12px 16px;flex-direction:column;align-items:stretch;gap:8px}
  .menu.is-open{display:flex}
  .menu__right{margin-left:0;flex-direction:column;align-items:stretch}
  .menu a,.user{width:100%}
}

/* reset */
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:var(--bg);
  color:var(--text);
}
a{color:inherit;text-decoration:none}
img{max-width:100%;height:auto}
.container{
  width:min(92%, var(--container));
  margin:24px auto;
}

/* NAVBAR */
.nav{
  position:sticky; top:0; z-index:1000;
  background:var(--nav);
  color:#fff;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.nav__inner{
  width:min(92%, var(--container));
  margin:0 auto;
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px 0;
}
.nav__brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:800;
  letter-spacing:.2px;
}
.nav__brand a{color:#fff}
.nav__spacer{flex:1}

/* Desktop links */
.nav__links{
  display:flex;
  align-items:center;
  gap:6px;
}
.nav__link{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 12px;
  border-radius:10px;
  color:#fff;
  font-weight:600;
  font-size:14px;
  opacity:.95;
}
.nav__link:hover{background:var(--nav2)}
.nav__link.is-active{background:rgba(255,255,255,.12)}
.nav__user{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:600;
  white-space:nowrap;
}
.nav__pill{
  padding:8px 10px;
  border-radius:999px;
  background:rgba(255,255,255,.10);
  font-size:13px;
}

/* Hamburger (mobile) */
.nav__toggle{
  display:none;
  align-items:center;
  justify-content:center;
  width:42px;height:42px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.18);
  background:rgba(255,255,255,.06);
  color:#fff;
  cursor:pointer;
}
.nav__toggle:active{transform:scale(.98)}
.nav__toggle span{
  display:block;width:18px;height:2px;background:#fff;position:relative;border-radius:2px;
}
.nav__toggle span:before,.nav__toggle span:after{
  content:"";position:absolute;left:0;width:18px;height:2px;background:#fff;border-radius:2px;
}
.nav__toggle span:before{top:-6px}
.nav__toggle span:after{top:6px}

/* Mobile drawer */
.backdrop{
  display:none;
  position:fixed; inset:0;
  background:rgba(2,6,23,.55);
  z-index:1200;
}
.drawer{
  display:none;
  position:fixed;
  top:0; right:0;
  height:100%;
  width:min(86vw, 360px);
  background:#0b1220;
  color:#fff;
  z-index:1300;
  box-shadow: -20px 0 60px rgba(0,0,0,.35);
  padding:16px;
}
.drawer__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding-bottom:12px;
  border-bottom:1px solid rgba(255,255,255,.10);
}
.drawer__close{
  width:42px;height:42px;border-radius:12px;
  border:1px solid rgba(255,255,255,.18);
  background:rgba(255,255,255,.06);
  color:#fff; cursor:pointer;
}
.drawer__links{
  display:flex;
  flex-direction:column;
  gap:8px;
  padding:14px 0;
}
.drawer__link{
  padding:12px 12px;
  border-radius:12px;
  background:rgba(255,255,255,.06);
  color:#fff;
  font-weight:700;
}
.drawer__link:hover{background:rgba(255,255,255,.10)}
.drawer__user{
  margin-top:10px;
  padding-top:12px;
  border-top:1px solid rgba(255,255,255,.10);
  color:rgba(255,255,255,.9);
  font-weight:700;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.drawer__logout{
  background:#ef4444;
  padding:12px 12px;
  border-radius:12px;
  color:#fff;
  font-weight:800;
  text-align:center;
}

/* Cards */
.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:18px;
}

/* Forms */
input, select, button{
  font:inherit;
}
.field{
  width:100%;
  padding:12px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:#fff;
  outline:none;
}
.field:focus{
  border-color:rgba(42,78,255,.35);
  box-shadow:0 0 0 4px rgba(42,78,255,.12);
}
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  border:0;
  border-radius:12px;
  padding:12px 14px;
  cursor:pointer;
  font-weight:800;
}
.btn-primary{background:var(--primary); color:#fff}
.btn-secondary{background:#e5e7eb; color:#111827}
.btn-danger{background:#ef4444;color:#fff}

/* Table wrapper for mobile */
.table-wrap{
  width:100%;
  overflow:auto;
  border-radius:14px;
  border:1px solid var(--border);
  background:#fff;
}
table{width:100%; border-collapse:separate; border-spacing:0}
thead th{
  position:sticky; top:0;
  background:#f3f6ff;
  color:#334155;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.06em;
  padding:12px;
  border-bottom:1px solid var(--border);
}
tbody td{
  padding:12px;
  border-bottom:1px solid var(--border);
  vertical-align:top;
  font-size:14px;
}
/* --- Forms responsive --- */
.form-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}

.form-grid .full{
  grid-column: 1 / -1;
}

.field{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.field input, .field select, .field button, input[type="file"]{
  width:100%;
  max-width:100%;
  box-sizing:border-box;
}

/* bloc couleur + image */
.color-group{
  display:grid;
  grid-template-columns: 1fr 1fr auto; /* couleur | fichier | bouton X */
  gap:10px;
  align-items:center;
  width:100%;
}

.color-group input[type="file"]{
  min-width: 0; /* important pour éviter overflow */
}

.remove-color{
  width:auto !important;
  padding:10px 12px;
  border-radius:10px;
}

/* Mobile */
@media (max-width:768px){
  .form-grid{ grid-template-columns: 1fr; }
  .color-group{
    grid-template-columns: 1fr; /* tout en colonne */
  }
  .remove-color{
    width:100% !important;
  }
}

tbody tr:hover td{background:#fafbff}

/* Search bar grid (auto responsive, pas d’erreur) */
.search-bar{
  display:grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr;
  gap:10px;
  margin-bottom:14px;
}
@media (max-width: 980px){
  .search-bar{grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px){
  .search-bar{grid-template-columns: 1fr; }
}

/* Mobile rules */
@media (max-width: 820px){
  .nav__links, .nav__user{display:none}
  .nav__toggle{display:flex}
  .container{margin:16px auto}
}
