/* ITEM 48 - Superadmin mobile-first. Desktop permanece inalterado. */
.mobile-super-nav,
.mobile-super-sheet-backdrop {
  display: none;
}

@media (max-width: 760px) {
  body:has(#super:not(.hide)) {
    --mobile-nav-height: 72px;
    --mobile-touch: 44px;
  }

  body:has(#super:not(.hide)) .crm-shell {
    min-height: 100dvh;
    padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px));
  }

  body:has(#super:not(.hide)) .sidebar {
    position: sticky;
    top: 0;
    z-index: 120;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: calc(60px + env(safe-area-inset-top, 0px));
    padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px;
    overflow: visible;
    border-bottom: 1px solid rgba(216, 241, 111, .13);
    background: linear-gradient(145deg, #0a4b38, #05271e);
    box-shadow: 0 8px 24px rgba(3, 31, 23, .18);
  }

  body:has(#super:not(.hide)) .sidebar::after,
  body:has(#super:not(.hide)) .sidebar-status {
    display: none;
  }

  body:has(#super:not(.hide)) .sidebar-brand {
    display: flex;
    flex: 0 0 auto;
    padding: 0;
  }

  body:has(#super:not(.hide)) .sidebar-brand > div {
    display: none;
  }

  body:has(#super:not(.hide)) .sidebar-brand .brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 13px;
    box-shadow: 0 8px 22px rgba(216, 241, 111, .15);
  }

  body:has(#super:not(.hide)) .sidebar-nav {
    display: flex;
    flex: 1 1 auto;
    justify-content: flex-end;
    min-width: 0;
    overflow: visible;
  }

  body:has(#super:not(.hide)) #dashboardNavBtn,
  body:has(#super:not(.hide)) #inboxNavBtn,
  body:has(#super:not(.hide)) #backSuperBtn {
    display: none !important;
  }

  body:has(#super:not(.hide)) .sidebar-settings {
    position: relative;
  }

  body:has(#super:not(.hide)) #settingsNavBtn {
    justify-content: center;
    width: var(--mobile-touch);
    height: var(--mobile-touch);
    min-height: var(--mobile-touch);
    padding: 0;
    border-color: rgba(255, 255, 255, .1);
    background: rgba(255, 255, 255, .065);
    box-shadow: none;
  }

  body:has(#super:not(.hide)) #settingsNavBtn strong {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  body:has(#super:not(.hide)) #settingsNavBtn span {
    display: none;
  }

  body:has(#super:not(.hide)) #settingsNavBtn::before {
    content: "⚙";
    color: #dff79a;
    font-size: 18px;
    line-height: 1;
  }

  body:has(#super:not(.hide)) .sidebar-tools-host {
    position: fixed;
    z-index: 240;
    top: calc(58px + env(safe-area-inset-top, 0px));
    right: 10px;
    left: 10px;
    width: auto;
    max-height: min(68dvh, 520px);
    margin: 0;
    padding: 10px;
    overflow: auto;
    border: 1px solid rgba(216, 241, 111, .14);
    border-radius: 16px;
    background: #073126;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
  }

  body:has(#super:not(.hide)) .sidebar-tool {
    min-height: var(--mobile-touch);
    padding: 11px 12px;
    border-radius: 10px;
    font-size: 13px;
  }

  body:has(#super:not(.hide)) .sidebar-foot {
    display: flex;
    flex: 0 0 auto;
    gap: 5px;
    margin: 0;
    padding: 0;
    border: 0;
  }

  body:has(#super:not(.hide)) .sidebar-utility {
    display: grid;
    place-items: center;
    width: var(--mobile-touch);
    height: var(--mobile-touch);
    min-height: var(--mobile-touch);
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 13px;
    background: rgba(255, 255, 255, .055);
    font-size: 0;
    text-align: center;
  }

  body:has(#super:not(.hide)) .sidebar-utility::before {
    font-size: 18px;
  }

  body:has(#super:not(.hide)) #refreshBtn::before { content: "↻"; }
  body:has(#super:not(.hide)) #installPwaBtn::before { content: "↓"; }
  body:has(#super:not(.hide)) #logoutBtn::before { content: "↪"; }

  body:has(#super:not(.hide)) .workspace {
    padding: 12px 12px calc(28px + env(safe-area-inset-bottom, 0px));
    overflow: clip;
  }

  body:has(#super:not(.hide)) .top {
    display: none;
  }

  body:has(#super:not(.hide)) #app > #who {
    min-height: 64px;
    margin-bottom: 10px;
    padding: 12px 12px 12px 60px;
    border-radius: 17px;
  }

  body:has(#super:not(.hide)) #app > #who::before {
    top: 11px;
    left: 12px;
    width: 40px;
    height: 40px;
  }

  body:has(#super:not(.hide)) #app > #who > b {
    margin-top: 0;
    font-size: 14px;
  }

  body:has(#super:not(.hide)) #app > #who .pill {
    padding: 5px 8px;
    font-size: 9px;
  }

  body:has(#super:not(.hide)) #app > #who .muted,
  body:has(#super:not(.hide)) #app > #who small {
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body:has(#super:not(.hide)) .super-hero {
    display: grid;
    gap: 16px;
    margin-bottom: 12px;
    padding: 18px;
    border-radius: 19px;
  }

  body:has(#super:not(.hide)) .super-hero .eyebrow {
    margin-bottom: 5px;
    font-size: 9px;
  }

  body:has(#super:not(.hide)) .super-hero h2 {
    margin: 0 0 6px;
    font-size: clamp(1.75rem, 9vw, 2.15rem);
    line-height: .98;
  }

  body:has(#super:not(.hide)) .super-hero p {
    font-size: 13px;
    line-height: 1.45;
  }

  body:has(#super:not(.hide)) .super-hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  body:has(#super:not(.hide)) .super-hero-actions button {
    min-height: var(--mobile-touch);
    padding: 10px 8px;
    font-size: 12px;
  }

  body:has(#super:not(.hide)) #super > .super-tabs {
    display: none !important;
  }

  body:has(#super:not(.hide)) .card {
    margin-bottom: 12px;
    padding: 16px;
    border-radius: 17px;
  }

  body:has(#super:not(.hide)) .section-title {
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 13px;
  }

  body:has(#super:not(.hide)) .section-title > div:first-child {
    min-width: min(100%, 210px);
  }

  body:has(#super:not(.hide)) .section-title h2,
  body:has(#super:not(.hide)) .message-head h2,
  body:has(#super:not(.hide)) .cost-head h2 {
    font-size: 1.45rem;
    line-height: 1.05;
  }

  body:has(#super:not(.hide)) button,
  body:has(#super:not(.hide)) select,
  body:has(#super:not(.hide)) input,
  body:has(#super:not(.hide)) textarea {
    min-height: var(--mobile-touch);
  }

  body:has(#super:not(.hide)) input,
  body:has(#super:not(.hide)) select,
  body:has(#super:not(.hide)) textarea {
    font-size: 16px;
  }

  body:has(#super:not(.hide)) .super-kpis,
  body:has(#super:not(.hide)) .phase0-results-kpis,
  body:has(#super:not(.hide)) .phase0-infra-kpis {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  body:has(#super:not(.hide)) .grid > .card,
  body:has(#super:not(.hide)) .super-kpis > .card {
    min-height: 104px;
    padding: 13px;
  }

  body:has(#super:not(.hide)) .table-wrap {
    margin-inline: -4px;
    padding-bottom: 5px;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  body:has(#super:not(.hide)) .table-wrap table {
    min-width: 760px;
  }

  body:has(#super:not(.hide)) .table-wrap th:first-child,
  body:has(#super:not(.hide)) .table-wrap td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #fffefa;
    box-shadow: 8px 0 14px rgba(11, 54, 40, .05);
  }

  body:has(#super:not(.hide)) .filter-bar,
  body:has(#super:not(.hide)) .super-form-grid,
  body:has(#super:not(.hide)) .compact-grid,
  body:has(#super:not(.hide)) .billing-gateway-grid {
    grid-template-columns: 1fr;
  }

  body:has(#super:not(.hide)) .form-footer,
  body:has(#super:not(.hide)) .stack-actions.horizontal {
    align-items: stretch;
    flex-direction: column;
  }

  body:has(#super:not(.hide)) .form-footer button,
  body:has(#super:not(.hide)) .stack-actions.horizontal button,
  body:has(#super:not(.hide)) .commercial-readiness-hero button {
    width: 100%;
  }

  body:has(#super:not(.hide)) .super-modal {
    width: 100vw;
    min-height: 100dvh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  body:has(#super:not(.hide)) .modal-head {
    padding: calc(14px + env(safe-area-inset-top, 0px)) 14px 13px;
  }

  body:has(#super:not(.hide)) .modal-head h2 {
    font-size: 1.55rem;
  }

  body:has(#super:not(.hide)) .modal-body {
    padding: 10px;
  }

  body:has(#super:not(.hide)) .mobile-super-nav {
    position: fixed;
    z-index: 200;
    right: 8px;
    bottom: calc(7px + env(safe-area-inset-bottom, 0px));
    left: 8px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 3px;
    min-height: 62px;
    padding: 6px;
    border: 1px solid rgba(193, 215, 206, .92);
    border-radius: 19px;
    background: rgba(255, 254, 250, .96);
    box-shadow: 0 14px 42px rgba(4, 39, 29, .22);
    backdrop-filter: blur(18px);
  }

  .mobile-super-nav button {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 3px;
    min-width: 0;
    min-height: 50px;
    padding: 5px 2px;
    border: 0;
    border-radius: 13px;
    color: #64756e;
    background: transparent;
    box-shadow: none;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
  }

  .mobile-super-nav button::before {
    content: attr(data-icon);
    display: block;
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
  }

  .mobile-super-nav button.active {
    color: #fff;
    background: #0d6a50;
    box-shadow: 0 7px 16px rgba(13, 106, 80, .21);
  }

  body:has(#super:not(.hide)) .mobile-super-sheet-backdrop:not(.hide) {
    position: fixed;
    z-index: 320;
    inset: 0;
    display: grid;
    align-items: end;
    padding: 14px 10px 0;
    background: rgba(3, 30, 22, .58);
    backdrop-filter: blur(5px);
  }

  .mobile-super-sheet {
    max-height: min(82dvh, 720px);
    padding: 9px 14px calc(16px + env(safe-area-inset-bottom, 0px));
    overflow: auto;
    border-radius: 24px 24px 0 0;
    background: #fffefa;
    box-shadow: 0 -22px 70px rgba(2, 28, 20, .3);
  }

  .mobile-super-sheet-handle {
    width: 42px;
    height: 5px;
    margin: 2px auto 12px;
    border-radius: 999px;
    background: #cedbd5;
  }

  .mobile-super-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
  }

  .mobile-super-sheet-head span {
    display: block;
    margin-bottom: 3px;
    color: #0d6a50;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .12em;
  }

  .mobile-super-sheet-head h2 {
    margin: 0;
    font-size: 1.45rem;
  }

  .mobile-super-sheet-close {
    width: var(--mobile-touch);
    height: var(--mobile-touch);
    min-height: var(--mobile-touch);
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #183a2f;
    background: #edf3ef;
    box-shadow: none;
    font-size: 22px;
  }

  .mobile-super-menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .mobile-super-menu-grid button {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 10px 11px;
    border: 1px solid #dfe8e3;
    border-radius: 15px;
    color: #304a40;
    background: #f7faf8;
    box-shadow: none;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
    text-align: left;
  }

  .mobile-super-menu-grid button > span:first-child {
    display: grid;
    flex: 0 0 34px;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    color: #0d6a50;
    background: #e5f3ed;
    font-size: 16px;
  }

  .mobile-super-menu-grid button.active {
    border-color: #0d6a50;
    color: #0b6048;
    background: #eaf7f1;
    box-shadow: inset 0 0 0 1px #0d6a50;
  }

  .mobile-super-utilities {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
    margin-top: 14px;
    padding-top: 13px;
    border-top: 1px solid #e2e9e5;
  }

  .mobile-super-utilities button {
    min-height: var(--mobile-touch);
    padding: 8px 5px;
    border: 1px solid #dfe7e2;
    border-radius: 12px;
    color: #52675e;
    background: #fff;
    box-shadow: none;
    font-size: 10px;
    font-weight: 800;
  }

  .mobile-super-utilities button.danger {
    color: #a74444;
    background: #fff7f7;
  }

  body.mobile-super-sheet-open {
    overflow: hidden;
  }
}

@media (max-width: 365px) {
  .mobile-super-nav button {
    font-size: 9px;
  }

  .mobile-super-menu-grid {
    grid-template-columns: 1fr;
  }

  body:has(#super:not(.hide)) .super-hero-actions,
  body:has(#super:not(.hide)) .super-kpis,
  body:has(#super:not(.hide)) .phase0-results-kpis,
  body:has(#super:not(.hide)) .phase0-infra-kpis {
    grid-template-columns: 1fr;
  }
}
