/* commande_ui.css — style aligné sur l'outil chantier (header sombre + cards blanches) */

:root{
  --bg:#f2f2f2;
  --card:#ffffff;
  --text:#111;
  --muted:#6b6f76;
  --bar:#1f1f1f;
  --pill:#3a3a3a;
  --pillActive:#6b6b6b;
  --line:#e8e8e8;
  --shadow:0 10px 25px rgba(0,0,0,.12);
  --radius:16px;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* Topbar */
.topbar{
  height:64px;
  background: var(--bar);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 18px;
  gap:14px;
}
.topbar-left{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:220px;
}
.brand-logo{
  width:30px;
  height:30px;
  border-radius:6px;
  object-fit:cover;
}
.brand-title{
  color:#fff;
  font-weight:800;
  letter-spacing:.2px;
}
.brand-title span{
  font-weight:700;
  opacity:.85;
}

.topbar-nav{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  justify-content:center;
  flex:1;
}
.pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:30px;
  padding:0 14px;
  border-radius:999px;
  background: var(--pill);
  color:#fff;
  text-decoration:none;
  font-weight:700;
  font-size:13px;
}
.pill:hover{filter:brightness(1.05)}
.pill-active{
  background: var(--pillActive);
}

.topbar-right{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:220px;
  justify-content:flex-end;
}
.user{color:#fff; opacity:.9; font-weight:700; font-size:13px}
.logout{
  color:#fff;
  text-decoration:none;
  font-weight:800;
}

/* Page / Card */
.page{
  padding:26px 18px 60px;
  display:flex;
  justify-content:center;
}
.card{
  width:min(1100px, 100%);
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:18px 18px 12px;
}

.card-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:14px;
  flex-wrap:wrap;
  padding-bottom:12px;
}
h1{margin:0; font-size:26px}
.sub{color:var(--muted); font-size:13px; margin-top:4px}
.badge{
  margin-top:6px;
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:12px;
  background:#f4f4f4;
  border:1px solid var(--line);
  font-size:13px;
  color:#222;
}
.tools{display:flex; gap:10px; flex-wrap:wrap; align-items:center}

.input{
  height:38px;
  min-width:320px;
  padding:0 12px;
  border:1px solid var(--line);
  border-radius:10px;
  outline:none;
}
.btn{
  height:38px;
  min-width:150px;
  padding:0 14px;
  border-radius:10px;
  border:0;
  cursor:pointer;
  font-weight:800;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  color:inherit;
}
.btn-ghost{
  background:#efefef;
}
.btn-link{min-width:160px}
.btn-primary{
  background:#1f1f1f;
  color:#fff;
}

/* Table */
.table-wrap{overflow:auto; border-radius:12px; border:1px solid var(--line)}
.table{width:100%; border-collapse:collapse; min-width:860px; background:#fff}
.table th,.table td{padding:12px 12px; border-bottom:1px solid var(--line); vertical-align:middle}
.table th{background:#fafafa; text-align:left; font-size:12px; color:#555; text-transform:uppercase; letter-spacing:.04em}
.col-ref{width:140px}
.col-unit{width:90px}
.col-qty{width:210px}
.mono{font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size:12px; color:#222}
.name{font-weight:750}
.table tbody tr:hover{background:#fcfcfc}

/* Qty */
.qty{display:flex; align-items:center; gap:10px; justify-content:flex-end}
.qty-btn{
  width:36px; height:36px;
  border-radius:10px;
  border:1px solid var(--line);
  background:#f6f6f6;
  font-size:18px;
  cursor:pointer;
  font-weight:900;
}
.qty-input{
  width:90px;
  height:36px;
  border-radius:10px;
  border:1px solid var(--line);
  text-align:center;
  font-weight:900;
  background:#fff;
}

/* Footer */
.card-foot{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  padding-top:12px;
}
.hint{color:var(--muted); font-size:13px}

@media (max-width: 820px){
  .topbar{height:auto; padding:12px 12px}
  .topbar-left,.topbar-right{min-width:auto}
  .topbar-nav{justify-content:flex-start}
  .input{min-width:220px; width:100%}
  .btn{min-width:140px}
  .card{padding:16px}
}

@media (max-width: 520px){
  h1{font-size:22px}
  .pill{height:28px; padding:0 12px}
}
