

@media (min-width: 901px) {
  #mobileElencoApp,
  .mobile-elenco-sheet-backdrop,
  .mobile-elenco-filter-sheet,
  .mobile-elenco-detail {
    display: none !important;
  }
}

@media (max-width: 900px) {
  body.mobile-elenco-app-ready {
    background: #f4f7fb !important;
  }

  body.mobile-elenco-app-ready .sales-listone-container > .toolbar-card,
  body.mobile-elenco-app-ready .sales-filters-card,
  body.mobile-elenco-app-ready .elenco-lazy-table-card,
  body.mobile-elenco-app-ready .elenco-rules-note,
  body.mobile-elenco-app-ready #listoneTable,
  body.mobile-elenco-app-ready #elencoDrawer,
  body.mobile-elenco-app-ready #elencoDrawerBackdrop {
    display: none !important;
  }

  body.mobile-elenco-detail-open .mobile-bottom-nav {
    display: none !important;
  }

  body.mobile-elenco-detail-open.has-mobile-bottom-nav:not(.login-page) {
    padding-bottom: 0 !important;
  }

  #mobileElencoApp {
    display: grid;
    gap: 12px;
    padding: 0 0 calc(90px + env(safe-area-inset-bottom));
  }

  .mobile-elenco-app-head {
    position: sticky;
    top: var(--mobile-header-h, 62px);
    z-index: 8200;
    margin: 0 -14px;
    padding: 10px 14px 12px;
    background: rgba(244, 247, 251, .96);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(226, 232, 240, .75);
  }

  .mobile-elenco-titlebar {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
  }

  .mobile-elenco-titlebar strong {
    display: block;
    color: #0f172a;
    font-size: 20px;
    line-height: 1.05;
    font-weight: 950;
    letter-spacing: -.04em;
  }

  .mobile-elenco-titlebar span {
    display: block;
    margin-top: 3px;
    color: #64748b;
    font-size: 11.5px;
    font-weight: 800;
  }

  .mobile-elenco-new-btn {
    min-height: 38px;
    padding: 0 12px;
    border-radius: 999px;
    background: #1473ff;
    color: #ffffff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 950;
    white-space: nowrap;
  }

  .mobile-elenco-search-row {
    display: grid;
    grid-template-columns: 1fr 44px;
    gap: 8px;
  }

  .mobile-elenco-search {
    min-width: 0;
    width: 100%;
    height: 44px;
    border: 1px solid #dbe3ef;
    border-radius: 15px;
    background: #ffffff;
    color: #0f172a;
    font-size: 16px;
    font-weight: 750;
    padding: 0 13px;
    box-sizing: border-box;
    outline: none;
  }

  .mobile-elenco-filter-btn {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 15px;
    background: #0f172a;
    color: #ffffff;
    font-size: 18px;
    font-weight: 950;
  }

  .mobile-elenco-chips {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 9px 1px 1px;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-elenco-chip {
    flex: 0 0 auto;
    min-height: 28px;
    padding: 0 9px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #334155;
    font-size: 11px;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    gap: 5px;
  }

  .mobile-elenco-chip button {
    width: 18px;
    height: 18px;
    border: 0;
    border-radius: 999px;
    background: #e2e8f0;
    color: #0f172a;
    font-size: 12px;
    font-weight: 950;
    line-height: 1;
  }

  .mobile-elenco-progress {
    height: 3px;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
    opacity: 0;
    transform: translateY(4px);
  }

  .mobile-elenco-progress.is-active {
    opacity: 1;
  }

  .mobile-elenco-progress span {
    display: block;
    width: 38%;
    height: 100%;
    border-radius: inherit;
    background: #1473ff;
    animation: mobileElencoProgress 1s infinite ease-in-out;
  }

  @keyframes mobileElencoProgress {
    0% { transform: translateX(-110%); }
    100% { transform: translateX(280%); }
  }

  .mobile-elenco-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .mobile-elenco-stat {
    min-width: 0;
    padding: 10px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid #e5eaf2;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .05);
  }

  .mobile-elenco-stat span {
    display: block;
    color: #64748b;
    font-size: 9px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .06em;
  }

  .mobile-elenco-stat strong {
    display: block;
    margin-top: 3px;
    color: #0f172a;
    font-size: 17px;
    line-height: 1;
    font-weight: 950;
  }

  .mobile-elenco-status {
    padding: 11px 12px;
    border-radius: 16px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    font-size: 13px;
    line-height: 1.35;
    font-weight: 850;
  }

  .mobile-elenco-status.is-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
  }

  .mobile-elenco-cards {
    display: grid;
    gap: 10px;
  }

  .mobile-elenco-card {
    border: 1px solid #e5eaf2;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .07);
    overflow: hidden;
  }

  .mobile-elenco-card-main {
    padding: 13px;
  }

  .mobile-elenco-card-top {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 9px;
    align-items: start;
  }

  .mobile-elenco-card h3 {
    margin: 0;
    color: #0f172a;
    font-size: 16px;
    line-height: 1.12;
    letter-spacing: -.03em;
    font-weight: 950;
  }

  .mobile-elenco-card small {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 11.5px;
    line-height: 1.25;
    font-weight: 800;
  }

  .mobile-elenco-row-badge {
    min-width: 42px;
    height: 28px;
    padding: 0 8px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 950;
  }

  .mobile-elenco-badges {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
  }

  .mobile-elenco-badge {
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
    display: inline-flex;
    align-items: center;
    font-size: 10.5px;
    font-weight: 900;
  }

  .mobile-elenco-badge.status {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
  }

  .mobile-elenco-badge.contract {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #15803d;
  }

  .mobile-elenco-badge.external {
    background: #f5f3ff;
    border-color: #ddd6fe;
    color: #6d28d9;
  }

  .mobile-elenco-quick {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    margin-top: 10px;
  }

  .mobile-elenco-quick div {
    min-width: 0;
    padding: 8px;
    border-radius: 13px;
    background: #f8fafc;
    border: 1px solid #eef2f7;
  }

  .mobile-elenco-quick span {
    display: block;
    color: #64748b;
    font-size: 9px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .05em;
  }

  .mobile-elenco-quick strong {
    display: block;
    margin-top: 2px;
    color: #0f172a;
    font-size: 12px;
    line-height: 1.2;
    font-weight: 900;
    word-break: break-word;
  }

  .mobile-elenco-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: #e5eaf2;
    border-top: 1px solid #e5eaf2;
  }

  .mobile-elenco-card-actions button,
  .mobile-elenco-card-actions a {
    min-height: 43px;
    border: 0;
    border-radius: 0;
    background: #ffffff;
    color: #1473ff;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12.5px;
    font-weight: 950;
  }

  .mobile-elenco-card-actions .primary {
    background: #1473ff;
    color: #ffffff;
  }

  .mobile-elenco-load-more {
    min-height: 46px;
    border: 0;
    border-radius: 16px;
    background: #0f172a;
    color: #ffffff;
    font-size: 13px;
    font-weight: 950;
  }

  .mobile-elenco-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 11800;
    background: rgba(15, 23, 42, .35);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
  }

  body.mobile-elenco-sheet-open .mobile-elenco-sheet-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-elenco-filter-sheet {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 11900;
    max-height: min(76dvh, 560px);
    border-radius: 24px;
    background: #ffffff;
    border: 1px solid #e5eaf2;
    box-shadow: 0 28px 70px rgba(15, 23, 42, .3);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(18px) scale(.98);
    transition: opacity .18s ease, transform .18s ease;
  }

  body.mobile-elenco-sheet-open .mobile-elenco-filter-sheet {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }

  .mobile-elenco-sheet-head,
  .mobile-elenco-sheet-foot {
    padding: 12px;
    background: #ffffff;
  }

  .mobile-elenco-sheet-head {
    border-bottom: 1px solid #eef2f7;
    display: grid;
    grid-template-columns: 1fr 42px;
    gap: 10px;
    align-items: center;
  }

  .mobile-elenco-sheet-head strong {
    color: #0f172a;
    font-size: 17px;
    font-weight: 950;
  }

  .mobile-elenco-sheet-head button {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 14px;
    background: #f1f5f9;
    color: #0f172a;
    font-size: 22px;
    font-weight: 950;
  }

  .mobile-elenco-filter-grid {
    min-height: 0;
    overflow-y: auto;
    padding: 12px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .mobile-elenco-filter-grid label {
    display: grid;
    gap: 5px;
    color: #64748b;
    font-size: 10px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .06em;
  }

  .mobile-elenco-filter-grid select {
    width: 100%;
    min-height: 42px;
    border-radius: 13px;
    border: 1px solid #dbe3ef;
    background: #ffffff;
    color: #0f172a;
    font-size: 16px;
    padding: 0 10px;
  }

  .mobile-elenco-sheet-foot {
    border-top: 1px solid #eef2f7;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .mobile-elenco-sheet-foot button {
    min-height: 44px;
    border: 0;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 950;
  }

  .mobile-elenco-sheet-foot .secondary {
    background: #f1f5f9;
    color: #0f172a;
  }

  .mobile-elenco-sheet-foot .primary {
    background: #1473ff;
    color: #ffffff;
  }

  .mobile-elenco-detail {
    position: fixed;
    inset: 0;
    height: var(--mobile-elenco-vvh, 100dvh);
    z-index: 12500;
    background: #f4f7fb;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    transform: translateY(105%);
    transition: transform .22s ease;
  }

  body.mobile-elenco-detail-open .mobile-elenco-detail {
    transform: translateY(0);
  }

  .mobile-elenco-detail-head {
    background: #ffffff;
    border-bottom: 1px solid #e5eaf2;
    padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
    display: grid;
    grid-template-columns: 42px 1fr auto;
    gap: 9px;
    align-items: center;
  }

  .mobile-elenco-detail-head button {
    min-height: 42px;
    border: 0;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 950;
  }

  .mobile-elenco-detail-back {
    width: 42px;
    background: #f1f5f9;
    color: #0f172a;
    font-size: 22px !important;
  }

  .mobile-elenco-detail-save {
    padding: 0 14px;
    background: #1473ff;
    color: #ffffff;
  }

  .mobile-elenco-detail-title {
    min-width: 0;
  }

  .mobile-elenco-detail-title strong {
    display: block;
    color: #0f172a;
    font-size: 15px;
    line-height: 1.1;
    font-weight: 950;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-elenco-detail-title span {
    display: block;
    margin-top: 2px;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
  }

  .mobile-elenco-detail-body {
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 12px calc(36px + env(safe-area-inset-bottom));
    scroll-padding-bottom: 160px;
  }

  .mobile-elenco-detail-card,
  .mobile-elenco-detail-form,
  .mobile-elenco-external-box {
    border: 1px solid #e5eaf2;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
    padding: 13px;
    margin-bottom: 12px;
  }

  .mobile-elenco-detail-card h3 {
    margin: 0;
    color: #0f172a;
    font-size: 19px;
    line-height: 1.1;
    letter-spacing: -.03em;
    font-weight: 950;
  }

  .mobile-elenco-detail-card p {
    margin: 6px 0 0;
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
  }

  .mobile-elenco-detail-form {
    display: grid;
    gap: 10px;
  }

  .mobile-elenco-field {
    display: grid;
    gap: 5px;
  }

  .mobile-elenco-field label {
    color: #64748b;
    font-size: 10px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .06em;
  }

  .mobile-elenco-field input,
  .mobile-elenco-field textarea,
  .mobile-elenco-field select {
    width: 100%;
    min-height: 43px;
    border: 1px solid #dbe3ef;
    border-radius: 13px;
    background: #ffffff;
    color: #0f172a;
    font-size: 16px;
    font-weight: 750;
    padding: 9px 10px;
    box-sizing: border-box;
  }

  .mobile-elenco-field textarea {
    min-height: 98px;
    resize: vertical;
  }

  .mobile-elenco-external-box h4 {
    margin: 0 0 9px;
    color: #5b21b6;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 950;
  }

  .mobile-elenco-external-grid {
    display: grid;
    gap: 8px;
  }

  .mobile-elenco-external-grid div {
    padding: 9px;
    border-radius: 13px;
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
  }

  .mobile-elenco-external-grid span {
    display: block;
    color: #7c3aed;
    font-size: 9.5px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .05em;
  }

  .mobile-elenco-external-grid strong {
    display: block;
    margin-top: 2px;
    color: #2e1065;
    font-size: 12.5px;
    line-height: 1.25;
    font-weight: 900;
    word-break: break-word;
  }
}

@media (max-width: 900px) and (min-width: 620px) {
  .mobile-elenco-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .mobile-elenco-card-actions {
    grid-template-columns: 1fr;
  }

  .mobile-elenco-filter-grid {
    grid-template-columns: 1fr 1fr;
  }

  .mobile-elenco-external-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 900px) and (orientation: landscape) {
  #mobileElencoApp {
    padding-bottom: 18px;
  }

  .mobile-elenco-app-head {
    top: 0;
    margin-top: -4px;
  }

  .mobile-elenco-titlebar {
    grid-template-columns: 1fr auto;
  }

  .mobile-elenco-titlebar span {
    display: none;
  }

  .mobile-elenco-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-elenco-summary {
    grid-template-columns: repeat(3, minmax(0, 150px));
  }

  .mobile-elenco-filter-sheet {
    left: 86px;
    right: 10px;
    width: min(430px, calc(100vw - 102px));
  }
}

@media (max-width: 420px) {
  .mobile-elenco-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mobile-elenco-stat {
    padding: 8px;
  }

  .mobile-elenco-stat strong {
    font-size: 15px;
  }

  .mobile-elenco-quick {
    grid-template-columns: 1fr;
  }
}


