:root {
  /* Couleurs de marque Kevla : vert profond, blanc, jaune */
  --brand: #0d5c3f;
  --brand-dark: #073d2a;
  --brand-deep: #052a1d;
  --brand-soft: #e8f3ee;
  --brand-mid: #14795a;
  --accent: #f5b301;
  --accent-dark: #c98d00;
  --accent-soft: #fff6d9;

  /* Rappel des anciennes variables (alias sur la charte) */
  --blue: var(--brand);
  --blue-dark: var(--brand-dark);
  --blue-soft: var(--brand-soft);

  --ink: #16202f;
  --ink-soft: #5b6675;
  --line: #e3e8ef;
  --bg: #f5f8f6;
  --white: #ffffff;

  /* Etats (semantique, inchange) */
  --green: #12805c;
  --green-soft: #e2f5ee;
  --amber: #b26a00;
  --amber-soft: #fdf1dc;
  --red: #c02626;
  --red-soft: #fdeaea;
  --violet: #6b46c1;
  --violet-soft: #f0eafc;

  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", -apple-system, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ------------------------------------------------------------ layout */
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 18px; }

.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.topbar .wrap { display: flex; align-items: center; gap: 14px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { height: 40px; width: auto; max-width: 190px; object-fit: contain; display: block; }
.brand .tag { font-size: 11px; color: var(--ink-soft); letter-spacing: .3px; }

.topnav { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.topnav button {
  background: none; border: 0; padding: 8px 13px; border-radius: 8px;
  font-size: 14px; color: var(--ink-soft); font-weight: 500;
}
.topnav button:hover { background: var(--blue-soft); color: var(--blue-dark); }
.topnav button.on { background: var(--blue-soft); color: var(--blue-dark); font-weight: 600; }

.cart-btn {
  position: relative; background: var(--brand); color: #fff; border: 0;
  padding: 9px 14px; border-radius: 9px; font-weight: 600; font-size: 14px;
  display: flex; align-items: center; gap: 8px; cursor: pointer;
}
.cart-btn:hover { background: var(--brand-dark); }
.cart-icon { display: grid; place-items: center; opacity: .95; }
.cart-count {
  background: var(--white); color: var(--brand-dark); border-radius: 20px;
  min-width: 20px; height: 20px; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; padding: 0 5px;
}
/* Montant selectionne, affiche directement dans le bouton Panier */
.cart-total {
  background: var(--accent); color: #1c1c1c; border-radius: 7px;
  padding: 3px 9px; font-size: 13px; font-weight: 700;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}

/* Bandeau flottant : recapitulatif apres ajout */
.cart-bar {
  background: var(--brand-dark); color: #fff; padding: 11px 0;
  box-shadow: 0 4px 14px rgba(5, 42, 29, .25); position: relative; z-index: 5;
  animation: slideDown .2s ease;
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } }
.cart-bar .wrap {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.cart-bar-txt { font-size: 14.5px; flex: 1; min-width: 190px; }
.cart-bar-txt strong { color: var(--accent); font-variant-numeric: tabular-nums; }
.cart-bar-btn {
  background: var(--accent); color: #1c1c1c; border: 0; cursor: pointer;
  padding: 8px 16px; border-radius: 8px; font-weight: 650; font-size: 13.5px;
  white-space: nowrap;
}
.cart-bar-btn:hover { background: var(--accent-dark); }
/* Soulignement bref du bandeau apres un ajout */
.cart-bar.flash { animation: slideDown .2s ease, flashBar .5s ease .05s; }
@keyframes flashBar {
  0% { background: var(--brand-dark); }
  35% { background: var(--brand-mid); }
  100% { background: var(--brand-dark); }
}

@media (max-width: 620px) {
  .cart-label { display: none; }
  .topbar .wrap { gap: 8px; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 12px; }

  /* Barre de navigation : sur mobile le logo et la slogan superflues sont
     masques, la navigation et le panier occupent toute la largeur. */
  .topbar { position: sticky; top: 0; z-index: 60; }
  .topbar .wrap { flex-wrap: wrap; gap: 8px; padding-top: 8px; padding-bottom: 8px; }
  .topbar .brand { display: none; }
  .topnav { width: 100%; margin-left: 0; order: 3; gap: 6px; }
  .topnav > button { flex: 1 1 auto; padding: 10px 6px; font-size: 13px; }
  /* Le panier reste compact pour laisser la place aux trois onglets */
  .topnav .cart-btn { flex: 0 0 auto; padding: 9px 11px; gap: 6px; }
  .topnav .cart-btn .cart-total { padding: 3px 7px; font-size: 12.5px; }

  /* Banniere d'accueil */
  .hero { padding: 12px 0 14px; }
  .hero-banner { border-radius: 10px; }
  .hero .whatsapp-cta { margin-top: 10px; gap: 7px; }
  .btn-wa, .btn-outline-wa { flex: 1 1 auto; justify-content: center; padding: 11px 12px; }

  /* Filtres sur deux lignes */
  .catalogue-bar { flex-wrap: wrap; gap: 8px; }
  .catalogue-bar .input, .catalogue-bar .select { max-width: none !important; flex: 1 1 140px; }

  /* Catalogue : une colonne, cartes compactes et lisibles */
  .product-grid { grid-template-columns: 1fr; gap: 10px; }
  .product-info { padding: 12px 13px; gap: 7px; }
  .product-name { font-size: 15.5px; line-height: 1.3; }
  .product-sku { font-size: 11px; }
  .product-price { font-size: 19px; }
  /* Boutons de commande places au-dessus du nom du produit */
  .product-actions {
    display: flex; gap: 8px; align-items: center;
    margin-bottom: 2px;
  }
  .product-actions .stepper { flex: 1 1 auto; max-width: 150px; }
  .product-actions .stepper input { height: 38px; font-size: 15px; }
  .product-actions .stepper button { width: 38px; height: 38px; }
  .product-actions .btn { flex: 0 0 auto; min-height: 38px; padding: 8px 18px; font-size: 14px; }

  /* Panier */
  .cart-layout { grid-template-columns: 1fr; }
  .btn { font-size: 14px; }
  .input, .select, .textarea { font-size: 16px; }  /* evite le zoom auto iOS */
  .modal-bg { padding: 10px; }
  .modal { padding: 18px 16px; }
  .welcome-body { padding: 16px 15px 20px; }

  /* Panier : le tableau 5 colonnes devient une liste de cartes, sinon le nom
     du produit se casse en une colonne et la page deborde. */
  .cart-table thead { display: none; }
  .cart-table, .cart-table tbody, .cart-table tr, .cart-table td { display: block; width: 100%; }
  .cart-table tr {
    border: 1px solid var(--line); border-radius: 10px;
    padding: 11px 12px; margin-bottom: 9px; background: var(--white);
    display: grid; grid-template-columns: 1fr auto; gap: 4px 10px;
    align-items: center;
  }
  .cart-table td { padding: 0; border: 0; }
  .cart-cell-name { grid-column: 1 / -1; }
  .cart-cell-name > div:first-child { font-size: 14.5px; line-height: 1.3; }
  .cart-cell-unit { grid-column: 1; text-align: left; font-size: 12.5px; color: var(--ink-soft); }
  .cart-cell-unit::before { content: "Prix unitaire : "; }
  .cart-cell-qty { grid-column: 2; }
  .cart-cell-qty .stepper { margin-left: 0 !important; }
  .cart-cell-total { grid-column: 1; text-align: left; font-size: 14px; }
  .cart-cell-total::before { content: "Total : "; }
  .cart-cell-del { grid-column: 2; }
  .cart-cell-del .btn { padding: 6px 12px; font-size: 12.5px; }
}

@media (max-width: 380px) {
  .product-actions { flex-wrap: wrap; }
  .product-actions .stepper { max-width: 100%; }
  /* Tres petit ecran : le panier passe sous les onglets */
  .topnav { flex-wrap: wrap; }
  .topnav > button:not(.cart-btn) { flex: 1 1 30%; }
  .topnav .cart-btn { flex: 1 1 100%; justify-content: center; margin-top: 4px; }
}

/* ------------------------------------------------------------ pieces communes */
.panel {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.panel-head {
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.panel-head h2 { font-size: 16px; font-weight: 650; }
.panel-body { padding: 20px; }

.btn {
  border: 1px solid var(--line); background: var(--white); color: var(--ink);
  padding: 9px 16px; border-radius: 9px; font-size: 14px; font-weight: 550;
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
}
.btn:hover { border-color: #c9d2df; background: #fbfcfe; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }

/* Bouton d'action principal (validation de commande) : jaune de marque */
.btn-success { background: var(--accent); border-color: var(--accent); color: #1c1c1c; }
.btn-success:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #1c1c1c; }
.btn-danger { background: var(--red-soft); border-color: #f4c9c9; color: var(--red); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--blue); }
.btn-sm { padding: 5px 11px; font-size: 13px; border-radius: 7px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.field { margin-bottom: 15px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: var(--ink); }
.field .req { color: var(--red); }
.field .hint { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
.input, .select, .textarea {
  width: 100%; padding: 9px 12px; border: 1px solid #d3dae4;
  border-radius: 9px; background: var(--white); color: var(--ink);
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(13, 92, 63, .16);
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }

.tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px;
  border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.tag-a-verifier { background: var(--amber-soft); color: var(--amber); }
.tag-en-preparation { background: var(--violet-soft); color: var(--violet); }
.tag-en-livraison { background: var(--blue-soft); color: var(--blue-dark); }
.tag-livree { background: var(--green-soft); color: var(--green); }
.tag-annulee { background: var(--red-soft); color: var(--red); }
.tag-neutral { background: #eef1f5; color: var(--ink-soft); }
.tag-warn { background: var(--amber-soft); color: var(--amber); }

table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--ink-soft); font-weight: 700; padding: 10px 12px;
  border-bottom: 1px solid var(--line); background: #fafbfd;
}
td { padding: 11px 12px; border-bottom: 1px solid #f0f3f7; font-size: 14px; vertical-align: middle; }
tbody tr:hover { background: #fafcff; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.empty { padding: 44px 20px; text-align: center; color: var(--ink-soft); }
.empty .big { font-size: 34px; margin-bottom: 10px; opacity: .55; }

/* ------------------------------------------------------------ toast */
#toasts {
  position: fixed; top: 78px; right: 18px; z-index: 200;
  display: flex; flex-direction: column; gap: 9px; max-width: 380px;
}
.toast {
  background: var(--ink); color: #fff; padding: 12px 15px; border-radius: 10px;
  font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.22); animation: slide .25s ease;
}
.toast.ok { background: #10684b; }
.toast.err { background: #a91f1f; }
@keyframes slide { from { opacity: 0; transform: translateX(24px); } }

/* ------------------------------------------------------------ modale */
.modal-bg {
  position: fixed; inset: 0; background: rgba(16, 24, 40, .48);
  display: grid; place-items: center; z-index: 150; padding: 18px; overflow-y: auto;
}
.modal {
  background: var(--white); border-radius: 14px; width: 100%; max-width: 560px;
  box-shadow: 0 24px 60px rgba(0,0,0,.3); animation: pop .2s ease; max-height: 92vh;
  display: flex; flex-direction: column;
}
.modal.wide { max-width: 780px; }
.modal-head {
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-head h3 { font-size: 16px; font-weight: 650; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot {
  padding: 14px 20px; border-top: 1px solid var(--line);
  display: flex; justify-content: flex-end; gap: 9px; background: #fafbfd;
  border-radius: 0 0 14px 14px;
}
.x-btn { background: none; border: 0; font-size: 22px; line-height: 1; color: var(--ink-soft); padding: 0 4px; }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(-8px); } }

/* ------------------------------------------------------------ page client */
.hero {
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 100%);
  color: #fff; padding: 22px 0 26px;
}
.hero h1 { font-size: 25px; font-weight: 700; margin-bottom: 5px; }
.hero p { opacity: .92; font-size: 14.5px; }

/* Banniere officielle Kevla (1920x750) */
.hero-banner {
  border-radius: 14px; overflow: hidden; line-height: 0;
  box-shadow: 0 10px 30px rgba(5, 42, 29, .32);
  border: 1px solid rgba(255, 255, 255, .18);
}
.hero-banner img {
  width: 100%; height: auto; display: block;
  /* Sur petit ecran, on ne rogne pas : on laisse la largeur shrinker */
  min-height: 150px; object-fit: cover; object-position: center right;
}

.hero .whatsapp-cta { margin-top: 16px; display: flex; gap: 9px; flex-wrap: wrap; }
.btn-wa {
  background: #25d366; color: #fff; border: 0; padding: 10px 18px;
  border-radius: 9px; font-weight: 600; font-size: 14px;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-wa:hover { filter: brightness(1.06); }
.btn-outline-wa {
  background: var(--white); color: var(--brand-dark); border: 1px solid var(--brand-dark);
  padding: 10px 18px; border-radius: 9px; font-weight: 600; font-size: 14px;
}
.btn-outline-wa:hover { background: var(--brand-soft); }

.notice {
  background: var(--amber-soft); border: 1px solid #f0dcb4; color: #7a4a00;
  padding: 12px 15px; border-radius: 10px; font-size: 13.5px; margin-bottom: 16px;
}
.notice.info { background: var(--blue-soft); border-color: #c5dbfa; color: var(--blue-dark); }
.notice.err { background: var(--red-soft); border-color: #f4c9c9; color: var(--red); }

.product-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 15px;
}
.product-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: box-shadow .16s, transform .16s;
}
.product-card:hover { box-shadow: 0 10px 26px rgba(16,24,40,.11); transform: translateY(-2px); }
/* Le catalogue n'affiche plus de vignette : la piece est identifiee par son
   nom, ce qui evite de charger des images volumineuses sur mobile. */
.product-info { padding: 13px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-name { font-weight: 620; font-size: 14.5px; line-height: 1.35; }
.product-sku { font-size: 11.5px; color: var(--ink-soft); font-family: ui-monospace, Menlo, Consolas, monospace; }
.product-desc {
  font-size: 12.5px; color: var(--ink-soft); display: -webkit-box;
  -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-price { font-size: 18px; font-weight: 700; color: var(--blue-dark); margin-top: auto; }
.product-price .cur { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.product-actions { display: flex; gap: 7px; align-items: center; margin-top: 8px; }
.stepper { display: flex; align-items: center; border: 1px solid #d3dae4; border-radius: 8px; overflow: hidden; }
.stepper button { width: 30px; height: 32px; border: 0; background: #f7f9fc; font-size: 16px; color: var(--ink); }
.stepper button:hover { background: var(--blue-soft); color: var(--blue-dark); }
.stepper input {
  width: 40px; height: 32px; text-align: center; border: 0;
  border-left: 1px solid #d3dae4; border-right: 1px solid #d3dae4; font-size: 14px; font-weight: 600;
}
.stepper input:focus { outline: none; }

.catalogue-bar {
  display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap;
}
.catalogue-bar .input { max-width: 280px; }

.cart-layout { display: grid; grid-template-columns: 1fr 340px; gap: 18px; align-items: start; }
.summary-row { display: flex; justify-content: space-between; padding: 7px 0; font-size: 14px; }
.summary-row.total {
  border-top: 2px solid var(--line); margin-top: 9px; padding-top: 12px;
  font-size: 18px; font-weight: 700; color: var(--blue-dark);
}
.sticky { position: sticky; top: 86px; }

.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px;
  width: 2px; background: var(--line);
}
.tl-item { position: relative; padding-bottom: 16px; }
.tl-item::before {
  content: ""; position: absolute; left: -22px; top: 4px; width: 11px; height: 11px;
  border-radius: 50%; background: var(--blue); border: 2px solid var(--white);
  box-shadow: 0 0 0 2px var(--blue-soft);
}
.tl-when { font-size: 12px; color: var(--ink-soft); }
.tl-what { font-weight: 600; font-size: 14px; }
.tl-note { font-size: 13px; color: var(--ink-soft); }

.footer {
  background: var(--brand-deep); color: #bcd3c8; padding: 26px 0; margin-top: 34px; font-size: 13.5px;
}
.footer .wrap { display: flex; gap: 26px; flex-wrap: wrap; align-items: flex-start; }
.footer h4 { color: #fff; font-size: 14px; margin-bottom: 7px; }
.footer a { color: #8fb8ff; }
.footer img {
  background: var(--white); padding: 7px 14px; border-radius: 9px;
  height: 38px; width: auto; max-width: 200px; object-fit: contain;
  margin-bottom: 12px;
}

/* ------------------------------------------------------------ fenetre d'accueil */
.welcome-bg {
  position: fixed; inset: 0; z-index: 300;
  background: linear-gradient(160deg, rgba(7,61,42,.96), rgba(5,42,29,.97));
  display: flex; align-items: flex-start; justify-content: center;
  padding: 24px 16px; overflow-y: auto;
  animation: fadeIn .22s ease;
}
@keyframes fadeIn { from { opacity: 0; } }

.welcome-card {
  background: var(--white); border-radius: 16px; width: 100%; max-width: 480px;
  box-shadow: 0 30px 80px rgba(5, 42, 29, .45); margin: auto;
  animation: pop .25s ease; overflow: hidden;
  border-top: 5px solid var(--accent);
}

.welcome-head {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  color: #fff; padding: 24px 26px 20px; text-align: center;
}
.welcome-logo {
  height: 46px; width: auto; max-width: 210px; object-fit: contain;
  margin-bottom: 14px;
}
.welcome-head h1 { font-size: 22px; font-weight: 700; margin-bottom: 5px; }
.welcome-head p { font-size: 14px; opacity: .92; }

.welcome-body { padding: 22px 26px 26px; }

.welcome-guide {
  background: var(--accent-soft); border-left: 4px solid var(--accent);
  border-radius: 0 10px 10px 0; padding: 13px 16px; margin-bottom: 18px;
  font-size: 14px; color: var(--brand-dark); line-height: 1.6; font-weight: 550;
  text-align: center;
}
.welcome-guide p { margin: 0; }

.welcome-btn {
  width: 100%; padding: 12px; font-size: 15px; margin-top: 4px;
  background: var(--accent); border-color: var(--accent); color: #1c1c1c;
}
.welcome-btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #1c1c1c; }

.welcome-alt {
  text-align: center; margin-top: 16px; padding-top: 14px;
  border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-soft);
}

.welcome-done-box { text-align: center; padding: 10px 0 4px; }
.welcome-done-icon {
  width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 50%;
  background: var(--brand); color: var(--accent);
  display: grid; place-items: center; font-size: 26px; font-weight: 700;
}
.welcome-done-box h2 { font-size: 19px; font-weight: 680; margin-bottom: 6px; }
.welcome-done-box p { font-size: 13.5px; color: var(--ink-soft); line-height: 1.6; }

@media (max-width: 520px) {
  .welcome-body { padding: 18px 18px 22px; }
  .welcome-head { padding: 20px 18px 16px; }
  .welcome-head h1 { font-size: 19px; }
}

/* ------------------------------------------------------------ back-office */
.login-screen {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: linear-gradient(140deg, var(--brand-deep), var(--brand-mid));
}
.login-card {
  background: var(--white); border-radius: 16px; padding: 30px; width: 100%;
  max-width: 390px; box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
.login-card img.logo { height: 46px; width: auto; max-width: 210px; object-fit: contain; margin-bottom: 18px; }

.admin-shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--brand-deep); color: #bcd3c8; padding: 16px 12px;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { padding: 6px 8px 16px; }
.sidebar .brand img {
  background: var(--white); padding: 6px 12px; border-radius: 8px;
  height: 32px; width: auto; max-width: 160px; object-fit: contain;
}
.side-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px;
  color: #b6c0cf; font-size: 14px; font-weight: 500; margin-bottom: 2px;
  background: none; border: 0; width: 100%; text-align: left;
}
.side-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-link.on { background: var(--blue); color: #fff; }
.side-link .ico { width: 18px; text-align: center; }
.side-badge {
  margin-left: auto; background: var(--red); color: #fff; border-radius: 20px;
  font-size: 11px; font-weight: 700; padding: 1px 7px;
}
.side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.12); }
.side-foot .who { font-size: 13px; color: #fff; font-weight: 600; }
.side-foot .role { font-size: 11.5px; opacity: .7; text-transform: uppercase; letter-spacing: .5px; }

.main { padding: 22px 24px 40px; background: var(--bg); }
.page-head {
  display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap;
}
.page-head h1 { font-size: 21px; font-weight: 680; }
.page-head .spacer { flex: 1; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 17px; box-shadow: var(--shadow); cursor: pointer; transition: transform .15s;
}
.stat:hover { transform: translateY(-2px); }
.stat .k { font-size: 12.5px; color: var(--ink-soft); font-weight: 600; }
.stat .v { font-size: 27px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat.accent-amber .v { color: var(--amber); }
.stat.accent-violet .v { color: var(--violet); }
.stat.accent-blue .v { color: var(--blue); }
.stat.accent-green .v { color: var(--green); }

.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs button {
  padding: 6px 13px; border-radius: 20px; border: 1px solid var(--line);
  background: var(--white); font-size: 13px; color: var(--ink-soft); font-weight: 550;
}
.tabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }

.detail-grid { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }
.kv { display: grid; grid-template-columns: 148px 1fr; gap: 7px 12px; font-size: 14px; }
.kv dt { color: var(--ink-soft); font-size: 13px; }
.kv dd { font-weight: 550; }

.bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding-top: 12px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bar { width: 100%; background: linear-gradient(180deg, var(--blue), var(--blue-dark)); border-radius: 5px 5px 0 0; min-height: 3px; }
.bar-lbl { font-size: 11px; color: var(--ink-soft); }
.bar-val { font-size: 11.5px; font-weight: 700; color: var(--blue-dark); }

.img-picker { display: flex; gap: 10px; align-items: center; }
.img-preview {
  width: 62px; height: 62px; border: 1px dashed #c9d2df; border-radius: 10px;
  display: grid; place-items: center; overflow: hidden; background: #fafbfd; flex-shrink: 0;
}
.img-preview img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 1024px) {
  .cart-layout, .detail-grid, .admin-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .sidebar .brand, .side-foot { width: 100%; }
  .side-link { width: auto; }
  .side-foot { margin-top: 8px; }
  .sticky { position: static; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}