* { box-sizing: border-box; margin: 0; }
body { font-family: -apple-system, "Segoe UI", Roboto, sans-serif; background: #f2f4f7; color: #1d2430; font-size: 14px; }

.topbar { display: flex; align-items: center; gap: 24px; background: #10233f; color: #fff; padding: 10px 24px; flex-wrap: wrap; }
.topbar .brand { font-weight: 700; font-size: 16px; }
.topbar .brand span { color: #5db075; }
.topbar .brand em { font-style: normal; font-weight: 400; opacity: .6; font-size: 13px; margin-left: 4px; }
.topbar .links a { color: #c8d4e4; text-decoration: none; margin-right: 16px; }
.topbar .links a:hover { color: #fff; }
.topbar .right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.topbar .logout { display: flex; align-items: center; gap: 10px; }
.topbar .logout button { background: transparent; border: 1px solid #43597c; color: #c8d4e4; padding: 4px 12px; border-radius: 6px; cursor: pointer; }
.cart-link { color: #fff; text-decoration: none; position: relative; font-weight: 600; }
.cart-badge { background: #5db075; color: #fff; border-radius: 20px; padding: 1px 7px; font-size: 11px; margin-left: 4px; }

.container { max-width: 1200px; margin: 24px auto; padding: 0 16px; }
h1 { font-size: 22px; margin-bottom: 14px; }
h2 { font-size: 16px; margin-bottom: 10px; }

.card { background: #fff; border: 1px solid #e2e7ef; border-radius: 10px; padding: 18px; margin-bottom: 18px; }
.card.highlight { border-color: #5db075; background: #f2faf4; }
.card.warn { border-color: #e0a93e; background: #fdf7ea; }
.disabled-card { opacity: .6; }

.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; }
.alert.info { background: #e8f1fd; border: 1px solid #b9d4f5; }
.alert.error { background: #fdeaea; border: 1px solid #f0b9b9; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid #edf0f5; }
th { font-size: 12px; text-transform: uppercase; color: #6b7686; letter-spacing: .03em; }
table.small td, table.small th { font-size: 12px; padding: 5px 8px; }
tr.disabled { opacity: .45; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge.confermato { background: #e2f5e8; color: #1d7a3d; }
.badge.anteprima { background: #fdf3dd; color: #93690e; }
.badge.annullato { background: #f0f1f4; color: #6b7686; }
.badge.vm { background: #ece5fa; color: #5b3ea8; }
.badge.iva { background: #e2effa; color: #1c5d99; }
.badge.cat { background: #eef1f6; color: #3d4a5d; }

/* Stati ordine */
.badge.stato-inviato { background: #fdf3dd; color: #93690e; }
.badge.stato-in_verifica { background: #fdeeda; color: #a3611a; }
.badge.stato-confermato { background: #e2effa; color: #1c5d99; }
.badge.stato-in_lavorazione { background: #ece5fa; color: #5b3ea8; }
.badge.stato-spedito { background: #dff3f5; color: #17727c; }
.badge.stato-consegnato { background: #e2f5e8; color: #1d7a3d; }
.badge.stato-annullato { background: #f0f1f4; color: #6b7686; }

.btn { background: #eef1f6; border: 1px solid #d4dbe6; padding: 8px 16px; border-radius: 8px; cursor: pointer; font-size: 14px; text-decoration: none; display: inline-block; color: inherit; }
.btn.primary { background: #10233f; color: #fff; border-color: #10233f; }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn.full { width: 100%; }

input, select, textarea { padding: 8px 10px; border: 1px solid #d4dbe6; border-radius: 8px; font-size: 14px; font-family: inherit; }
input.mini { width: 110px; }
input.qty { width: 64px; }
label { display: block; margin: 12px 0 4px; font-weight: 600; font-size: 13px; }

.upload-form { display: flex; gap: 12px; align-items: center; }
.row-form { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.searchbar { display: flex; gap: 8px; margin-bottom: 14px; }
.filterbar { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; align-items: center; }
.filterbar input[type="text"] { min-width: 220px; }
.actions { display: flex; gap: 12px; }
form.inline { display: inline; }
.hint { color: #6b7686; font-size: 13px; margin-bottom: 10px; }

.login-box { max-width: 380px; margin: 80px auto; background: #fff; border: 1px solid #e2e7ef; border-radius: 12px; padding: 32px; }
.login-box h1 { text-align: center; margin-bottom: 4px; }
.login-box .sub { text-align: center; color: #6b7686; margin-bottom: 20px; }
.login-box form button { margin-top: 18px; }

details summary { cursor: pointer; margin: 10px 0; color: #1c5d99; }

/* ---- Shop rivenditore: elenco ---- */
.listcard { padding: 6px 12px; }
table.listing td { padding: 10px; vertical-align: middle; }
table.listing .num { text-align: right; }
table.listing th.num { text-align: right; }
table.listing .actions-col { width: 190px; text-align: right; }
table.listing tr:hover { background: #f7f9fc; }
table.listing tr.added { background: #e2f5e8; transition: background .4s; }
table.listing .badge.cat { margin-left: 8px; font-weight: 400; }
.price-cell { font-size: 15px; font-weight: 700; color: #10233f; white-space: nowrap; }
.price-cell small { font-size: 11px; font-weight: 400; color: #6b7686; }
.stock.low { color: #a3611a; font-weight: 600; }
.addform { display: inline-flex; gap: 6px; align-items: center; }

.toast { position: fixed; bottom: 24px; right: 24px; background: #10233f; color: #fff; padding: 10px 18px; border-radius: 10px; box-shadow: 0 4px 16px rgba(0,0,0,.25); font-weight: 600; z-index: 100; }

.order-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.checkout-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.total { font-size: 17px; }
.pos { color: #1d7a3d; }
.neg { color: #b03434; }

@media (max-width: 640px) {
  .topbar { gap: 10px; }
  table.listing .actions-col { width: auto; }
  .container { margin-top: 14px; }
}

/* ---- Logo ---- */
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { height: 30px; width: auto; display: block; }
.login-logo { display: block; margin: 0 auto 14px; max-height: 56px; width: auto; }
