/* ════════════════════════════════════════════════
   SÜVY — Prise de commande — styles.css
   ════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600;9..40,700&display=swap');

:root {
  --cream:   #FAF8F3;
  --dark:    #1C1A15;
  --mid:     #3D3930;
  --muted:   #8C8880;
  --border:  #E4E0D6;
  --surface: #fff;
  --surface2:#F5F2EB;
  --accent:  #C8602A;
  --al:      #F7EDE5;
  --ad:      #9A4520;
  --green:   #2D6E4A;
  --gl:      #E8F5EE;
  --red:     #C0392B;
  --sh:      rgba(28,26,21,.08);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--dark);
  min-height: 100vh;
  font-size: 15px;
}

/* ── HEADER ─────────────────────────────────── */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 1.2rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 8px var(--sh);
}
.brand { display: flex; align-items: center; gap: 11px; }
.logo {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'DM Serif Display', serif;
  font-style: italic; color: #fff; font-size: 17px;
}
.brand-name  { font-family: 'DM Serif Display', serif; font-size: 19px; }
.brand-sub   { font-size: 11px; color: var(--muted); }
.agent-pill  {
  display: flex; align-items: center; gap: 7px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 20px; padding: 4px 12px 4px 6px;
  text-decoration: none; transition: all .15s;
}
.agent-pill:hover { border-color: var(--accent); }
.agent-av {
  width: 24px; height: 24px;
  background: var(--accent); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 10px; font-weight: 700;
}
.agent-pill span { font-size: 12.5px; font-weight: 500; color: var(--dark); }

/* ── NAV ─────────────────────────────────────── */
.nav {
  display: flex;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 60px; z-index: 99;
}
.ntab {
  flex: 1; padding: 11px 4px;
  font-size: 12px; font-weight: 500;
  color: var(--muted); text-decoration: none;
  border-bottom: 2px solid transparent;
  display: flex; flex-direction: column;
  align-items: center; gap: 2px;
  transition: all .15s;
}
.ntab:hover  { color: var(--dark); }
.ntab.active { color: var(--accent); border-bottom-color: var(--accent); }
.ntab-icon   { font-size: 17px; }

/* ── PAGE WRAPPER ────────────────────────────── */
.page {
  max-width: 620px;
  margin: 0 auto;
  padding: 1.1rem 1rem 6rem;
}

/* ── CARDS ───────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  margin-bottom: .85rem;
  box-shadow: 0 1px 4px var(--sh);
}
.card-title {
  font-size: 11px; font-weight: 700;
  color: var(--muted); text-transform: uppercase;
  letter-spacing: 1px; margin-bottom: .75rem;
}

/* ── FORM ────────────────────────────────────── */
.field        { margin-bottom: .75rem; }
.field:last-child { margin-bottom: 0; }
.field label  { display: block; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .7px; margin-bottom: 5px; }
.fi {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px;
  font-family: 'DM Sans', sans-serif; font-size: 14px;
  color: var(--dark); background: var(--cream);
  outline: none; transition: border-color .15s;
  appearance: none; -webkit-appearance: none;
}
.fi:focus { border-color: var(--accent); }
.fi-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.fi-row .field { margin-bottom: 0; }

/* ── CATALOGUE ───────────────────────────────── */
.cat-label {
  font-size: 10.5px; font-weight: 700;
  color: var(--accent); text-transform: uppercase;
  letter-spacing: 1px; margin: .7rem 0 .4rem;
  padding-bottom: 5px; border-bottom: 1px solid var(--border);
}
.prod-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--border);
  transition: background .12s; border-radius: 0;
}
.prod-row:last-child { border-bottom: none; }
.prod-row.has-qty {
  background: var(--al); border-radius: 9px;
  padding: 9px 8px; margin: 0 -8px;
}
.prod-row.has-qty .qty-ctrl { border-color: var(--accent); }
.prod-info    { flex: 1; min-width: 0; }
.prod-name    { font-size: 13.5px; font-weight: 500; color: var(--dark); }
.prod-ref     { font-size: 11px; color: var(--muted); }

/* ── QTY CONTROLS ────────────────────────────── */
.qty-ctrl {
  display: flex; align-items: center;
  border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; background: var(--surface);
}
.qty-btn {
  width: 36px; height: 36px; border: none;
  background: var(--surface2); color: var(--mid);
  font-size: 20px; cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: background .12s;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; line-height: 1;
}
.qty-btn:active { background: var(--border); }
.qty-val {
  width: 46px; text-align: center;
  font-size: 15px; font-weight: 600; color: var(--dark);
  border: none; background: var(--surface);
  font-family: 'DM Sans', sans-serif; outline: none; padding: 0;
}
.qty-val::-webkit-inner-spin-button,
.qty-val::-webkit-outer-spin-button { -webkit-appearance: none; }

/* ── RECAP ───────────────────────────────────── */
.recap-line {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13.5px;
}
.recap-line:last-child { border-bottom: none; }
.recap-prod { color: var(--dark); font-weight: 500; }
.recap-qty  { color: var(--accent); font-weight: 700; font-size: 15px; }
.recap-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 1.2rem 0; }
.recap-total { font-weight: 700; font-size: 15px; color: var(--dark); }

/* ── BUTTONS ─────────────────────────────────── */
.btn-primary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 15px;
  background: var(--accent); color: #fff; border: none;
  border-radius: 12px; font-family: 'DM Sans', sans-serif;
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: background .15s; text-decoration: none;
}
.btn-primary:hover    { background: var(--ad); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary.success  { background: var(--green); }
.btn-secondary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 12px;
  background: var(--surface2); color: var(--mid);
  border: 1px solid var(--border); border-radius: 11px;
  font-family: 'DM Sans', sans-serif; font-size: 14px;
  font-weight: 500; cursor: pointer; transition: all .15s;
  text-decoration: none;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* ── ALERT ───────────────────────────────────── */
.alert { padding: 10px 13px; border-radius: 9px; font-size: 13px; margin-bottom: .8rem; }
.alert.error   { background: #FDECEA; border: 1px solid #F5C6C6; color: var(--red); }
.alert.success { background: var(--gl); border: 1px solid #BDE3CC; color: var(--green); }
.alert.info    { background: var(--al); border: 1px solid #EBC6AE; color: var(--ad); }

/* ── HISTORY ─────────────────────────────────── */
.hist-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: .85rem;
}
.hist-header h2 { font-size: 15px; font-weight: 600; }
.hist-count { font-size: 12px; color: var(--muted); }
.hist-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: .9rem 1rem;
  margin-bottom: .6rem; text-decoration: none;
  display: block; transition: all .12s;
}
.hist-card:hover { border-color: #EBC6AE; background: var(--al); }
.hist-top  { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 3px; }
.hist-client { font-size: 14px; font-weight: 600; color: var(--dark); }
.hist-date   { font-size: 11px; color: var(--muted); white-space: nowrap; }
.hist-num    { font-size: 11px; color: var(--accent); font-weight: 600; margin-top: 2px; }
.hist-prods  { font-size: 12px; color: var(--muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge-sent  { display: inline-block; background: var(--gl); color: var(--green); border: 1px solid #BDE3CC; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 20px; }
.hist-empty  { text-align: center; color: var(--muted); font-size: 13px; padding: 2.5rem 0; line-height: 1.8; }

/* ── ORDER DETAIL ────────────────────────────── */
.detail-meta   { font-size: 12.5px; color: var(--muted); margin-bottom: .5rem; }
.detail-client { font-size: 15px; font-weight: 600; color: var(--dark); margin-bottom: .9rem; }
.detail-line   { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.detail-line:last-child { border-bottom: none; }
.detail-total  { font-weight: 700; font-size: 15px; }
.detail-note   { font-size: 12px; color: var(--muted); margin-top: .6rem; font-style: italic; }
.order-num-big { font-family: 'DM Serif Display', serif; font-size: 22px; color: var(--accent); margin-bottom: .3rem; }

/* ── LOGIN ───────────────────────────────────── */
.login-wrap {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center; padding: 1.5rem;
}
.login-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; padding: 2rem 1.5rem;
  width: 100%; max-width: 380px;
  box-shadow: 0 4px 24px var(--sh); text-align: center;
}
.login-logo {
  width: 56px; height: 56px; background: var(--accent);
  border-radius: 15px; display: flex; align-items: center; justify-content: center;
  font-family: 'DM Serif Display', serif; font-style: italic;
  color: #fff; font-size: 28px; margin: 0 auto 1.1rem;
}
.login-title { font-family: 'DM Serif Display', serif; font-size: 26px; font-weight: 400; margin-bottom: .3rem; }
.login-sub   { font-size: 13px; color: var(--muted); margin-bottom: 1.5rem; }
.agent-list  { display: flex; flex-direction: column; gap: 8px; margin-bottom: .9rem; }
.agent-btn {
  padding: 11px 14px; border: 1px solid var(--border);
  border-radius: 11px; background: var(--cream);
  font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 500;
  color: var(--dark); cursor: pointer; text-align: left;
  display: flex; align-items: center; gap: 11px;
  transition: all .15s; width: 100%;
}
.agent-btn:hover { border-color: var(--accent); background: var(--al); color: var(--ad); }
.agent-btn-av {
  width: 30px; height: 30px; background: var(--accent);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.login-divider { font-size: 12px; color: var(--muted); margin: .6rem 0; }
.pw-row { display: flex; gap: 8px; }
.pw-row .fi { flex: 1; }
.pw-submit {
  padding: 10px 16px; background: var(--accent); color: #fff;
  border: none; border-radius: 10px; font-family: 'DM Sans', sans-serif;
  font-size: 14px; font-weight: 600; cursor: pointer; flex-shrink: 0;
  transition: background .15s;
}
.pw-submit:hover { background: var(--ad); }

/* ── CONFIG ──────────────────────────────────── */
.config-steps {
  font-size: 12px; color: var(--mid); line-height: 1.9;
  background: var(--surface2); border-radius: 9px;
  padding: .8rem 1rem; margin-bottom: .9rem;
}
.config-note { font-size: 11px; color: var(--muted); line-height: 1.5; margin-top: 4px; }
.monospace {
  font-family: monospace; font-size: 11.5px;
  background: var(--surface2); border-radius: 8px;
  padding: .7rem .9rem; color: var(--mid);
  white-space: pre-wrap; line-height: 1.7;
  border: 1px solid var(--border);
}

/* ── BOTTOM FIXED BAR ────────────────────────── */
.bottom-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--surface); border-top: 1px solid var(--border);
  padding: .75rem 1rem; z-index: 98;
}
.bottom-bar-inner { max-width: 620px; margin: 0 auto; }

/* ── RESPONSIVE ──────────────────────────────── */
@media (max-width: 480px) {
  .fi-row { grid-template-columns: 1fr; }
  .page   { padding: .8rem .75rem 5.5rem; }
  .header { padding: 0 .85rem; }
}
