* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', system-ui, sans-serif; background: linear-gradient(160deg,#f6fbff 0%, #d4ecff 100%); color: #0f172a; font-size: 16px; }
.theme-primary { color: #3d96da; }
.bg-primary { background: #3d96da; }
.bg-accent { background: #f7d518; }
.pulse { animation: pulse 2s infinite; }
@keyframes pulse { 0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(61,150,218,0.35);} 70% { transform: scale(1.02); box-shadow: 0 0 0 12px rgba(61,150,218,0);} 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(61,150,218,0);} }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px);} to { opacity: 1; transform: translateY(0);} }

.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #3D96DA; }
.login-card { width: 440px; background: #fff; padding: 32px; border-radius: 18px; box-shadow: 0 20px 50px rgba(61,150,218,.25); border: 1px solid rgba(61,150,218,.15); }
.login-card .brand { flex-direction: column; gap: 8px; animation: fadeUp .4s ease; }
.login-card .brand img { width: 250px; height: auto; }
.login-card small { color: #3d96da; font-weight: 700; letter-spacing: .3px; }
.login-card h2 { margin: 12px 0 16px; }
.login-card .brand { justify-content: center; align-items: center; }
.login-card h3 { margin: 12px 0 8px; }
.login-actions { position: fixed; top: 20px; right: 24px; display: flex; gap: 10px; z-index: 10; flex-wrap: wrap; justify-content: flex-end; }
.login-actions .btn { padding: 8px 16px; }
.divider { height: 1px; width: 100%; background: rgba(15,23,42,.12); margin: 16px 0; }
.full-width { width: 100%; }
.password-wrap { display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: center; }

.app-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; gap: 18px; padding: 18px; }

body.sidebar-collapsed .app-shell { grid-template-columns: 86px 1fr; }
body.sidebar-collapsed .sidebar { max-width: 86px; padding: 16px 10px; }
body.sidebar-collapsed .brand { justify-content: center; }
body.sidebar-collapsed .brand img { display: none; }
body.sidebar-collapsed .brand { margin-bottom: 8px; }
body.sidebar-collapsed .user-code { display: none; }
body.sidebar-collapsed .nav-link,
body.sidebar-collapsed .sidebar-btn {
  grid-template-columns: 1fr;
  justify-items: center;
}
body.sidebar-collapsed .nav-link { position: relative; padding: 10px; }
body.sidebar-collapsed .nav-link span:not(.nav-icn):not(.nav-text) { display: none; }
body.sidebar-collapsed .nav-text { position: absolute; top: 6px; right: 6px; font-size: 0; gap: 0; width: auto; }
body.sidebar-collapsed .nav-text .nav-badge { font-size: .7rem; }
body.sidebar-collapsed .sidebar-btn span:last-child { display: none; }
body.sidebar-collapsed .sidebar-actions { gap: 6px; }

.sidebar { background: linear-gradient(180deg,#3d96da 0%, #2f78b1 100%); color: #fff; border-radius: 24px; padding: 20px; box-shadow: 0 20px 45px rgba(61,150,218,.35); display: flex; flex-direction: column; height: calc(100vh - 36px); min-height: calc(100vh - 36px); width: 100%; max-width: 260px; position: sticky; top: 18px; align-self: start; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.sidebar .brand { width: 100%; justify-content: space-between; }
.brand img { width: 200px; height: auto; }
.brand strong { font-size: 1.2rem; }
.brand small { color: rgba(255,255,255,.85); letter-spacing: .3px; }
.user-code { margin-bottom: 16px; font-size: .9rem; color: rgba(255,255,255,.85); }
.nav-link { display: grid; grid-template-columns: 32px 1fr; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; color: rgba(255,255,255,.88); text-decoration: none; font-weight: 700; }
.nav-link .nav-icn { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; background: rgba(255,255,255,.12); border-radius: 10px; }
.nav-text { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; }
.nav-badge { min-width: 20px; height: 20px; padding: 0 7px; border-radius: 999px; background: #ff3b30; color: #fff; font-size: .7rem; font-weight: 800; line-height: 20px; text-align: center; box-shadow: 0 6px 14px rgba(255,59,48,.35); }
.nav-badge.is-hidden { display: none; }
.nav-link:hover, .nav-link.active { background: rgba(255,255,255,.16); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.15); }
.sidebar-actions { margin-top: auto; display: grid; gap: 8px; }
.sidebar-btn { display: grid; grid-template-columns: 32px 1fr; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; font-weight: 700; border: 1px solid rgba(255,255,255,.12); color: rgba(255,255,255,.9); background: rgba(255,255,255,.1); text-decoration: none; }
.sidebar-btn.logout { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.2); color: #fff; }
.sidebar-btn.logout { background: #fff; color: #0f172a; border: 1px solid rgba(15,23,42,.12); }

.sidebar-toggle {
  display: inline-flex;
  width: 46px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(15,23,42,.2);
  background: #fff;
  color: #0f172a;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.sidebar-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: #0f172a;
  border-radius: 999px;
}
.sidebar-toggle svg {
  width: 24px;
  height: 24px;
  fill: #0f172a;
}
.sidebar .sidebar-toggle {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.18);
  color: #fff;
}
.sidebar .sidebar-toggle svg {
  width: 18px;
  height: 18px;
  fill: #fff;
}
body.sidebar-collapsed .sidebar .sidebar-toggle {
  margin: 0 auto 8px;
}
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.55);
  z-index: 10;
}

.main { background: #fff; border-radius: 24px; padding: 24px; box-shadow: 0 20px 45px rgba(15,23,42,.08); border: 1px solid rgba(15,23,42,.08); }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 16px; flex-wrap: wrap; }
.title { font-size: 1.5rem; font-weight: 700; }
.subtitle { color: #64748b; font-size: 1rem; }
.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.topbar-status { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid rgba(15,23,42,.12);
  background: #f8fbff;
  color: #0f172a;
}
.status-pill.warn { background: #fef3c7; border-color: rgba(217,119,6,.35); color: #92400e; }
.status-pill.info { background: #e0f2fe; border-color: rgba(59,130,246,.35); color: #0f172a; }
.wallet { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.wallet.inline { flex-direction: row; align-items: center; gap: 6px; }
.wallet span { font-size: .9rem; color: #4f7fad; }
.wallet strong { font-size: 1.2rem; color: #3d96da; }
.plan-badge { background: #eef2ff; color: #312e81; padding: 6px 10px; border-radius: 999px; font-weight: 700; font-size: .85rem; border: 1px solid rgba(49,46,129,.15); }
.checkbox-inline { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; font-weight: 600; }
.checkbox-inline input { width: 16px; height: 16px; }
.dashboard-messages { display: grid; gap: 10px; margin-bottom: 18px; }
.dashboard-message-item { border-radius: 14px; padding: 12px 14px; border: 1px solid rgba(61,150,218,.25); background: #f8fbff; }
.dashboard-message-item.maintenance { border-color: rgba(249,115,22,.35); background: #fff7ed; }
.dashboard-message-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.dashboard-message-title { font-weight: 800; color: #0f172a; }
.dashboard-message-type { font-size: .78rem; font-weight: 700; padding: 4px 8px; border-radius: 999px; background: #e0f2fe; color: #1d4f91; border: 1px solid rgba(59,130,246,.3); }
.dashboard-message-item.maintenance .dashboard-message-type { background: #ffedd5; color: #9a3412; border-color: rgba(249,115,22,.35); }
.dashboard-message-body { color: #334155; font-size: .95rem; line-height: 1.45; white-space: pre-wrap; }
.dashboard-message-window { color: #64748b; font-size: .82rem; margin-top: 6px; }
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  width: 100%;
  text-align: center;
  letter-spacing: 0.02em;
}
.status-da-incassare {
  background: #e0f2fe;
  color: #0f172a;
  border: 1px solid rgba(59,130,246,0.45);
}
.status-processing {
  background: #e0f2fe;
  color: #0f172a;
  border: 1px solid rgba(59,130,246,0.45);
}
.status-open {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid rgba(217,119,6,0.35);
}
.status-pending {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid rgba(217,119,6,0.35);
}
.status-closed {
  background: #dcfce7;
  color: #065f46;
  border: 1px solid rgba(16,185,129,0.4);
}
.status-approved {
  background: #dcfce7;
  color: #065f46;
  border: 1px solid rgba(16,185,129,0.4);
}
.status-paid {
  background: #dcfce7;
  color: #065f46;
  border: 1px solid rgba(16,185,129,0.4);
}
.status-incassato {
  background: #dcfce7;
  color: #065f46;
  border: 1px solid rgba(16,185,129,0.4);
}
.status-failed {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid rgba(239,68,68,.4);
}
.status-rejected {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid rgba(239,68,68,.4);
}
.status-canceled {
  background: #e2e8f0;
  color: #475569;
  border: 1px solid rgba(148,163,184,.4);
}
.health-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.health-card { background: #f8fbff; border: 1px solid rgba(15,23,42,.08); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.health-title { display: flex; align-items: center; justify-content: space-between; font-weight: 700; }
.health-meta { color: #64748b; font-size: .85rem; }
.health-badge { display: inline-flex; align-items: center; justify-content: center; padding: 4px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; letter-spacing: .02em; }
.health-ok { background: #dcfce7; color: #065f46; border: 1px solid rgba(16,185,129,.4); }
.health-warn { background: #fef3c7; color: #92400e; border: 1px solid rgba(217,119,6,.35); }
.health-error { background: #fee2e2; color: #991b1b; border: 1px solid rgba(239,68,68,.4); }
.health-off { background: #e2e8f0; color: #475569; border: 1px solid rgba(148,163,184,.4); }
.health-list th { font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: #64748b; }
.health-list td { font-size: .95rem; }
.status-dot { width: 10px; height: 10px; border-radius: 999px; display: inline-block; margin-right: 8px; box-shadow: 0 0 0 4px rgba(0,0,0,0.04) inset; }
.dot-ok { background: #16a34a; }
.dot-warn { background: #f59e0b; }
.dot-error { background: #ef4444; }
.dot-off { background: #94a3b8; }

.btn { border: 1px solid rgba(61,150,218,.45); border-radius: 999px; padding: 10px 18px; font-weight: 700; cursor: pointer; background: #fff; color: #2f78b1; transition: transform .12s ease, box-shadow .12s ease, background .12s ease; }
.btn.primary { background: linear-gradient(135deg,#3d96da,#2f78b1); color: #fff; border: none; box-shadow: 0 10px 28px rgba(61,150,218,.28); }
.btn.outline { background: #fff; color: #2f78b1; }
.btn.ghost { background: #fff; color: #0f172a; border: 1px solid rgba(61,150,218,.25); }
.btn:hover { transform: translateY(-1px); box-shadow: 0 12px 24px rgba(61,150,218,.18); }
.hidden { display: none !important; }
.btn.compare-btn { padding: 10px 22px; min-width: 140px; height: 46px; }
.compare-row { display: none; justify-content: flex-end; margin-top: 12px; gap: 10px; flex-wrap: wrap; }
body[data-step="1"] .compare-row { display: flex; }
.compare-row.compare-float { position: absolute; right: 24px; bottom: 24px; margin-top: 0; }
#section-dati { position: relative; padding-bottom: 88px; }
@media (max-width: 900px) {
  .compare-row.compare-float { position: static; margin-top: 12px; }
  #section-dati { padding-bottom: 24px; }
}

.card { background: #fff; border: 1px solid rgba(15,23,42,.08); border-radius: 20px; padding: 22px; margin-bottom: 18px; box-shadow: 0 12px 30px rgba(15,23,42,.05); }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.table-toolbar { display: flex; align-items: center; gap: 12px; }
.table-toolbar.right { margin-left: auto; justify-content: flex-end; }
.table-toolbar .input { width: 280px; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(15,23,42,.12); background: #f8fbff; }
.table-toolbar { margin: 6px 0 12px; }
.bulk-toolbar { margin: 6px 0 12px; justify-content: space-between; }
.col-select { width: 38px; }
.select-checkbox { width: 16px; height: 16px; }
.export-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.5); display: flex; align-items: center; justify-content: center; z-index: 9999; }
.export-modal { background: #f7f3f8; border-radius: 24px; width: min(720px, 92vw); box-shadow: 0 20px 60px rgba(15,23,42,.25); padding: 22px; }
.export-header { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 1.1rem; margin-bottom: 8px; }
.export-desc { color: #5b6776; margin-bottom: 16px; }
.export-count { display: flex; align-items: center; gap: 10px; background: #f2e9f2; border-radius: 12px; padding: 10px 12px; margin-bottom: 14px; }
.export-card { background: #e7e3e9; border-radius: 16px; padding: 14px; margin-bottom: 14px; border: 1px solid rgba(15,23,42,.08); }
.export-card.active { border-color: #c75b2c; box-shadow: 0 0 0 2px rgba(199, 91, 44, 0.15); }
.export-card .card-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.export-card .card-body { margin-top: 12px; color: #4b5563; font-size: 0.95rem; }
.export-slider { width: 100%; margin-top: 10px; }
.export-footer { display: flex; justify-content: flex-end; gap: 12px; margin-top: 16px; }
.table-footer { margin-top: 12px; display: flex; justify-content: flex-end; }
.pager { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rubrica-footer { justify-content: space-between; align-items: center; }
.title-sm { font-size: 1.1rem; font-weight: 700; }
.muted { color: #64748b; font-size: .95rem; }
.muted.is-error { color: #ef4444; font-weight: 700; }
.muted.ok { color: #16a34a; font-weight: 700; }
.muted.small { font-size: .85rem; }

.pwd-strength-row { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.pwd-strength-dot { width: 10px; height: 10px; border-radius: 999px; display: inline-block; box-shadow: 0 0 0 4px rgba(0,0,0,0.04) inset; }
.pwd-strength-meter { display:grid; grid-template-columns: repeat(4, 1fr); gap:6px; margin-top:8px; }
.pwd-strength-meter span { height: 8px; border-radius: 999px; background: rgba(148,163,184,.35); }
.pwd-strength[data-level="off"] .pwd-strength-dot { background:#94a3b8; box-shadow: 0 0 0 4px rgba(148,163,184,.18); }
.pwd-strength[data-level="weak"] .pwd-strength-meter span:nth-child(-n+1) { background:#ef4444; }
.pwd-strength[data-level="weak"] .pwd-strength-dot { background:#ef4444; box-shadow: 0 0 0 4px rgba(239,68,68,.15); }
.pwd-strength[data-level="medium"] .pwd-strength-meter span:nth-child(-n+2) { background:#f59e0b; }
.pwd-strength[data-level="medium"] .pwd-strength-dot { background:#f59e0b; box-shadow: 0 0 0 4px rgba(245,158,11,.18); }
.pwd-strength[data-level="good"] .pwd-strength-meter span:nth-child(-n+3) { background:#22c55e; }
.pwd-strength[data-level="good"] .pwd-strength-dot { background:#22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.15); }
.pwd-strength[data-level="strong"] .pwd-strength-meter span { background:#22c55e; }
.pwd-strength[data-level="strong"] .pwd-strength-dot { background:#22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.15); }

.impersonation-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9998;
  background: #ffec00;
  color: #dc0032;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .02em;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(15,23,42,.12);
  box-shadow: 0 10px 24px rgba(15,23,42,.10);
}

body.has-impersonation-banner { padding-top: 46px; }

.bar-chart {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 10px;
  align-items: end;
  height: 180px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(15,23,42,.08);
  background: rgba(255,255,255,.7);
  overflow: hidden;
}

.bar-chart .bar {
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: end;
  gap: 6px;
}

.bar-chart .bar-fill {
  width: 100%;
  height: 20%;
  border-radius: 10px;
  background: linear-gradient(135deg,#22d3ee,#2563eb);
  box-shadow: 0 10px 22px rgba(37,99,235,.18);
  transform-origin: bottom;
}

.bar-chart .bar-label {
  font-size: 11px;
  color: #64748b;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.bar-chart.days-30 {
  grid-template-columns: repeat(30, 1fr);
  gap: 6px;
}

.bar-chart.days-30 .bar-label {
  font-size: 9px;
}
.section-title { grid-column: 1/-1; font-weight: 700; margin-top: 8px; color: #0f172a; }
.title-with-icon { display: inline-flex; align-items: center; gap: 8px; }
.title-icn { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; background: rgba(15,23,42,.06); border-radius: 10px; font-size: 16px; }

.suggestions { margin-top: 6px; border: 1px solid rgba(15,23,42,.1); border-radius: 12px; overflow: hidden; background: #fff; box-shadow: 0 10px 24px rgba(15,23,42,.08); display: none; max-height: 200px; overflow-y: auto; }
.suggestion-item { padding: 10px 12px; cursor: pointer; }
.suggestion-item:hover { background: rgba(37,99,235,.08); }

.carrier-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(240px,1fr)); gap: 10px; }
.carrier-card { border: 1px solid rgba(15,23,42,.08); border-radius: 12px; padding: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #f8fbff; }
.carrier-info { display: grid; gap: 4px; }
.carrier-card .muted { font-size: .9rem; }
.locker-addons { margin-top: 12px; }

.stepper { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-bottom: 20px; align-items: center; }
.step { text-align: center; padding: 8px 10px; border-radius: 999px; border: 1px solid rgba(37,99,235,.2); color: #64748b; font-weight: 600; font-size: .9rem; }
.step.active { background: linear-gradient(135deg,#22d3ee,#2563eb); color: #fff; border: none; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(240px,1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1/-1; }
.field label { font-weight: 700; color: #0f172a; font-size: .98rem; }
.field input, .field select, .field textarea { border: 1px solid rgba(15,23,42,.12); border-radius: 12px; padding: 12px 14px; font-size: 1rem; background: #f8fbff; }
.field textarea { resize: vertical; min-height: 120px; }
.field input[readonly],
.field input:disabled,
.field select:disabled,
.field textarea:disabled {
  background: #f1f5f9;
  color: #334155;
}
.field.is-invalid input, .field.is-invalid select, .field.is-invalid textarea {
  border-color: rgba(239,68,68,.75);
  box-shadow: 0 0 0 2px rgba(239,68,68,.12);
  background: #fff5f5;
}
.actions-row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }
.actions-row.end { justify-content: flex-end; }
.summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.summary-actions .btn {
  padding: 8px 12px;
  font-size: 0.9rem;
}
.actions-row.wrap { justify-content: flex-start; }
.btn.small { padding: 6px 10px; font-size: .85rem; }
.status-line { margin-top: 10px; }
.actions-col { text-align: center !important; }
.wallet-table td.actions-col { text-align: left; }
.actions-inline { display: inline-flex; align-items: center; gap: 6px; }
.wallet-table .actions-center { display: flex; justify-content: center; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgba(15,23,42,.12); background: #fff; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, color .15s ease; color: #0f172a; }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(15,23,42,.12); border-color: rgba(37,99,235,.4); color: #2563eb; }
.icon-btn:active { transform: translateY(0); box-shadow: 0 4px 10px rgba(15,23,42,.12); }
.icon-btn.ok { border-color: rgba(16,185,129,.35); color: #16a34a; }
.icon-btn.ok:hover { border-color: rgba(16,185,129,.6); color: #15803d; }
.icon-btn.danger { border-color: rgba(239,68,68,.35); color: #ef4444; }
.icon-btn.danger:hover { border-color: rgba(239,68,68,.65); color: #dc2626; }
.icon-btn.warn { border-color: rgba(245,158,11,.45); color: #f59e0b; }
.icon-btn.warn:hover { border-color: rgba(245,158,11,.75); color: #d97706; }
.icon-btn.muted { border-color: rgba(148,163,184,.45); color: #64748b; }
.icon-btn.muted:hover { border-color: rgba(148,163,184,.7); color: #475569; }
.icon-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.shipment-cancel-request {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .02em;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid rgba(217,119,6,.35);
}

.table-wrap { overflow: auto; border-radius: 16px; border: 1px solid rgba(15,23,42,.08); }
.table-wrap table { width: 100%; min-width: 900px; border-collapse: separate; border-spacing: 0; }
.table-wrap th,
.table-wrap td { vertical-align: middle; }
.table-wrap .tracking-ellipsis { max-width: none; white-space: nowrap; }
.table-wrap table.wallet-table { min-width: 0; }
.table-wrap.admin-ship-wrap { max-width: 100%; overflow-x: auto; overflow-y: hidden; }
.table-wrap table.admin-ship-table { min-width: 1380px; table-layout: auto; }
.table-wrap table.admin-ship-table th,
.table-wrap table.admin-ship-table td { white-space: nowrap; }
.table-wrap table.admin-ship-table td:nth-child(4),
.table-wrap table.admin-ship-table td:nth-child(6) { white-space: normal; }
.table-wrap table.admin-ship-table th:nth-child(1),
.table-wrap table.admin-ship-table td:nth-child(1) { width: 42px; }
.table-wrap table.admin-ship-table th:nth-child(7),
.table-wrap table.admin-ship-table td:nth-child(7) { width: 74px; text-align: center; }
.table-wrap table.admin-ship-table th:nth-child(8),
.table-wrap table.admin-ship-table td:nth-child(8) { width: 190px; }
.table-wrap table.admin-ship-table th:nth-child(11),
.table-wrap table.admin-ship-table td:nth-child(11) { width: 82px; text-align: center; }
.table-wrap table.admin-ship-table th:nth-child(12),
.table-wrap table.admin-ship-table td:nth-child(12) { width: 150px; }
.main,
.card { overflow-x: hidden; }
.table-toolbar.admin-ship-toolbar { max-width: 100%; flex-wrap: wrap; }
.table-toolbar.admin-ship-toolbar > * { min-width: 0; }
.table-toolbar.admin-ship-toolbar .admin-ship-search { flex: 1 1 320px; min-width: 220px; width: auto; }
.table-wrap thead th { background: #eef3fc; padding: 12px; text-align: left; font-size: .95rem; font-weight: 700; color: #64748b; text-transform: uppercase; }
.table-wrap tbody td { padding: 12px; border-bottom: 1px solid rgba(15,23,42,.06); font-size: 1rem; }
.table-wrap tbody tr:nth-child(even) { background: rgba(15,23,42,.015); }
.table-wrap tbody tr.group-row td { background: #e9f1ff; font-weight: 700; color: #1e3a8a; text-transform: uppercase; font-size: .85rem; }
.table-wrap tbody tr.group-subrow td { background: #f4f7ff; font-weight: 600; color: #334155; }
.table-wrap .empty { text-align: center; color: #64748b; padding: 18px; }
.table-wrap .code-ellipsis {
  display: inline-block;
  max-width: 10ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
.table-wrap .code-ellipsis-5 {
  display: inline-block;
  max-width: 6ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
@media (max-width: 900px) {
  .table-wrap .code-ellipsis {
    max-width: 7ch;
  }
  .table-toolbar.admin-ship-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    justify-content: stretch;
  }
  .table-toolbar.admin-ship-toolbar .input { width: 100%; min-width: 0 !important; }
  .table-toolbar.admin-ship-toolbar > * { min-width: 0; }
}
@media (min-width: 900px) {
  .table-wrap .code-ellipsis {
    max-width: none;
  }
}
.tracking-link {
  color: #1d4ed8;
  font-weight: 600;
  text-decoration: none;
}
.tracking-link:hover {
  text-decoration: underline;
}
.tracking-ellipsis {
  display: inline-block;
  max-width: 6ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
.storico-table th:nth-child(7),
.storico-table td:nth-child(7) {
  min-width: 190px;
}
.storico-table .tracking-ellipsis {
  max-width: none;
  overflow: visible;
  text-overflow: unset;
  white-space: nowrap;
}
.extra-link {
  color: inherit;
  text-decoration: underline;
  font-weight: 700;
}
.extra-link:hover {
  text-decoration-thickness: 2px;
}
.amount-negative { color: #DC0032; font-weight: 700; }
.amount-positive { color: #16a34a; font-weight: 700; }
.amount-zero { color: #94a3b8; font-weight: 700; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(280px,1fr)); gap: 12px; }
.card-grid.integrations-grid { grid-template-columns: repeat(3, minmax(280px, 1fr)); }
.integration-pricing-box {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #eef5ff;
  border: 1px solid #c7dbff;
  box-shadow: none;
}
.integration-pricing-list { margin-top: 10px; display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(220px, 1fr)); }
.integration-pricing-item { border: 1px solid rgba(15,23,42,.08); border-radius: 12px; padding: 10px 12px; background: #f8fbff; }
.integration-pricing-name { font-weight: 800; color: #0f172a; margin-bottom: 6px; }
.integration-pricing-values { display: grid; gap: 4px; color: #334155; font-size: .92rem; }
.card-header-right { display: inline-flex; align-items: center; gap: 10px; }
.card-header-right .status-dot { margin-right: 0; }
.card-grid.rubrica-grid { grid-template-columns: 1fr; }
.profile-grid { grid-template-columns: 1fr; }
.profile-grid .card { width: 100%; }
.status-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.status-dot.ok { background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.15); }
.status-dot.ko { background: #ef4444; box-shadow: 0 0 0 4px rgba(239,68,68,.15); }
.status-dot.warn { background: #f59e0b; box-shadow: 0 0 0 4px rgba(245,158,11,.18); }

.profile-status { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 999px; border: 1px solid rgba(15,23,42,.10); background: rgba(255,255,255,.65); }

.status-tick { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 999px; font-weight: 900; font-size: 14px; line-height: 1; }
.status-tick.ok { color: #16a34a; background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.35); }
.status-tick.ko { color: #ef4444; background: rgba(239,68,68,.10); border: 1px solid rgba(239,68,68,.30); }

.plan-cell { text-transform: uppercase; }

.stepper-bar { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.stepper-bar .step { text-align: center; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(37,99,235,.18); background: #f8fbff; font-weight: 700; color: #0f172a; }

@media (max-width: 1200px) {
  .app-shell { grid-template-columns: 1fr; padding: 12px; }
  .sidebar { position: relative; top: 0; height: auto; min-height: auto; max-width: none; }
  .sidebar nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 6px; }
  .sidebar-actions { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
  .main { padding: 20px; }
  .card-grid.integrations-grid { grid-template-columns: repeat(2, minmax(280px, 1fr)); }
  .integration-pricing-list { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
}

@media (max-width: 900px) {
  .topbar { flex-direction: column; align-items: flex-start; }
  .actions { width: 100%; justify-content: flex-start; }
  .wallet.inline { align-items: center; }
  .card-grid { grid-template-columns: 1fr; }
  .card-grid.integrations-grid { grid-template-columns: 1fr; }
  .integration-pricing-list { grid-template-columns: 1fr; }
  .card { padding: 18px; }
  .table-toolbar { width: 100%; }
  .table-toolbar .input { width: 100%; }
  .table-footer { justify-content: flex-start; }
  .actions-row.end { justify-content: flex-start; }
}

@media (max-width: 600px) {
  .brand img { width: 160px; }
  .nav-link { grid-template-columns: 28px 1fr; padding: 10px; }
  .nav-link .nav-icn { width: 24px; height: 24px; font-size: 16px; }
  .main { padding: 16px; }
  .table-wrap table { min-width: 720px; }
  .table-wrap table.admin-ship-table { min-width: 1220px; }
}
.stepper-bar .step.active { background: linear-gradient(135deg,#22d3ee,#2563eb); color: #fff; border: none; box-shadow: 0 10px 25px rgba(37,99,235,.22); }

.section-block { background: #f8fbff; border: 1px solid rgba(15,23,42,.08); border-radius: 16px; padding: 14px 14px 6px; margin-bottom: 14px; }
.section-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.orange { background: #f97316; }
.dot.red { background: #ef4444; }
.dot.blue { background: #2563eb; }
.dot.green { background: #22c55e; }
.pill-select { padding: 8px 10px; border-radius: 12px; border: 1px solid rgba(15,23,42,.1); background: #fff; font-weight: 600; }
.ts-wrapper.pill-select { padding: 0; border: 0; background: transparent; }
.ts-wrapper.pill-select.single .ts-control { width: 250px;padding: 8px 10px; border-radius: 12px; border: 1px solid rgba(15,23,42,.1); background: #fff; font-weight: 600; box-shadow: none; }
.ts-wrapper.pill-select.single .ts-control::after { margin-right: 2px; }
.ts-wrapper.pill-select.single .ts-dropdown { border-radius: 12px; border: 1px solid rgba(15,23,42,.12); box-shadow: 0 18px 40px rgba(15,23,42,.18); }
.two-col { display: grid; grid-template-columns: repeat(auto-fit,minmax(240px,1fr)); gap: 12px; }
.four-col { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 12px; }
.actions-row.end { justify-content: flex-end; }

/* Modal ritiro */
.pickup-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; z-index: 9999; padding: 16px; }
.pickup-card { background: #fff; border-radius: 14px; box-shadow: 0 20px 50px rgba(0,0,0,.12); width: min(720px, 96vw); max-height: min(88vh, 920px); padding: 16px; position: relative; overflow: hidden; display: flex; flex-direction: column; }
.pickup-card .modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.pickup-card .modal-body { display: grid; gap: 12px; overflow: hidden; }
.pickup-card .pickup-results { overflow: auto; max-height: 70vh; padding-right: 4px; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.pickup-card .pickup-item { border: 1px solid rgba(15,23,42,.08); border-radius: 12px; padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; gap: 10px; background: #f9fbff; box-shadow: 0 4px 14px rgba(15,23,42,.06); }
.pickup-card .pickup-item .title-sm { margin: 0; }
.pickup-card .pickup-item .muted { font-size: .9rem; }
.pickup-card .modal-footer { margin-top: 12px; display: flex; justify-content: flex-end; gap: 8px; }
.pickup-card .form-label { font-size: 13px; color: #465569; }
.pickup-card .input { width: 100%; }

/* Map layout for pickup modal */
.pickup-card.pickup-wide { width: min(1100px, 96vw); }
.pickup-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; min-height: 520px; }
.pickup-map { width: 100%; height: 520px; border-radius: 12px; overflow: hidden; border: 1px solid #dbe5f0; }
.pickup-list { background: #f8fafc; border: 1px solid #e5ecf4; border-radius: 12px; padding: 12px; overflow-y: auto; max-height: 520px; display: grid; gap: 10px; }
.pickup-list .pickup-item { display: flex; flex-direction: column; align-items: flex-start; border: 1px solid rgba(15,23,42,.08); border-radius: 14px; background: #fff; box-shadow: 0 10px 24px rgba(15,23,42,.06); padding: 12px; gap: 8px; }
.pickup-list .pickup-item + .pickup-item { margin-top: 4px; }
.pickup-list .actions-row .btn { margin-left: 0; }
.pickup-list .actions-row { gap: 8px; }
.pickup-item-header { display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: 10px; width: 100%; }
.pickup-point-brand { width: 44px; height: 44px; border-radius: 11px; border: 1px solid rgba(15,23,42,.10); display: grid; place-items: center; background: #fff; }
.pickup-point-brand img { width: 30px; height: 30px; object-fit: contain; }
.pickup-item-title { color: #b24414; font-weight: 800; font-size: 1.25rem; line-height: 1.15; letter-spacing: -.01em; }
.pickup-item-body { width: 100%; display: grid; gap: 6px; }
.pickup-item-label { color: #1d4f91; font-size: .92rem; font-weight: 700; }
.pickup-item-address { color: #334155; font-size: .98rem; line-height: 1.4; }
.pickup-item-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; }
.pickup-item-distance, .pickup-item-code { font-size: .9rem; }
.pickup-map .leaflet-control-zoom a { width: 32px; height: 32px; line-height: 30px; color: #0f172a; border-radius: 8px; border: 1px solid rgba(15,23,42,.15); box-shadow: 0 8px 18px rgba(15,23,42,.12); }
.pickup-map .leaflet-popup-content-wrapper { border-radius: 12px; border: 1px solid rgba(15,23,42,.12); box-shadow: 0 16px 34px rgba(15,23,42,.18); }
.pickup-map .leaflet-popup-content { margin: 10px 12px; line-height: 1.4; }
.pickup-marker-wrap { background: transparent; border: 0; }
.pickup-marker { width: 34px; height: 44px; border-radius: 18px 18px 18px 0; transform: rotate(-45deg); border: 2px solid rgba(15,23,42,.25); box-shadow: 0 12px 20px rgba(15,23,42,.25); display: flex; align-items: center; justify-content: center; }
.pickup-marker::after { content: ""; width: 10px; height: 10px; border-radius: 999px; background: #fff; transform: rotate(45deg); box-shadow: 0 0 0 1px rgba(15,23,42,.12); }
.pickup-marker-brt { background: linear-gradient(180deg,#173f86,#0f172a); }
.pickup-marker-inpost { background: linear-gradient(180deg,#f9c400,#f59e0b); }
.country-select { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(15,23,42,.12); background: #fff; font-weight: 600; color: #0f172a; }
.mt-20 { margin-top: 20px !important; display: inline-block; }

@media (max-width: 900px) {
  .pickup-layout { grid-template-columns: 1fr; }
  .pickup-map { height: 320px; }
  .pickup-list { max-height: 320px; }
  .pickup-item-title { font-size: 1.08rem; }
  .pickup-item-meta { flex-direction: column; align-items: flex-start; }
}

.tariffe-list { display: grid; gap: 12px; }
#tariffe-context { display: none !important; }
.tariffe-sort-wrap { display: inline-flex; align-items: center; gap: 8px; }
.tariffe-sort { padding: 8px 12px; border-radius: 12px; border: 1px solid rgba(15,23,42,.12); background: #f8fbff; font-weight: 600; color: #0f172a; }
.tariff-card { border: 1px solid rgba(15,23,42,.08); border-radius: 14px; padding: 12px; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; background: #fdfefe; box-shadow: 0 8px 20px rgba(15,23,42,.05); }
.tariff-card.disabled { opacity: 0.75; }
.tariff-logo { width: 60px; height: 60px; background: #fff; border-radius: 12px; display: grid; place-items: center; border: 1px solid rgba(15,23,42,.08); overflow: hidden; }
.tariff-logo img { max-width: 48px; max-height: 48px; object-fit: contain; }
.dim-saved { display: flex; align-items: center; gap: 8px; background: #f5f8ff; padding: 6px 10px; border-radius: 10px; border: 1px solid #d5dde8; }
.dim-saved label { font-weight: 600; color: #475569; }
.dim-select { width: 100%; min-width: 0; padding: 10px 12px; border-radius: 10px; border: 1px solid #cbd5e1; background: #fff; font-weight: 600; color: #0f172a; }
.packages-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 8px 0 10px; flex-wrap: wrap; }
.packages-summary { color: #64748b; font-size: 13px; }
.packages-list { display: grid; gap: 12px; }
.package-row { border: 1px solid rgba(15,23,42,.08); border-radius: 14px; padding: 12px; background: #fff; box-shadow: 0 6px 16px rgba(15,23,42,.05); }
.package-row-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.package-row .title-sm { margin: 0; }
.logo-pill { padding: 8px 12px; border-radius: 10px; font-weight: 700; color: #fff; display: inline-block; }
.logo-brt { background: #e11d48; }
.logo-poste { background: #facc15; color: #1f2937; }
.logo-inpost { background: #fbbf24; color: #1f2937; }
.logo-amazon { background: #111827; }
.tariff-info { display: grid; gap: 4px; }
.tariff-info .title-sm { margin: 0; }
.tariff-info .muted { font-size: .9rem; }
.tariff-price { text-align: right; }
.tariff-price strong { font-size: 1.4rem; color: #0f172a; }
.tariff-price .muted { font-size: .85rem; }
.tariff-actions { display: flex; gap: 8px; align-items: center; }

.summary-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: start; }
.summary-box { border: 1px solid rgba(15,23,42,.1); border-radius: 14px; padding: 14px; background: #f8fbff; box-shadow: inset 0 1px 0 rgba(255,255,255,.5); }
.summary-line, .summary-total { display: flex; justify-content: space-between; padding: 6px 0; }
.summary-total { font-size: 1.1rem; font-weight: 700; border-top: 1px solid rgba(15,23,42,.08); margin-top: 6px; padding-top: 10px; }
.summary-block { display: grid; gap: 6px; }
.pickup-box { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: #eef5ff; border: 1px solid #c7dbff; }
.pickup-title { font-weight: 700; color: #0f172a; margin-bottom: 4px; }
.pickup-text { color: #0f172a; font-size: 14px; }

.modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 1000; }
.modal.open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.35); }
.modal-card { position: relative; background: #fff; width: min(420px, 90vw); margin: 0 auto; padding: 16px; border-radius: 14px; box-shadow: 0 18px 38px rgba(15,23,42,.25); z-index: 1001; }
.modal-card.wallet-topup-modal-card { width: min(560px, 92vw); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.pricing-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.pricing-tabs .btn.is-active { background: #0f172a; color: #fff; border-color: #0f172a; }
.pricing-tab-panel { display: block; }
.pricing-tab-panel.hidden { display: none; }
.csv-card { width: min(960px, 96vw); }
.csv-uploader { display: flex; align-items: center; gap: 12px; margin: 12px 0; flex-wrap: wrap; }
.csv-status { margin-top: 8px; }
.csv-summary { font-weight: 700; margin: 6px 0 10px; }
.csv-table table { min-width: 860px; }
.csv-pill { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.csv-ok { background: #dcfce7; color: #065f46; border: 1px solid rgba(16,185,129,.4); }
.csv-error { background: #fee2e2; color: #991b1b; border: 1px solid rgba(239,68,68,.4); }
.csv-pending { background: #e2e8f0; color: #475569; border: 1px solid rgba(148,163,184,.4); }
.csv-running { background: #fef3c7; color: #92400e; border: 1px solid rgba(217,119,6,.35); }
.import-section .card-header { align-items: flex-start; }
.import-grid { display: grid; gap: 12px; }
.import-alert { padding: 10px 12px; border-radius: 12px; font-size: .92rem; border: 1px solid rgba(15,23,42,.08); background: #f8fbff; }
.import-alert.warning { background: #fff7ed; border-color: rgba(249,115,22,.25); color: #9a3412; }
.csv-dropzone { position: relative; border: 2px dashed rgba(148,163,184,.6); border-radius: 16px; background: #f8fbff; padding: 18px; text-align: center; transition: border-color .2s ease, box-shadow .2s ease; }
.csv-dropzone.dragover { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
.csv-dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.csv-dropzone-inner { display: grid; gap: 8px; justify-items: center; }
.csv-dropzone-title { font-weight: 700; color: #0f172a; }
.csv-edit-row td { padding: 0; }
.csv-edit-panel { background: #f8fbff; border-top: 1px solid rgba(15,23,42,.08); padding: 12px; }
.csv-edit-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.csv-edit-grid .field { margin: 0; }
.csv-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 10px; }
.toast { position: fixed; right: 16px; top: 16px; background: #0ea5e9; color: #fff; padding: 12px 14px; border-radius: 10px; box-shadow: 0 18px 38px rgba(15,23,42,.25); z-index: 1100; opacity: 0; transform: translateY(-10px); transition: opacity .25s ease, transform .25s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.fade-slide { transition: all .3s ease; }
.rubrica-card { width: min(960px, 96vw); max-height: 90vh; display: flex; flex-direction: column; gap: 12px; }
.rubrica-header { gap: 12px; }
.rubrica-toggles { display: flex; gap: 8px; }
.rubrica-toggles .pill { padding: 8px 12px; border-radius: 20px; border: 1px solid rgba(15,23,42,.2); background: #f8fbff; cursor: pointer; }
.rubrica-toggles .pill.active { background: #2563eb; color: #fff; border-color: #2563eb; }
.rubrica-toolbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.rubrica-toolbar .search-box { flex: 1; }
.rubrica-toolbar input { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(15,23,42,.12); background: #f8fafc; }
.rubrica-table-wrap { overflow: auto; max-height: 65vh; border: 1px solid rgba(15,23,42,.08); border-radius: 12px; }
.rubrica-table { width: 100%; border-collapse: collapse; }
.rubrica-table th, .rubrica-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid rgba(15,23,42,.05); font-size: 14px; }
.rubrica-table th { background: #f8fbff; position: sticky; top: 0; z-index: 1; }
.rubrica-table tbody tr:hover { background: #f1f5f9; }
.rubrica-table .apply-cell { text-align: right; }
.rubrica-table .muted { font-size: 12px; color: #64748b; }
.rubrica-add { border-top: 1px solid rgba(15,23,42,.08); padding-top: 10px; margin-top: 10px; }
.hidden { display: none !important; }
.stepper-bar { display: flex; gap: 10px; justify-content: space-between; align-items: center; }
.stepper-bar .step { flex: 1; text-align: center; }

.section-block { background: #f8fbff; border: 1px solid rgba(15,23,42,.08); border-radius: 16px; padding: 14px 14px 6px; margin-bottom: 14px; }
.section-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.orange { background: #f97316; }
.dot.red { background: #ef4444; }
.dot.blue { background: #2563eb; }
.dot.green { background: #22c55e; }
.pill-select { padding: 8px 10px; border-radius: 12px; border: 1px solid rgba(15,23,42,.1); background: #fff; font-weight: 600; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit,minmax(240px,1fr)); gap: 12px; }
.four-col { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 12px; }

.tariffe-list { display: grid; gap: 12px; }
.tariff-card { border: 1px solid rgba(15,23,42,.08); border-radius: 14px; padding: 12px; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; background: #fdfefe; box-shadow: 0 8px 20px rgba(15,23,42,.05); }
.tariff-logo { width: 60px; height: 60px; background: #fff; border-radius: 12px; display: grid; place-items: center; border: 1px solid rgba(15,23,42,.08); }
.tariff-info { display: grid; gap: 4px; }
.tariff-info .title-sm { margin: 0; }
.tariff-info .muted { font-size: .9rem; }
.tariff-price { text-align: right; }
.tariff-price strong { font-size: 1.4rem; color: #0f172a; }
.tariff-price .muted { font-size: .85rem; }
.tariff-actions { display: flex; gap: 8px; align-items: center; }

.summary-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: start; }
.summary-box { border: 1px solid rgba(15,23,42,.1); border-radius: 14px; padding: 14px; background: #f8fbff; box-shadow: inset 0 1px 0 rgba(255,255,255,.5); }
.summary-line, .summary-total { display: flex; justify-content: space-between; padding: 6px 0; }
.summary-total { font-size: 1.1rem; font-weight: 700; border-top: 1px solid rgba(15,23,42,.08); margin-top: 6px; padding-top: 10px; }
.summary-block { display: grid; gap: 6px; }

.dashboard-top-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) {
  .dashboard-top-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
  .app-shell { grid-template-columns: 1fr; padding: 12px; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    transform: translateX(-320px);
    transition: transform .25s ease;
    z-index: 20;
    border-radius: 0;
    padding-top: 36px;
    box-shadow: 0 30px 70px rgba(15,23,42,.25);
  }
  nav { display: flex; flex-direction: column; gap: 6px; max-height: calc(100vh - 180px); overflow-y: auto; }
  .sidebar-toggle { display: inline-flex; }
  .topbar { flex-direction: column; align-items: flex-start; gap: 8px; }
  .main { padding-top: 8px; }
  .card { padding: 18px; }
  body.sidebar-open .sidebar {
    transform: translateX(0);
  }
  body.sidebar-open {
    overflow: hidden;
  }
  body.sidebar-open .sidebar-backdrop {
    display: block;
  }
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  .login-card { width: 100%; margin: 0 12px; }
  .actions-row { flex-direction: column; align-items: stretch; }
  .actions { flex-direction: column; align-items: flex-start; gap: 8px; }
  .brand img { width: 72px; }
.table-wrap table { min-width: 100%; }
.pickup-overlay { align-items: flex-start; }
.pickup-card { width: 100%; max-height: 80vh; }
.pickup-card .pickup-results { grid-template-columns: 1fr; max-height: 60vh; }
  .stepper-bar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .stepper-bar .step {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.85rem;
    line-height: 1.2;
    padding: 10px 8px;
  }
}

@media (max-width: 900px) {
  .topbar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "toggle title actions";
    align-items: center;
    gap: 12px;
  }
  .topbar .sidebar-toggle { grid-area: toggle; }
  .topbar > div:first-child { grid-area: title; }
  .topbar .actions {
    grid-area: actions;
    width: auto;
    justify-content: flex-end;
  }
  .topbar .actions .plan-badge,
  .topbar .actions #tracking-launch,
  .topbar .actions .btn.outline {
    display: none !important;
  }
}

@media (max-width: 900px) {
  .table-wrap.table-stack { overflow: visible; border: 0; }
  .storico-table { border-collapse: separate; border-spacing: 0 12px; }
  .storico-table thead { display: none; }
  .storico-table,
  .storico-table tbody,
  .storico-table tr,
  .storico-table td {
    display: block;
    width: 100%;
  }
  .storico-table tr {
    background: #ffffff;
    border: 1px solid rgba(15,23,42,.08);
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(15,23,42,.06);
    padding: 4px 0;
  }
  .storico-table td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px dashed rgba(15,23,42,.08);
  }
  .storico-table td:last-child { border-bottom: 0; }
  .storico-table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: #64748b;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: .02em;
  }
  .storico-table td.col-select::before { content: ""; }
  .storico-table td.col-select { justify-content: flex-start; }
  .storico-table td.actions-col { align-items: flex-start; }
  .storico-table td.actions-col::before { content: "Azioni"; }
  .storico-table .tracking-ellipsis { max-width: none; white-space: nowrap; }
  .actions-row.wrap { flex-direction: row; align-items: center; }
}

.step-label { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: #2563eb; color: #fff; font-weight: 700; margin-bottom: 6px; }
.section-title.major { font-size: 1.05rem; }
.panel { background: #f6f7fb; border: 1px solid rgba(15,23,42,.12); border-radius: 14px; padding: 14px; }
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.panel .dim-saved { margin-bottom: 8px; }
.panel-title { font-size: 1.1rem; font-weight: 800; }
.panel-title.orange { color: #c2410c; }
.panel-title.red { color: #c2410c; }
.panel-title.rust { color: #b45309; }
.panel-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 10px; }
.soft { background: #f8fbff; }
.small { font-size: .9rem; }
.actions-row.end { justify-content: flex-end; margin-top: 6px; }
.wizard-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 14px; align-items: start; }
.wizard-step { border: 1px solid rgba(15,23,42,.08); border-radius: 14px; padding: 14px; background: #fdfefe; box-shadow: 0 8px 20px rgba(15,23,42,.04); }
.wizard-step .step-label { width: 32px; height: 32px; background: linear-gradient(135deg,#2c6dfb,#23c3ff); color: #fff; font-weight: 800; display: grid; place-items: center; border-radius: 12px; margin-bottom: 8px; }

/* Uniforma select e bottoni nei form admin/clienti */
.field select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(15,23,42,.12);
  background: #f8fafc;
  height: 44px;
  font-size: 15px;
  color: #0f172a;
}
.field select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
}
.form-grid .actions-row {
  grid-column: 1 / -1;
  justify-content: flex-end;
}
.form-grid .actions-row .btn {
  border-radius: 10px;
}

/* Profile: keep "Salva dimensioni" compact even on mobile */
@media (max-width: 640px) {
  #dim-save {
    align-self: flex-end;
    width: auto;
  }
}

.btn.primary.custom-medium {
  max-width: 160px;
}
