/* ============================================================
   GELATERIA ORDERING PLATFORM  –  Main Stylesheet
   Design: B2B Professionale
   ============================================================ */

/* ── RESET & BASE ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:       #1a3a5c;
  --navy-dark:  #112844;
  --navy-light: #254d7a;
  --gold:       #d4891a;
  --gold-light: #f0a832;
  --cream:      #fef9f0;
  --gray-50:    #f8fafc;
  --gray-100:   #f1f5f9;
  --gray-200:   #e2e8f0;
  --gray-300:   #cbd5e1;
  --gray-500:   #64748b;
  --gray-700:   #334155;
  --gray-900:   #0f172a;
  --green:      #16a34a;
  --green-bg:   #dcfce7;
  --orange:     #ea580c;
  --orange-bg:  #fff7ed;
  --blue-bg:    #eff6ff;
  --blue:       #2563eb;
  --red:        #dc2626;
  --red-bg:     #fef2f2;
  --white:      #ffffff;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
  --shadow:     0 4px 12px rgba(0,0,0,.10);
  --shadow-lg:  0 8px 24px rgba(0,0,0,.12);
  --radius:     10px;
  --radius-lg:  16px;
  --transition: .18s ease;
}

html { font-size: 15px; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  min-height: 100vh;
  line-height: 1.6;
}

a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--gold); }
img { max-width: 100%; }
button { cursor: pointer; font-family: inherit; }

/* ── TYPOGRAPHY ─────────────────────────────────────────────── */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.25; color: var(--gray-900); }
h1 { font-size: 1.85rem; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }
p  { color: var(--gray-700); }

/* ── TOPBAR ─────────────────────────────────────────────────── */
.topbar {
  background: var(--navy-dark);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 62px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow);
}

.topbar-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 1.1rem; letter-spacing: .3px;
}
.topbar-brand .brand-icon {
  background: var(--gold);
  color: var(--navy-dark);
  width: 34px; height: 34px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}
.topbar-brand .brand-sub { font-size: .72rem; font-weight: 400; opacity: .7; display: block; line-height: 1; }

.topbar-right { display: flex; align-items: center; gap: 18px; }

.topbar-user {
  display: flex; align-items: center; gap: 8px;
  font-size: .88rem; color: rgba(255,255,255,.85);
}
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--gold); color: var(--navy-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .82rem;
}

.topbar-nav { display: flex; align-items: center; gap: 4px; }
.topbar-nav a {
  color: rgba(255,255,255,.78);
  padding: 6px 13px;
  border-radius: 6px;
  font-size: .88rem;
  font-weight: 500;
  transition: var(--transition);
}
.topbar-nav a:hover, .topbar-nav a.active { background: rgba(255,255,255,.12); color: var(--white); }

.btn-logout {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.85);
  padding: 6px 13px;
  border-radius: 6px;
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
.btn-logout:hover { background: rgba(255,255,255,.18); color: var(--white); }

/* ── CART BADGE ─────────────────────────────────────────────── */
.cart-badge-wrap { position: relative; }
.cart-badge-wrap a {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  padding: 6px 13px;
  border-radius: 6px;
  color: rgba(255,255,255,.9);
  font-size: .88rem;
  font-weight: 500;
  transition: var(--transition);
}
.cart-badge-wrap a:hover { background: rgba(255,255,255,.18); }
#cart-count-badge {
  background: var(--gold);
  color: var(--navy-dark);
  font-size: .72rem; font-weight: 700;
  min-width: 18px; height: 18px;
  border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

/* ── LAYOUT ─────────────────────────────────────────────────── */
.page-wrapper { max-width: 1280px; margin: 0 auto; padding: 28px 24px; }
.page-header { margin-bottom: 26px; }
.page-header p { margin-top: 4px; font-size: .9rem; }

/* ── CARDS ──────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: space-between;
}
.card-body { padding: 20px 22px; }

/* ── BUTTONS ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .88rem; font-weight: 600;
  padding: 9px 18px; border-radius: 8px;
  border: none; cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: var(--navy); color: var(--white);
}
.btn-primary:hover { background: var(--navy-light); }

.btn-gold {
  background: var(--gold); color: var(--white);
}
.btn-gold:hover { background: var(--gold-light); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--gray-300);
  color: var(--gray-700);
}
.btn-outline:hover { border-color: var(--navy); color: var(--navy); }

.btn-danger { background: var(--red); color: var(--white); }
.btn-danger:hover { background: #b91c1c; }

.btn-sm { padding: 6px 12px; font-size: .82rem; }
.btn-lg { padding: 12px 26px; font-size: .96rem; }
.btn-block { width: 100%; justify-content: center; }

.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ── FORM ELEMENTS ───────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: .84rem; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  font-size: .92rem;
  font-family: inherit;
  color: var(--gray-900);
  background: var(--white);
  transition: border-color var(--transition);
}
.form-control:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(26,58,92,.08);
}
.form-hint { font-size: .78rem; color: var(--gray-500); margin-top: 4px; }

textarea.form-control { resize: vertical; min-height: 80px; }

/* ── PRODUCT GRID ────────────────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 18px;
}

.product-card {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--transition), border-color var(--transition);
  display: flex; flex-direction: column;
}
.product-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--gray-300);
}
.product-card-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  padding: 22px 20px 16px;
  display: flex; align-items: flex-start; gap: 12px;
}
.product-icon {
  font-size: 2rem;
  background: rgba(255,255,255,.12);
  width: 52px; height: 52px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.product-title { color: var(--white); font-size: .96rem; font-weight: 700; line-height: 1.3; }
.product-sku   { color: rgba(255,255,255,.55); font-size: .73rem; margin-top: 3px; }
.product-card-body { padding: 16px 18px; flex: 1; display: flex; flex-direction: column; }
.product-desc  { font-size: .84rem; color: var(--gray-500); margin-bottom: 14px; flex: 1; }
.product-meta  { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.product-price { font-size: 1.25rem; font-weight: 700; color: var(--navy); }
.product-unit  { font-size: .76rem; color: var(--gray-500); }
.product-stock { font-size: .78rem; }
.stock-ok  { color: var(--green); }
.stock-low { color: var(--orange); }
.product-order-row { display: flex; align-items: center; gap: 8px; }
.qty-input {
  width: 64px;
  padding: 8px 10px;
  border: 1.5px solid var(--gray-200);
  border-radius: 7px;
  font-size: .9rem;
  text-align: center;
  font-family: inherit;
  color: var(--gray-900);
}
.qty-input:focus { outline: none; border-color: var(--navy); }
.min-qty-note { font-size: .72rem; color: var(--gray-400); }

/* ── CATEGORY TABS ───────────────────────────────────────────── */
.category-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.cat-tab {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  color: var(--gray-700);
  padding: 7px 16px;
  border-radius: 20px;
  font-size: .85rem; font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: flex; align-items: center; gap: 5px;
}
.cat-tab:hover { border-color: var(--navy); color: var(--navy); }
.cat-tab.active {
  background: var(--navy); border-color: var(--navy);
  color: var(--white);
}
.cat-tab .cat-count {
  background: rgba(0,0,0,.12);
  font-size: .7rem;
  padding: 1px 6px; border-radius: 10px;
}
.cat-tab.active .cat-count { background: rgba(255,255,255,.2); }

/* ── TABLE ───────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th {
  background: var(--gray-50);
  color: var(--gray-500);
  text-transform: uppercase;
  font-size: .73rem; letter-spacing: .06em;
  padding: 11px 16px;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}
td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--gray-50); }

/* ── STATUS BADGES ───────────────────────────────────────────── */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .75rem; font-weight: 600;
  white-space: nowrap;
}
.status-confirmed   { background: var(--blue-bg);   color: var(--blue);  }
.status-processing  { background: var(--orange-bg);  color: var(--orange); }
.status-shipped     { background: #f0fdf4;            color: #15803d; }
.status-delivered   { background: var(--green-bg);   color: var(--green); }
.status-cancelled   { background: var(--red-bg);     color: var(--red);  }

/* ── SUMMARY CARD ────────────────────────────────────────────── */
.summary-box {
  background: var(--navy-dark);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
}
.summary-box .summary-line {
  display: flex; justify-content: space-between;
  padding: 6px 0;
  font-size: .9rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.summary-box .summary-line:last-child { border-bottom: none; }
.summary-total { font-size: 1.3rem; font-weight: 700; color: var(--gold-light); }

/* ── STAT CARDS (Admin) ──────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex; gap: 14px; align-items: flex-start;
}
.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; flex-shrink: 0;
}
.stat-icon.navy { background: #dbeafe; }
.stat-icon.gold  { background: #fef3c7; }
.stat-icon.green { background: var(--green-bg); }
.stat-icon.orange{ background: var(--orange-bg); }
.stat-label { font-size: .78rem; color: var(--gray-500); font-weight: 500; }
.stat-value { font-size: 1.55rem; font-weight: 700; color: var(--gray-900); line-height: 1.2; }

/* ── TABS (Admin) ────────────────────────────────────────────── */
.admin-tabs { display: flex; border-bottom: 2px solid var(--gray-200); margin-bottom: 24px; gap: 4px; }
.admin-tab {
  padding: 10px 20px;
  font-size: .9rem; font-weight: 600;
  color: var(--gray-500);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: var(--transition);
  background: none; border-top: none; border-left: none; border-right: none;
  font-family: inherit;
}
.admin-tab:hover { color: var(--navy); }
.admin-tab.active { color: var(--navy); border-bottom-color: var(--navy); }

/* ── MODAL ───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 480px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalIn .2s ease;
}
@keyframes modalIn { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-body { padding: 22px 24px; }
.modal-footer {
  padding: 16px 24px 20px;
  border-top: 1px solid var(--gray-100);
  display: flex; gap: 10px; justify-content: flex-end;
}
.btn-close {
  background: none; border: none;
  color: var(--gray-400); font-size: 1.4rem;
  cursor: pointer; line-height: 1;
}
.btn-close:hover { color: var(--gray-700); }

/* ── ALERT ───────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 500;
  margin-bottom: 16px;
  display: none;
}
.alert.show { display: block; }
.alert-error   { background: var(--red-bg);    color: var(--red);    border: 1px solid #fca5a5; }
.alert-success { background: var(--green-bg);  color: var(--green);  border: 1px solid #86efac; }
.alert-info    { background: var(--blue-bg);   color: var(--blue);   border: 1px solid #93c5fd; }

/* ── EMPTY STATE ─────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 56px 24px;
  color: var(--gray-500);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 14px; opacity: .6; }
.empty-state h3 { color: var(--gray-700); margin-bottom: 6px; }

/* ── LOGIN PAGE ──────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.login-left {
  background: linear-gradient(160deg, var(--navy-dark) 0%, var(--navy) 60%, var(--navy-light) 100%);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 48px;
  color: var(--white);
  position: relative; overflow: hidden;
}
.login-left::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.login-logo { position: relative; z-index: 1; text-align: center; margin-bottom: 32px; }
.login-logo-icon {
  width: 80px; height: 80px;
  background: var(--gold);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem; margin: 0 auto 16px;
}
.login-tagline { position: relative; z-index: 1; text-align: center; max-width: 360px; }
.login-tagline h1 { font-size: 2rem; margin-bottom: 12px; }
.login-tagline p  { opacity: .75; font-size: .92rem; line-height: 1.7; }
.login-features { margin-top: 40px; display: flex; flex-direction: column; gap: 12px; position: relative; z-index: 1; width: 100%; max-width: 320px; }
.login-feature {
  display: flex; gap: 10px; align-items: center;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px; padding: 11px 15px;
  font-size: .88rem; color: rgba(255,255,255,.85);
}
.login-feature span { font-size: 1.1rem; }

.login-right {
  display: flex; align-items: center; justify-content: center;
  background: var(--gray-50); padding: 48px;
}
.login-box { width: 100%; max-width: 400px; }
.login-box h2 { margin-bottom: 6px; }
.login-box .login-sub { color: var(--gray-500); font-size: .9rem; margin-bottom: 28px; }
.login-credentials {
  background: var(--blue-bg);
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 24px;
  font-size: .78rem;
  color: var(--gray-700);
}
.login-credentials strong { color: var(--navy); display: block; margin-bottom: 6px; }
.cred-row { display: flex; gap: 8px; justify-content: space-between; padding: 2px 0; }
.cred-row code {
  background: rgba(37,99,235,.1);
  padding: 1px 6px; border-radius: 4px;
  color: var(--blue); font-size: .75rem;
}

/* ── SEARCH BAR ──────────────────────────────────────────────── */
.search-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: 9px;
  padding: 0 14px;
  max-width: 320px;
  transition: border-color var(--transition);
}
.search-bar:focus-within { border-color: var(--navy); }
.search-bar input {
  border: none; outline: none;
  font-size: .88rem; padding: 9px 0;
  font-family: inherit; color: var(--gray-900);
  background: transparent; width: 100%;
}
.search-bar .search-icon { color: var(--gray-400); font-size: .9rem; }

/* ── TOOLBAR ─────────────────────────────────────────────────── */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }

/* ── MISC ────────────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--gray-100); margin: 18px 0; }
.text-muted { color: var(--gray-500); }
.text-right { text-align: right; }
.fw-bold  { font-weight: 700; }
.mt-4  { margin-top: 16px; }
.mb-4  { margin-bottom: 16px; }
.gap-2 { gap: 8px; }
.flex  { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ── FOOTER NEXORA ───────────────────────────────────────────── */
.app-footer {
  background: var(--navy-dark);
  color: rgba(255,255,255,.45);
  text-align: center;
  padding: 14px 24px;
  font-size: .75rem;
  display: flex; align-items: center; justify-content: center; gap: 18px;
  flex-wrap: wrap;
  margin-top: auto;
}
.app-footer strong { color: rgba(255,255,255,.75); font-weight: 600; }
.app-footer a { color: rgba(255,255,255,.5); text-decoration: underline; }
.app-footer .footer-sep { opacity: .3; }
body { display: flex; flex-direction: column; }
main.page-wrapper { flex: 1; }

/* ── NOTIFICATION TOAST ──────────────────────────────────────── */
.notif-toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 500;
  background: var(--navy-dark);
  color: var(--white);
  border-left: 4px solid var(--gold);
  border-radius: 10px;
  padding: 14px 18px;
  max-width: 340px;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: flex-start; gap: 12px;
  animation: toastIn .3s ease;
}
@keyframes toastIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.notif-toast-icon { font-size: 1.4rem; flex-shrink: 0; }
.notif-toast-title { font-weight: 700; font-size: .9rem; }
.notif-toast-body  { font-size: .82rem; opacity: .75; margin-top: 2px; }
.notif-toast-close { background: none; border: none; color: rgba(255,255,255,.5); font-size: 1.1rem; cursor: pointer; margin-left: auto; flex-shrink: 0; line-height: 1; }

/* ── ADMIN NOTIFICATION BADGE ────────────────────────────────── */
.notify-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--red); color: var(--white);
  font-size: .7rem; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 10px; padding: 0 4px;
  margin-left: 5px;
  animation: pulse 1.2s infinite;
}
@keyframes pulse { 0%,100%{ transform: scale(1); } 50%{ transform: scale(1.15); } }

/* ── TOPBAR CLOCK ────────────────────────────────────────────── */
.topbar-clock {
  font-size: .73rem;
  color: rgba(255,255,255,.5);
  white-space: nowrap;
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
  padding: 0 6px;
}
.brand-company-name { font-weight: 700; font-size: 1rem; display: block; line-height: 1.2; color: var(--white); }

/* ── PACKAGING CHIPS ─────────────────────────────────────────── */
.pkg-selector { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.pkg-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 11px; border-radius: 20px;
  border: 1.5px solid var(--gray-200);
  background: var(--white); color: var(--gray-600);
  font-size: .8rem; font-weight: 600; cursor: pointer;
  transition: var(--transition);
}
.pkg-chip:hover { border-color: var(--navy); color: var(--navy); }
.pkg-chip.active {
  background: var(--navy); border-color: var(--navy); color: var(--white);
}
.pkg-chip.sfuso.active   { background: #16a34a; border-color: #16a34a; }
.pkg-chip.cartone.active { background: var(--navy); border-color: var(--navy); }
.pkg-chip.bancale.active { background: #7c3aed; border-color: #7c3aed; }

.pkg-price-row { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.pkg-badge {
  font-size: .72rem; font-weight: 600; padding: 2px 8px;
  border-radius: 10px; background: var(--gray-100); color: var(--gray-600);
}
.pkg-badge.sfuso   { background: #dcfce7; color: #15803d; }
.pkg-badge.cartone { background: #dbeafe; color: #1d4ed8; }
.pkg-badge.bancale { background: #ede9fe; color: #6d28d9; }

/* ── PRICE LIST TYPE BADGE ────────────────────────────────────── */
.pricelist-badge {
  font-size: .72rem; font-weight: 600; padding: 3px 9px;
  border-radius: 10px; display: inline-block;
}
.pricelist-base   { background: var(--blue-bg); color: var(--blue); }
.pricelist-custom { background: #fef3c7; color: #92400e; }

/* ── LOGO UPLOAD ─────────────────────────────────────────────── */
.logo-upload-area {
  border: 2px dashed var(--gray-300);
  border-radius: 12px; padding: 24px;
  text-align: center; cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  background: var(--gray-50);
  min-height: 120px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
}
.logo-upload-area:hover { border-color: var(--navy); background: #f0f4f8; }
.logo-upload-area.has-logo { border-style: solid; border-color: var(--green); }
#logo-preview { max-height: 80px; max-width: 240px; object-fit: contain; border-radius: 8px; }
.logo-upload-hint { font-size: .82rem; color: var(--gray-500); }

/* ── RESPONSIVE ──────────────────────────────────────────────── */

/* ─── Admin: sidebar → barra orizzontale su tablet/mobile ─────── */
@media (max-width: 900px) {
  /* Rimuove il padding-left del body che lasciava spazio alla sidebar fissa */
  body { padding-left: 0 !important; padding-top: 52px; }

  .admin-sidebar {
    position: fixed !important;
    left: 0 !important; right: 0 !important;
    top: 0 !important; bottom: auto !important;
    width: 100% !important; height: 52px !important;
    flex-direction: row !important;
    overflow-x: auto !important; overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    z-index: 300 !important;
    box-shadow: 0 2px 16px rgba(0,0,0,.3) !important;
    align-items: center;
  }
  .admin-sidebar::-webkit-scrollbar { display: none; }

  /* Nascondi brand, clock, sezioni label */
  .sb-brand, .sb-clock, .sb-section-label { display: none !important; }

  /* Nav orizzontale */
  .sb-nav {
    flex-direction: row !important;
    padding: 4px 6px !important;
    gap: 2px !important;
    flex: 1 !important;
    overflow-x: auto;
    scrollbar-width: none;
    align-items: center;
  }
  .sb-nav::-webkit-scrollbar { display: none; }

  .sb-item {
    flex-direction: column !important;
    gap: 1px !important;
    padding: 5px 10px !important;
    font-size: .6rem !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    border-radius: 7px !important;
    min-width: 48px;
    align-items: center;
  }
  .sb-item .si { font-size: 1rem !important; width: auto !important; }
  .sb-badge {
    position: absolute; top: 3px; right: 3px;
    padding: 0 4px !important; font-size: .55rem !important;
    min-width: 14px; height: 14px;
  }
  .sb-item { position: relative; }

  /* Bottom section: compatto a destra */
  .sb-bottom {
    flex-direction: row !important;
    padding: 4px 8px !important;
    border-top: none !important;
    border-left: 1px solid rgba(255,255,255,.1) !important;
    align-items: center; gap: 4px !important;
    flex-shrink: 0; margin-left: auto;
  }
  .sb-user { display: none !important; }
  .sb-bell {
    padding: 5px 9px !important; font-size: .7rem !important;
    border-radius: 7px !important;
  }
  .sb-bell > span:not(:first-child) { display: none; }
  .sb-logout {
    padding: 5px 10px !important; font-size: .7rem !important;
    white-space: nowrap; border-radius: 7px !important;
  }

  /* Contenuto principale a piena larghezza */
  .page-wrapper { padding: 16px 12px !important; }
}

/* ─── Tablet ≤768px ─────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Login: solo pannello destro */
  .login-page { grid-template-columns: 1fr; }
  .login-left { display: none; }
  .login-right { padding: 32px 24px; }

  /* Topbar compatta */
  .topbar { padding: 0 14px; height: 54px; }
  .topbar-clock { display: none; }
  .topbar-nav { display: none; }
  .topbar-brand .brand-sub { display: none; }
  .topbar-right { gap: 10px; }

  /* Layout */
  .page-wrapper { padding: 16px 14px; }

  /* Product grid 2 colonne */
  .product-grid { grid-template-columns: 1fr 1fr; }

  /* Stats 2 colonne */
  .stats-grid { grid-template-columns: 1fr 1fr; }

  /* Admin tabs scorrevoli */
  .admin-tabs {
    overflow-x: auto; flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; padding-bottom: 2px;
  }
  .admin-tabs::-webkit-scrollbar { display: none; }
  .admin-tab { white-space: nowrap; padding: 10px 14px; font-size: .84rem; flex-shrink: 0; }

  /* Toolbar */
  .toolbar { flex-wrap: wrap; gap: 10px; }
  .search-bar { max-width: 100%; width: 100%; }

  /* Form grids → colonna singola */
  .form-row-2 { grid-template-columns: 1fr; gap: 0; }

  /* Tabelle */
  td, th { padding: 10px 10px; }

  /* Modal da fondo schermo su mobile */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal {
    border-radius: 20px 20px 0 0;
    max-height: 90vh; overflow-y: auto;
    width: 100%; max-width: 100%;
  }
  .modal-xl, .modal-order {
    width: 100% !important; max-width: 100% !important;
    max-height: 92vh !important;
    border-radius: 20px 20px 0 0 !important;
  }
  .modal-xl .modal-body,
  .modal-order .modal-body { padding: 18px 16px !important; }
}

/* ─── Mobile ≤520px ─────────────────────────────────────────── */
@media (max-width: 520px) {
  /* Product grid 1 colonna */
  .product-grid { grid-template-columns: 1fr; }

  /* Stats: 2 colonne compatte */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px 14px; gap: 10px; }
  .stat-value { font-size: 1.3rem; }

  /* Nascondi nome utente nella topbar, tieni avatar */
  .topbar-user > span:not(.user-avatar) { display: none; }

  /* Bottoni */
  .btn-lg { padding: 11px 18px; font-size: .9rem; }
  .toolbar .btn { font-size: .8rem; padding: 8px 12px; }

  /* Card */
  .card-body { padding: 14px 14px; }
  .card-header { padding: 12px 14px; flex-wrap: wrap; gap: 8px; }

  /* Titolo pagina */
  .page-header h1 { font-size: 1.35rem; }
  h2 { font-size: 1.25rem; }

  /* Summary box */
  .summary-box { padding: 16px 16px; }

  /* Welcome grid setup → 1 colonna */
  .welcome-grid { grid-template-columns: 1fr !important; }

  /* Toast notification */
  .notif-toast { bottom: 12px; right: 12px; left: 12px; max-width: none; }

  /* Login box */
  .login-right { padding: 24px 18px; }
}
