/* Mobile layout overrides for the existing VoicePanel dashboard. */
.vp-mobile-menu,
.vp-mobile-overlay {
  display: none;
}

@media (max-width: 767px) {
  html,
  body,
  #root {
    width: 100%;
    min-width: 0;
    min-height: 100%;
    overflow-x: hidden;
  }

  body {
    -webkit-text-size-adjust: 100%;
  }

  .vp-root {
    width: 100%;
    min-width: 0;
    height: 100dvh;
  }

  .vp-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 80;
    width: min(82vw, 286px);
    height: 100dvh;
    transform: translateX(-105%);
    transition: transform 220ms ease;
    animation: none;
    box-shadow: 20px 0 55px rgb(0 0 0 / 45%);
  }

  body.vp-menu-open .vp-sidebar {
    transform: translateX(0);
  }

  .vp-mobile-overlay {
    position: fixed;
    inset: 0;
    z-index: 70;
    border: 0;
    background: rgb(1 2 10 / 72%);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
  }

  body.vp-menu-open .vp-mobile-overlay {
    display: block;
  }

  .vp-main {
    width: 100%;
    min-width: 0;
  }

  .vp-topbar {
    height: 56px;
    padding: 0 12px;
  }

  .vp-topbar-left {
    min-width: 0;
    gap: 9px;
  }

  .vp-mobile-menu {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid rgb(255 255 255 / 12%);
    border-radius: 9px;
    color: rgb(255 255 255 / 88%);
    background: rgb(255 255 255 / 6%);
  }

  .vp-mobile-menu span,
  .vp-mobile-menu::before,
  .vp-mobile-menu::after {
    display: block;
    width: 17px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    content: "";
  }

  .vp-mobile-menu span {
    margin: 4px 0;
  }

  .vp-topbar-breadcrumb {
    min-width: 0;
  }

  .vp-topbar-brand,
  .vp-topbar-sep,
  .vp-topbar-badge {
    display: none;
  }

  .vp-topbar-page {
    display: block;
    max-width: 48vw;
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .vp-topbar-right {
    gap: 7px;
  }

  .vp-content {
    min-width: 0;
    padding: 14px 12px 28px;
    overflow-x: hidden;
  }

  .vp-content > * {
    min-width: 0;
    max-width: 100%;
  }

  .vp-content h1,
  .vp-content h2 {
    overflow-wrap: anywhere;
  }

  .vp-content h2.text-2xl {
    font-size: 1.3rem;
    line-height: 1.75rem;
  }

  .vp-content .p-6 {
    padding: 1rem;
  }

  .vp-content .gap-6 {
    gap: 1rem;
  }

  .vp-content .grid-cols-2,
  .vp-content .grid-cols-3,
  .vp-content .grid-cols-4 {
    grid-template-columns: minmax(0, 1fr);
  }

  .vp-content .flex.items-center.justify-between,
  .vp-content .flex.items-end.justify-between {
    flex-wrap: wrap;
    gap: 10px;
  }

  .vp-content .flex.items-center.gap-4 {
    flex-wrap: wrap;
    gap: 10px;
  }

  .vp-content .max-w-xs {
    width: 100%;
    max-width: none;
  }

  .vp-content table {
    min-width: 680px;
  }

  .vp-content [class*="rounded-xl"][class*="border"] {
    max-width: 100%;
  }

  .vp-content [class*="rounded-xl"][class*="border"]:has(table) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  [role="dialog"] {
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    max-height: calc(100dvh - 20px) !important;
    padding: 18px !important;
    overflow-x: hidden;
    overflow-y: auto;
  }

  [role="dialog"] .grid-cols-2,
  [role="dialog"] .grid-cols-3,
  [role="dialog"] .grid-cols-4 {
    grid-template-columns: minmax(0, 1fr);
  }

  [role="dialog"] .flex.gap-4,
  [role="dialog"] .flex.items-center.justify-between {
    flex-wrap: wrap;
  }

  [role="dialog"] input,
  [role="dialog"] select,
  [role="dialog"] textarea,
  [role="dialog"] button {
    max-width: 100%;
  }

  .vp-login-wrap {
    width: 100%;
    max-width: none;
    padding: 18px 12px;
  }

  .vp-login-card {
    width: 100%;
    padding: 24px 18px;
    border-radius: 16px;
  }

  #vp-batch-panel {
    padding: 14px !important;
  }

  .vp-batch-title {
    align-items: stretch !important;
    flex-direction: column !important;
  }

  .vp-batch-actions {
    grid-template-columns: minmax(0, 1fr) 88px !important;
  }

  .vp-batch-actions button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .vp-batch-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  iframe[title="Local Trunks"] {
    width: 100% !important;
    min-height: calc(100dvh - 90px) !important;
    height: calc(100dvh - 90px) !important;
  }
}

@media (min-width: 480px) and (max-width: 767px) {
  .vp-content .grid-cols-2,
  .vp-content .grid-cols-3,
  .vp-content .grid-cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 359px) {
  .vp-content {
    padding-inline: 8px;
  }

  .vp-avatar {
    display: none;
  }

  .vp-batch-stats {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vp-sidebar {
    transition: none;
  }
}
