.login { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.login-card { background: var(--surface); padding: 32px; border-radius: 18px; box-shadow: var(--shadow); width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; }
.login-card h1 { font-family: var(--display); color: var(--brand); margin: 0; font-size: 26px; }

.admin { display: grid; grid-template-columns: 230px 1fr; min-height: 100dvh; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100dvh; }
.side nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.side nav button { text-align: left; border: 0; background: none; padding: 10px 12px; border-radius: 10px; font-weight: 500; display: flex; justify-content: space-between; align-items: center; }
.side nav button[aria-current="true"] { background: var(--accent-soft); color: var(--brand); font-weight: 700; }
.nbadge { background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; border-radius: 9px; padding: 1px 7px; }
.content { padding: 28px; min-width: 0; }
.content h1 { font-family: var(--display); margin: 0 0 20px; font-size: 28px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar h1 { margin: 0; flex: 1; }
.toolbar select, .toolbar input { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 12px; }

@media (max-width: 800px) {
  .admin { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 16px; gap: 10px; }
  .side nav { flex-direction: row; overflow-x: auto; flex-basis: 100%; order: 3; }
  .side nav button { white-space: nowrap; }
  .side .logo { flex: 1; }
  .content { padding: 18px 16px; }
}

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat { background: var(--surface); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.stat span { color: var(--muted); font-size: 13px; }
.stat b { display: block; font-size: 26px; margin-top: 4px; color: var(--brand); font-variant-numeric: tabular-nums; }
.panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 18px; }
.panel h2 { font-size: 16px; margin: 0 0 12px; }

.table-wrap { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: var(--bg); }
.ptd { display: flex; align-items: center; gap: 10px; }
.ptd .thumb { width: 42px; height: 42px; border-radius: 8px; flex: none; }
.ptd .thumb .ph { font-size: 18px; }
.flags { display: flex; gap: 4px; flex-wrap: wrap; }
.flag { font-size: 11px; padding: 2px 7px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); }
.flag.off { color: var(--danger); }
.status { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.status[data-s="nouvelle"] { background: #fde8d9; color: #9a4317; }
.status[data-s="confirmée"] { background: #e3e8fb; color: #2d3f94; }
.status[data-s="en livraison"] { background: #f3e6fa; color: #6b2a8a; }
.status[data-s="livrée"] { background: #dcf1e5; color: #1f6a45; }
.status[data-s="annulée"] { background: #eee; color: #666; }
.order-detail td { background: var(--bg); }
.order-detail ul { margin: 0 0 10px; padding-left: 18px; }
.order-detail .meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px 20px; margin-bottom: 12px; }
.order-detail .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.order-detail select { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--surface); }

.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn.small { padding: 6px 10px; font-size: 12px; }

.pform { display: flex; flex-direction: column; max-height: calc(100dvh - 24px); }
.pform-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.pform-head h2 { margin: 0; font-family: var(--display); }
.pform-head .close { position: static; box-shadow: none; background: var(--bg); }
.pform-body { padding: 18px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.pform-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 600px) { .row2, .row3 { grid-template-columns: 1fr; } }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.imgs { display: flex; flex-wrap: wrap; gap: 8px; }
.imgs:empty { display: none; }
.img-item { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; border: 2px solid transparent; }
.img-item:first-child { border-color: var(--brand); }
.img-item img { width: 100%; height: 100%; object-fit: cover; }
.img-item button { position: absolute; top: 3px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 13px; line-height: 1; padding: 0; }
.img-item .rm { right: 3px; }
.img-item .first { left: 3px; }
.upload-btn { align-self: flex-start; cursor: pointer; }
.tiers-edit { display: flex; flex-direction: column; gap: 6px; }
.tiers-edit:empty { display: none; }
.tier-row { display: flex; gap: 8px; align-items: center; font-size: 14px; flex-wrap: wrap; }
.tier-row input { width: 100px; border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 7px 9px; }

.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opts:empty { display: none; }
.opt { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-soft); color: var(--brand); border-radius: 999px; padding: 4px 6px 4px 12px; font-size: 13px; font-weight: 600; }
.opt button { border: 0; background: rgba(0,0,0,.08); width: 20px; height: 20px; border-radius: 50%; font-size: 13px; line-height: 1; padding: 0; color: inherit; }
.cat-row { display: flex; gap: 8px; align-items: center; }
.cat-row input { flex: 1; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 9px 12px; }
.cat-row input[type=number] { flex: none; width: 80px; }
.settings-form { display: flex; flex-direction: column; gap: 14px; max-width: 720px; }
.list-edit { display: flex; flex-direction: column; gap: 6px; }
.list-row { display: flex; gap: 8px; }
.list-row input { flex: 1; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 9px 12px; min-width: 0; }
.list-row input.fee { flex: none; width: 120px; }
