/* gros.dinarama.cc — feuille de style */
:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --text: #1c2433;
  --muted: #687288;
  --primary: #d8540b;
  --primary-dark: #b34508;
  --accent: #1e8e57;
  --border: #e3e7ee;
  --danger: #c0392b;
  --ok: #1e8e57;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.accent { color: var(--primary); }

/* ---------- TOPBAR ---------- */
.topbar {
  display: flex; align-items: center; gap: 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  position: sticky; top: 0; z-index: 10;
}
.topbar .brand {
  font-weight: 700; font-size: 18px; color: var(--text);
}
.topbar nav { display: flex; gap: 18px; flex: 1; }
.topbar nav a { color: var(--text); padding: 4px 6px; }
.topbar nav a:hover { color: var(--primary); text-decoration: none; }
.topbar .account { display: flex; gap: 12px; align-items: center; }
.badge {
  display: inline-block;
  background: var(--primary); color: #fff;
  border-radius: 999px; padding: 1px 7px;
  font-size: 12px; font-weight: 600;
  margin-left: 4px;
}

/* ---------- LAYOUT ---------- */
.container { max-width: 1180px; margin: 0 auto; padding: 24px; }
.footer { text-align: center; padding: 30px 0 50px; }

.page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 18px;
}
.page-head h2 { margin: 0; }
.filters { display: flex; gap: 10px; }

/* ---------- HERO ---------- */
.hero {
  background: linear-gradient(135deg, #fff 0%, #fff5ec 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 40px;
  text-align: center;
  margin-bottom: 24px;
}
.hero h1 { font-size: 32px; margin: 0 0 8px; }
.hero p { max-width: 640px; margin: 0 auto 22px; }
.cta { display: flex; gap: 12px; justify-content: center; }

.features {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}
.feature h3 { margin: 0 0 6px; }

/* ---------- CARDS ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 18px;
}
.card.narrow { max-width: 420px; margin-left: auto; margin-right: auto; }
.card h2 { margin-top: 0; }

/* ---------- FORMS ---------- */
.form label {
  display: block; font-weight: 500;
  margin: 0 0 14px;
}
.form input, .form textarea, .form select, textarea, input[type="text"], input[type="password"],
input[type="search"], input[type="number"], select {
  display: block; width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  font: inherit;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
.form input:focus, textarea:focus, select:focus { outline: 2px solid var(--primary); outline-offset: 0; }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 8px;
  cursor: pointer; font: inherit;
  text-decoration: none;
}
.btn:hover { background: #f3f5f9; text-decoration: none; }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn.block { width: 100%; }
.lnk {
  background: none; border: none; color: var(--primary); cursor: pointer;
  padding: 0; font: inherit;
}
.lnk.danger { color: var(--danger); }
.row-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }

/* ---------- MESSAGES ---------- */
.msg { margin: 10px 0; min-height: 1.4em; }
.msg.err { color: var(--danger); }
.msg.ok  { color: var(--ok); }
.err { color: var(--danger); }

/* ---------- TABLES ---------- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--border); }
.tbl tfoot th { border-top: 2px solid var(--border); }

.empty { padding: 20px; text-align: center; color: var(--muted); }

/* ---------- CATALOGUE ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.card.art { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.art-img {
  height: 140px; display: flex; align-items: center; justify-content: center;
  background: #fff;
}
.art-img img { max-height: 100%; max-width: 100%; object-fit: contain; }
.art-img .ph { font-size: 42px; opacity: 0.4; }
.art-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.art-fam { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.art-name { font-weight: 600; line-height: 1.25; }
.art-meta { font-size: 12px; }
.art-foot {
  margin-top: auto;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding-top: 10px; border-top: 1px solid var(--border);
}
.art-price { font-weight: 700; color: var(--primary); font-size: 16px; flex: 1; }

.qty {
  display: inline-flex; align-items: stretch;
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
}
.qty-btn {
  width: 28px; background: #f3f5f9; border: 0; cursor: pointer; font-size: 16px;
}
.qty-btn:hover { background: #e5e9f0; }
.qty-input {
  width: 52px; border: 0 !important; border-left: 1px solid var(--border) !important;
  border-right: 1px solid var(--border) !important;
  text-align: center; padding: 4px !important; border-radius: 0 !important;
}

/* ---------- STATUTS COMMANDE ---------- */
.st {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.st-nouvelle { background: #fff5ec; color: var(--primary); }
.st-validee  { background: #e0f0ff; color: #1059b8; }
.st-preparee { background: #ede7fa; color: #5e35b1; }
.st-livree   { background: #e3f6e9; color: var(--ok); }
.st-annulee  { background: #fce8e6; color: var(--danger); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; gap: 12px; padding: 10px 14px; }
  .topbar nav { order: 3; flex-basis: 100%; }
  .container { padding: 14px; }
  .features { grid-template-columns: 1fr; }
  .hero { padding: 24px; }
  .filters { flex-direction: column; }
}

/* ===== responsive tableaux + sélecteur de langue + RTL + modale ===== */
@media (max-width: 720px) {
  .tbl { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
}
.lang-select { padding: 5px 8px; border-radius: 8px; border: 1px solid var(--border);
               background: #fff; color: var(--text); font-size: 13px; cursor: pointer; }
html[dir="rtl"] body { direction: rtl; }
html[dir="rtl"] .tbl th, html[dir="rtl"] .tbl td { text-align: right; }
html[dir="rtl"] .topbar nav { flex-direction: row-reverse; }
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5);
                 display: flex; align-items: center; justify-content: center; z-index: 60; padding: 16px; }
.modal-box { width: 100%; max-width: 440px; }
.modal-box h3 { margin: 0 0 4px; }
.modal-box label { display: block; margin: 12px 0 4px; font-weight: 600; font-size: 14px; }
.modal-box input { width: 100%; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; }
.modal-box .row-actions { margin-top: 16px; display: flex; gap: 10px; justify-content: flex-end; }
