/* =====================================================
   GSA MOTO — Portale Interno
   ===================================================== */
@import url('style.css');

body.portal { background: var(--black); }

/* ========== LOGIN ========== */
.login-shell {
  min-height: 100vh; padding: 24px;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(255,45,45,.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(255,45,45,.08) 0%, transparent 50%),
    #050505;
  position: relative; overflow: hidden;
}
.login-shell::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent 0 39px, rgba(255,255,255,.025) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(255,255,255,.025) 39px 40px);
  pointer-events: none;
}
.login-card {
  position: relative; z-index: 2;
  width: 100%; max-width: 460px;
  background: var(--black-3);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius-lg);
  padding: 50px 40px;
  box-shadow: var(--shadow-md);
}
.login-logo { text-align: center; margin-bottom: 36px; }
.login-logo img { display: block; margin: 0 auto; }
.login-title {
  font-family: var(--font-display); font-size: 32px;
  text-align: center; letter-spacing: 1px;
  margin-bottom: 8px; text-transform: uppercase;
}
.login-sub { text-align: center; color: var(--muted); margin-bottom: 30px; font-size: 14px; }
.login-card .field input { padding: 16px; font-size: 15px; }
.login-error {
  background: rgba(255,45,45,.12); border-left: 3px solid var(--red);
  padding: 12px 14px; border-radius: 6px; font-size: 13px;
  margin-bottom: 18px; display: none;
}
.login-error.show { display: block; }
.login-back {
  display: block; text-align: center;
  margin-top: 24px; font-size: 13px; color: var(--muted);
  letter-spacing: 1px; text-transform: uppercase;
}
.login-back:hover { color: var(--red); }
.login-tip {
  text-align: center; margin-top: 14px;
  font-size: 12px; color: rgba(255,255,255,.35);
}

/* ========== APP LAYOUT ========== */
.portal-app { display: none; min-height: 100vh; }
.portal-app.active { display: grid; grid-template-columns: 260px 1fr; }

.sidebar {
  background: #060606;
  border-right: 1px solid rgba(255,255,255,.06);
  padding: 28px 18px;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sb-logo { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 0 8px 24px; border-bottom: 1px solid rgba(255,255,255,.05); margin-bottom: 24px; }
.sb-logo img { height: 60px; width: auto; }
.sb-nav { list-style: none; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.sb-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 10px;
  font-size: 14px; font-weight: 500; color: var(--muted);
  transition: all .2s ease;
  position: relative;
}
.sb-nav a i { font-size: 16px; width: 20px; text-align: center; }
.sb-nav a:hover { background: rgba(255,255,255,.04); color: var(--text); }
.sb-nav a.active {
  background: rgba(255,45,45,.12); color: var(--red);
}
.sb-nav a.active::before {
  content: ''; position: absolute; left: 0; top: 8px; bottom: 8px;
  width: 3px; background: var(--red); border-radius: 0 3px 3px 0;
}
.sb-foot {
  border-top: 1px solid rgba(255,255,255,.05);
  padding-top: 18px; font-size: 12px; color: var(--muted);
}
.sb-foot button {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 10px;
  width: 100%; font-size: 13px; color: var(--muted);
  transition: all .2s ease;
}
.sb-foot button:hover { background: rgba(255,45,45,.1); color: var(--red); }

.workspace {
  padding: 32px;
  background: linear-gradient(180deg, #0a0a0a 0%, #060606 100%);
  min-height: 100vh; max-width: 100%;
  overflow-x: auto;
}
.ws-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 28px; flex-wrap: wrap; gap: 16px;
}
.ws-head h1 {
  font-family: var(--font-display); font-size: 38px;
  letter-spacing: 1px; text-transform: uppercase;
}
.ws-head h1 .accent { color: var(--red); }
.ws-head p { color: var(--muted); margin-top: 4px; font-size: 14px; }

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn .35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ========== KPI CARDS ========== */
.kpi-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 30px;
}
.kpi {
  background: var(--black-3); border: 1px solid rgba(255,255,255,.05);
  border-radius: var(--radius); padding: 22px;
  position: relative; overflow: hidden;
}
.kpi::before {
  content: ''; position: absolute; top: 0; right: 0;
  width: 80px; height: 80px;
  background: var(--grad-red); opacity: .08; border-radius: 50%;
  transform: translate(30%, -30%);
}
.kpi .kpi-ico {
  width: 42px; height: 42px; border-radius: 12px;
  background: rgba(255,45,45,.14); color: var(--red);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; margin-bottom: 14px;
}
.kpi .kpi-val { font-family: var(--font-display); font-size: 36px; line-height: 1; margin-bottom: 4px; }
.kpi .kpi-lbl { font-size: 12px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }

/* ========== TABLES ========== */
.panel-card {
  background: var(--black-3); border: 1px solid rgba(255,255,255,.05);
  border-radius: var(--radius); overflow: hidden;
  margin-bottom: 24px;
}
.panel-head {
  padding: 20px 24px;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid rgba(255,255,255,.05);
  flex-wrap: wrap; gap: 12px;
}
.panel-head h3 { font-family: var(--font-display); font-size: 22px; letter-spacing: 1px; }
.panel-head .filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.panel-head input.search {
  padding: 9px 14px; background: var(--black-2);
  border: 1px solid rgba(255,255,255,.08); border-radius: 8px;
  color: var(--text); font-size: 13px; min-width: 200px;
}
.panel-head input.search:focus { outline: none; border-color: var(--red); }

.btn-sm {
  padding: 9px 18px; font-size: 12px; letter-spacing: 1px;
}
.btn-icon {
  width: 34px; height: 34px; padding: 0; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.05); transition: all .2s ease;
}
.btn-icon:hover { background: var(--red); color: #fff; }
.btn-icon.danger:hover { background: #c01616; }

.data-table {
  width: 100%; border-collapse: collapse;
}
.data-table th, .data-table td {
  padding: 14px 24px; text-align: left;
  font-size: 13px;
}
.data-table th {
  background: rgba(255,255,255,.02);
  font-weight: 600; text-transform: uppercase;
  letter-spacing: 1px; color: var(--muted); font-size: 11px;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.data-table td { border-bottom: 1px solid rgba(255,255,255,.03); }
.data-table tbody tr { transition: background .15s ease; }
.data-table tbody tr:hover { background: rgba(255,45,45,.04); }
.data-table tbody tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block; padding: 4px 10px; border-radius: 50px;
  font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
}
.b-new { background: rgba(46,204,113,.15); color: #2ecc71; }
.b-used { background: rgba(149,165,166,.18); color: #bdc3c7; }
.b-pending { background: rgba(255,184,0,.15); color: var(--gold); }
.b-confirmed { background: rgba(46,204,113,.15); color: #2ecc71; }
.b-rejected { background: rgba(255,45,45,.18); color: var(--red); }
.b-progress { background: rgba(52,152,219,.18); color: #5dade2; }
.b-done { background: rgba(46,204,113,.15); color: #2ecc71; }
.b-wait { background: rgba(255,184,0,.15); color: var(--gold); }

.row-actions { display: flex; gap: 6px; }

.empty {
  padding: 60px 20px; text-align: center; color: var(--muted);
}
.empty i { font-size: 48px; margin-bottom: 14px; color: rgba(255,45,45,.4); display: block; }
.empty p { font-size: 14px; }

/* ========== FORM IN MODAL ========== */
.modal.lg { max-width: 760px; }
.modal h3 i { color: var(--red); margin-right: 8px; }
.modal-body { max-height: 70vh; overflow-y: auto; padding-right: 6px; }
.modal-body::-webkit-scrollbar { width: 8px; }
.modal-body::-webkit-scrollbar-thumb { background: var(--gray); border-radius: 4px; }
.modal-actions {
  display: flex; gap: 10px; justify-content: flex-end; align-items: center; flex-wrap: wrap;
  margin: 22px -28px -24px;
  padding: 16px 28px;
  background: linear-gradient(180deg, rgba(10,10,10,.6), rgba(10,10,10,.95));
  border-top: 1px solid rgba(255,255,255,.08);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  position: sticky; bottom: -24px; z-index: 5;
  backdrop-filter: blur(6px);
}
.modal-actions .btn { min-width: 110px; justify-content: center; }
.modal-actions .sp { flex: 1; }

/* ========== TIMELINE MANUTENZIONI ========== */
.timeline {
  position: relative; padding-left: 30px;
}
.timeline::before {
  content: ''; position: absolute; left: 8px; top: 6px; bottom: 6px;
  width: 2px; background: rgba(255,45,45,.3);
}
.timeline-item {
  position: relative; padding-bottom: 22px;
}
.timeline-item::before {
  content: ''; position: absolute; left: -27px; top: 6px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--red); border: 3px solid var(--black-3);
  box-shadow: 0 0 0 2px var(--red);
}
.timeline-item .t-date { font-size: 11px; color: var(--red); letter-spacing: 1px; text-transform: uppercase; font-weight: 700; }
.timeline-item .t-title { font-weight: 600; margin: 4px 0; font-size: 14px; }
.timeline-item .t-desc { font-size: 13px; color: var(--muted); }

/* ========== FORM PREMIUM — modale catalogo ========== */
.modal.xl { max-width: 960px; }
.modal.xl .modal-body { max-height: 75vh; }

/* Body scrolling area for all modal forms */
#formModalBody {
  max-height: 88vh; overflow-y: auto;
  padding: 28px 32px 24px;
  scroll-behavior: smooth;
}
#formModalBody::-webkit-scrollbar { width: 10px; }
#formModalBody::-webkit-scrollbar-thumb { background: var(--gray); border-radius: 6px; }
#formModalBody::-webkit-scrollbar-thumb:hover { background: var(--red); }
#formModalBody::-webkit-scrollbar-track { background: transparent; }
#formModalBody form { padding: 0; margin: 0; }
@media (max-width: 720px) {
  #formModalBody {
    padding: 20px 18px 16px;
    max-height: calc(100dvh - 92px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .modal-actions { margin: 20px -18px -16px; padding: 14px 18px; }
}

/* Header modale con gradient + icona grande */
.fm-header {
  margin: 0 0 20px;
  padding: 20px 22px;
  background: linear-gradient(135deg, rgba(255,45,45,.12), rgba(255,45,45,.02));
  border-radius: 14px;
  border: 1px solid rgba(255,45,45,.2);
  display: flex; align-items: center; gap: 16px;
}
.fm-header .fm-ico {
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--grad-red); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
  box-shadow: var(--shadow-red);
}
.fm-header h3 { font-family: var(--font-display); font-size: 26px; letter-spacing: 1.5px; margin: 0 0 2px; }
.fm-header .sub { color: var(--muted); font-size: 12px; margin: 0; }

/* Tabs interne al form */
.fm-tabs {
  display: flex; gap: 2px; padding: 4px;
  background: var(--black-2); border-radius: 10px;
  margin-bottom: 18px;
  overflow-x: auto; scrollbar-width: none;
}
.fm-tabs::-webkit-scrollbar { display: none; }
.fm-tab {
  flex: 1; min-width: max-content;
  padding: 10px 16px; font-size: 12px; font-weight: 600;
  color: var(--muted); background: transparent; border: none;
  border-radius: 8px; cursor: pointer; letter-spacing: .3px;
  white-space: nowrap; transition: all .2s;
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
}
.fm-tab i { font-size: 11px; }
.fm-tab:hover { color: var(--text); }
.fm-tab.active {
  background: var(--grad-red); color: #fff;
  box-shadow: 0 4px 12px rgba(255,45,45,.3);
}
.fm-tab .dot-req {
  display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; background: var(--gold);
  margin-left: 2px;
}

.fm-pane { display: none; animation: fadeIn .25s ease; }
.fm-pane.active { display: block; }

/* Card di sezione dentro ai pane */
.fm-section {
  background: var(--black-2);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 12px; padding: 18px;
  margin-bottom: 14px;
}
.fm-section-head {
  display: flex; align-items: center; gap: 10px;
  margin: -4px 0 14px; padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.fm-section-head i { color: var(--red); font-size: 14px; }
.fm-section-head h4 {
  font-family: var(--font-display); font-size: 16px;
  letter-spacing: 1.5px; text-transform: uppercase;
  margin: 0; color: var(--text);
}
.fm-section-head .fm-section-sub {
  font-size: 11px; color: var(--muted); margin-left: auto;
}

/* Field upgrades */
.field label {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; letter-spacing: 1px;
  text-transform: uppercase; color: var(--muted);
  margin-bottom: 6px;
}
.field label .req { color: var(--red); font-size: 10px; }
.field label .hint {
  margin-left: auto; color: rgba(255,255,255,.3);
  text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 10px;
}
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 14px;
  background: var(--black-3);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  color: var(--text); font-size: 13px;
  font-family: inherit; transition: all .2s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--red);
  background: var(--black-2);
  box-shadow: 0 0 0 3px rgba(255,45,45,.12);
}
.field textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
.field input::placeholder, .field textarea::placeholder { color: rgba(255,255,255,.25); }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 12px; }
.field-row.three { grid-template-columns: repeat(3, 1fr); }
.field-row.four  { grid-template-columns: repeat(4, 1fr); }
.field-row .field { margin-bottom: 0; }
.field-row .field.span-2 { grid-column: span 2; }
.field-row .field.span-full { grid-column: 1 / -1; }
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field.full { grid-column: 1 / -1; }

@media (max-width: 720px) {
  .field-row, .field-row.three, .field-row.four { grid-template-columns: 1fr; }
  .field-row .field.span-2 { grid-column: auto; }
}

/* Callout informativo nei form */
.fm-callout {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px; border-radius: 10px;
  background: rgba(255,45,45,.06);
  border-left: 3px solid var(--red);
  font-size: 12px; color: var(--text); line-height: 1.55;
  margin-bottom: 14px;
}
.fm-callout.info { background: rgba(0,140,220,.08); border-left-color: #2fa7e0; }
.fm-callout.warn { background: rgba(255,183,0,.08); border-left-color: var(--gold); }
.fm-callout i { font-size: 14px; margin-top: 2px; flex-shrink: 0; color: var(--red); }
.fm-callout.info i { color: #2fa7e0; }
.fm-callout.warn i { color: var(--gold); }
.fm-callout strong { color: var(--text); display: block; margin-bottom: 2px; }

/* Check-grid (problemi riscontrati, dotazioni…) */
.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
}
.check-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  background: var(--black-3);
  border: 1px solid rgba(255,255,255,.06);
  cursor: pointer; font-size: 12px;
  transition: all .15s;
  user-select: none;
}
.check-item:hover { border-color: rgba(255,45,45,.35); }
.check-item input[type=checkbox] { accent-color: var(--red); width: 14px; height: 14px; flex-shrink: 0; }
.check-item i { color: var(--red); font-size: 12px; opacity: .7; }
.check-item:has(input:checked) {
  border-color: var(--red);
  background: rgba(255,45,45,.08);
  color: var(--text);
}
.check-item:has(input:checked) i { opacity: 1; }

/* Priority radio group */
.prio-group {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.prio-item {
  display: flex; align-items: center; gap: 8px; justify-content: center;
  padding: 12px; border-radius: 10px;
  background: var(--black-3);
  border: 1px solid rgba(255,255,255,.08);
  cursor: pointer;
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  transition: all .15s;
  color: var(--muted);
}
.prio-item input { display: none; }
.prio-item i { font-size: 14px; }
.prio-item:hover { color: var(--text); }
.prio-item.urgent:has(input:checked) { color: #ff5252; border-color: #ff5252; background: rgba(255,80,80,.1); box-shadow: 0 0 0 3px rgba(255,80,80,.08); }
.prio-item.normal:has(input:checked) { color: var(--gold); border-color: var(--gold); background: rgba(255,183,0,.1); box-shadow: 0 0 0 3px rgba(255,183,0,.08); }
.prio-item.low:has(input:checked)    { color: #2ecc71; border-color: #2ecc71; background: rgba(46,204,113,.1); box-shadow: 0 0 0 3px rgba(46,204,113,.08); }

/* Stat strip compatta per viste */
.stat-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px; margin-bottom: 20px;
}
.stat-strip .stat {
  background: var(--black-2); padding: 14px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,.05);
}
.stat-strip .stat-lbl {
  font-size: 11px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase;
  display: flex; align-items: center; gap: 6px;
}
.stat-strip .stat-lbl i { color: var(--red); font-size: 10px; }
.stat-strip .stat-val { font-size: 15px; font-weight: 700; margin-top: 6px; color: var(--text); }
.stat-strip .stat-val.red { color: var(--red); }

/* Color tags editor */
.color-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 10px; min-height: 52px;
  background: var(--black-3);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
}
.color-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px 6px 14px; border-radius: 50px;
  background: rgba(255,45,45,.12);
  border: 1px solid rgba(255,45,45,.3);
  font-size: 12px; color: var(--text);
}
.color-tag button {
  width: 18px; height: 18px; border-radius: 50%;
  background: rgba(255,255,255,.1); color: var(--text);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; padding: 0; transition: all .15s;
}
.color-tag button:hover { background: var(--red); color: #fff; }
.color-tag-input {
  flex: 1; min-width: 140px;
  background: transparent; border: none; color: var(--text);
  padding: 4px 8px; font-size: 13px; outline: none;
}

/* Chips di preview in footer form */
.fm-preview-strip {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 12px 14px; margin-top: 14px;
  background: rgba(255,45,45,.06);
  border: 1px dashed rgba(255,45,45,.25);
  border-radius: 10px;
}
.fm-preview-strip .lbl {
  font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--muted); width: 100%; margin-bottom: 4px;
}
.fm-preview-strip .chip {
  padding: 4px 10px; border-radius: 50px;
  background: var(--black-3); font-size: 11px; font-weight: 600;
  border: 1px solid rgba(255,255,255,.08);
}
.fm-preview-strip .chip i { color: var(--red); margin-right: 4px; font-size: 10px; }

/* ========== PHOTO UPLOADER ========== */
.photo-uploader {
  display: grid; grid-template-columns: 200px 1fr; gap: 14px;
  align-items: stretch;
}
.photo-drop {
  position: relative; aspect-ratio: 1;
  background:
    radial-gradient(ellipse at center, rgba(255,45,45,.12), transparent 70%),
    var(--black-3);
  border: 2px dashed rgba(255,45,45,.3);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 6px;
  cursor: pointer; overflow: hidden;
  transition: all .25s;
}
.photo-drop:hover { border-color: var(--red); background: rgba(255,45,45,.06); }
.photo-drop.has-photo { border-style: solid; padding: 0; }
.photo-drop i { font-size: 34px; color: var(--red); opacity: .6; }
.photo-drop .phd-text { font-size: 11px; color: var(--muted); text-align: center; letter-spacing: 1px; text-transform: uppercase; padding: 0 10px; }
.photo-drop img { width: 100%; height: 100%; object-fit: cover; }
.photo-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-actions {
  display: flex; flex-direction: column; gap: 8px;
  justify-content: center;
}
.photo-actions .btn { justify-content: center; font-size: 12px; }
.photo-hint {
  font-size: 11px; color: var(--muted); line-height: 1.5;
  padding: 8px 10px; background: var(--black-3); border-radius: 6px;
  border-left: 2px solid var(--red);
}

/* Bike thumbnail nella tabella admin */
.bike-thumb {
  width: 54px; height: 40px; border-radius: 6px;
  background: var(--black-2);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
  border: 1px solid rgba(255,255,255,.06);
}
.bike-thumb img { width: 100%; height: 100%; object-fit: cover; }
.bike-thumb i { color: var(--red); font-size: 18px; opacity: .8; }
.bike-cell { display: flex; align-items: center; gap: 10px; }

/* ========== RELATION CARDS (sezioni collegate) ========== */
.rel-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px; margin-top: 10px;
}
.rel-card {
  background: var(--black-2);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px; padding: 14px;
  display: flex; gap: 12px; align-items: center;
  transition: all .2s;
  cursor: pointer;
}
.rel-card:hover { border-color: var(--red); transform: translateY(-2px); }
.rel-card .rel-ico {
  width: 42px; height: 42px; border-radius: 10px;
  background: rgba(255,45,45,.12); color: var(--red);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.rel-card .rel-ico img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.rel-card .rel-body { flex: 1; min-width: 0; }
.rel-card .rel-title { font-weight: 600; font-size: 13px; margin: 0 0 2px; }
.rel-card .rel-meta { font-size: 11px; color: var(--muted); }

.rel-empty {
  padding: 20px; text-align: center;
  color: var(--muted); font-size: 12px;
  background: var(--black-2); border-radius: 10px;
  border: 1px dashed rgba(255,255,255,.06);
}
.rel-empty i { display: block; font-size: 24px; margin-bottom: 8px; color: rgba(255,45,45,.4); }

/* Bike picker (chips per selezione mezzi) */
.bike-picker {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px; max-height: 280px; overflow-y: auto;
  padding: 10px; background: var(--black-3);
  border: 1px solid rgba(255,255,255,.08); border-radius: 8px;
}
.bike-pick-item {
  display: flex; gap: 10px; align-items: center;
  padding: 8px 10px; border-radius: 8px;
  background: var(--black-2);
  border: 1px solid transparent;
  cursor: pointer; transition: all .15s;
  position: relative;
}
.bike-pick-item:hover { border-color: rgba(255,45,45,.4); }
.bike-pick-item.sel { border-color: var(--red); background: rgba(255,45,45,.08); }
.bike-pick-item.sel::after {
  content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
  position: absolute; right: 10px; color: var(--red); font-size: 12px;
}
.bike-pick-item input { position: absolute; opacity: 0; pointer-events: none; }
.bike-pick-item .bp-thumb {
  width: 36px; height: 28px; border-radius: 5px;
  background: var(--black-3); overflow: hidden; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.bike-pick-item .bp-thumb img { width: 100%; height: 100%; object-fit: cover; }
.bike-pick-item .bp-thumb i { color: var(--red); font-size: 12px; opacity: .7; }
.bike-pick-item .bp-info { flex: 1; min-width: 0; padding-right: 20px; }
.bike-pick-item .bp-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bike-pick-item .bp-meta { font-size: 10px; color: var(--muted); }

/* Detail modal header overlay */
.detail-hero {
  position: relative; margin: -6px -4px 16px;
  aspect-ratio: 21/9; border-radius: 14px; overflow: hidden;
  background:
    radial-gradient(ellipse at center, rgba(255,45,45,.2), transparent 65%),
    linear-gradient(135deg, #1a1a1a, #0a0a0a);
  display: flex; align-items: center; justify-content: center;
}
.detail-hero img { width: 100%; height: 100%; object-fit: cover; }
.detail-hero > i { font-size: 72px; color: var(--red); filter: drop-shadow(0 6px 20px var(--red-glow)); }
.detail-hero .dh-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,.85));
  padding: 20px 24px;
  display: flex; align-items: flex-end;
}
.detail-hero .dh-title {
  color: #fff; font-family: var(--font-display); font-size: 26px;
  letter-spacing: 1.5px; margin: 0;
}
.detail-hero .dh-title small {
  display: block; font-family: var(--font-body); font-size: 12px;
  letter-spacing: 1px; color: rgba(255,255,255,.7); margin-top: 2px; text-transform: none;
}
.detail-hero .dh-badge {
  position: absolute; top: 14px; right: 14px;
  padding: 6px 14px; border-radius: 50px;
  background: var(--grad-red); color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  box-shadow: var(--shadow-red);
}

/* Detail tabs section */
.detail-sec { margin-top: 20px; }
.detail-sec h4 {
  font-family: var(--font-display); font-size: 18px;
  letter-spacing: 1.5px; text-transform: uppercase;
  margin: 0 0 10px; color: var(--text);
  display: flex; align-items: center; gap: 10px;
}
.detail-sec h4 i { color: var(--red); font-size: 14px; }
.detail-sec h4 .cnt {
  margin-left: auto; font-family: var(--font-body);
  font-size: 11px; font-weight: 600; padding: 2px 10px;
  border-radius: 50px; background: rgba(255,45,45,.12); color: var(--red);
  letter-spacing: 1px;
}

/* ========== USER ROLE BADGE ========== */
.user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 12px; border-radius: 50px;
  background: rgba(255,255,255,.05); font-size: 12px;
}
.user-chip i { color: var(--red); }

/* ========== RESPONSIVE PORTALE ========== */
@media (max-width: 900px) {
  .portal-app.active { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 260px; z-index: 999;
    transform: translateX(-100%); transition: transform .3s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .workspace { padding: 22px; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .mobile-toggle { display: flex !important; }
}
.mobile-toggle {
  display: none; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--black-3); color: var(--text);
  margin-right: 12px;
}
@media (max-width: 600px) {
  .kpi-row { grid-template-columns: 1fr; }
  .data-table { font-size: 12px; }
  .data-table th, .data-table td { padding: 10px 14px; }
  .panel-head { padding: 16px; }
  .ws-head h1 { font-size: 28px; }
}
