/* Topteller reseller responsive shell — loaded last by layouts/app.php. */
.tt-app .topbar { position: relative !important; top: auto !important; z-index: 10; }
.mobile-menu-button,.sidebar-mobile-head,.sidebar-backdrop { display: none; }

/* Keep every navigation item reachable on short laptops and tall mobile menus. */
body.tt-app .sidebar {
  height: calc(100dvh - 40px);
  min-height: 0;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
body.tt-app .sidebar-shell {
  height: auto;
  min-height: 100%;
}
body.tt-app .sidebar::-webkit-scrollbar { width: 7px; }
body.tt-app .sidebar::-webkit-scrollbar-track { background: transparent; }
body.tt-app .sidebar::-webkit-scrollbar-thumb { background: rgba(245,166,35,.42); border-radius: 999px; }
.main-panel,.page-stack,.panel,.sub-panel,.table-wrap { min-width: 0; }
body.tt-app :is(.main-panel,.page-stack,.panel,.sub-panel,.hero-card,.service-card,.stat-card,.content-grid,.two-column,.form-grid,.action-row,.panel-header,.shell-heading) > * { min-width: 0; }
body.tt-app :is(h1,h2,h3,h4,h5,h6,p,span,strong,a,td,th,label,.brand-copy,.section-copy,.mini-copy,.footer-note,.card-title,.hero-title,.stat-value) {
  overflow-wrap: anywhere;
  word-break: normal;
}
.table-wrap { width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch; }
.table-wrap table { min-width: 680px; }
img,svg,video,canvas { max-width: 100%; }
input,select,textarea,button { max-width: 100%; }
.table-toolbar { display: grid; gap: 7px; margin: 0 0 14px; }
.table-toolbar > label { color: var(--ink-muted); font-size: .75rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.table-search-field { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.table-search-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; }
.table-search-field b { color: var(--ink-muted); font-size: .75rem; white-space: nowrap; }
button.is-processing { cursor: wait; opacity: .72; }
.reseller-live-preview { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(150px,.5fr); gap: 24px; overflow: hidden; padding: 24px; border-radius: 20px; background: linear-gradient(135deg,color-mix(in srgb,var(--preview-brand) 22%,#0d1220),#0d1220); color: #fff; }
.reseller-live-preview__copy { display: grid; gap: 10px; }
.reseller-live-preview__copy > span { color: rgba(255,255,255,.64); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.reseller-live-preview__copy > strong { font: 800 clamp(1.3rem,3vw,2rem)/1.15 Sora,sans-serif; }
.reseller-live-preview__copy > p { margin: 0; color: rgba(255,255,255,.76); line-height: 1.55; }
.reseller-live-preview__copy > div { display: flex; flex-wrap: wrap; gap: 8px; }
.reseller-live-preview__copy i { padding: 9px 13px; border-radius: 999px; background: var(--preview-brand); font-size: .75rem; font-style: normal; font-weight: 800; }
.reseller-live-preview__copy i.ghost { border: 1px solid rgba(255,255,255,.25); background: transparent; }
.reseller-live-preview__brand { display: grid; place-items: center; align-content: center; gap: 10px; min-height: 130px; border: 1px solid rgba(255,255,255,.15); border-radius: 16px; background: rgba(255,255,255,.07); text-align: center; }
.reseller-live-preview__brand img { width: 58px; height: 58px; border-radius: 14px; object-fit: contain; background: #fff; }

@media (max-width: 980px) {
  body.nav-open { overflow: hidden; }
  body.tt-app .page-grid { display: block; width: 100%; padding: 12px; }
  body.tt-app .main-panel { width: 100%; padding: 0 0 84px; }
  body.tt-app .topbar {
    inset: auto !important; display: grid; grid-template-columns: minmax(0,1fr) auto;
    align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px;
    backdrop-filter: none; background: var(--surface); box-shadow: var(--shadow-sm);
  }
  .mobile-menu-button {
    display: inline-flex; align-items: center; gap: 9px; width: fit-content; min-height: 40px;
    padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px;
    background: var(--surface-soft); color: var(--ink); font-size: .82rem; font-weight: 800; cursor: pointer;
  }
  .mobile-menu-icon { display: grid; width: 18px; gap: 3px; }
  .mobile-menu-icon i { display: block; height: 2px; border-radius: 2px; background: currentColor; }
  body.tt-app .topbar .topbar-context,
  body.tt-app .topbar .topbar-copy,
  body.tt-app .topbar .topbar-service-strip,
  body.tt-app .topbar .shell-meta > .chip,
  body.tt-app .topbar .tt-status-badge,
  body.tt-app .topbar .action-row > a,
  body.tt-app .topbar .inline-form { display: none !important; }
  body.tt-app .topbar .shell-heading { display: flex; min-width: 0; align-items: center; gap: 12px; }
  body.tt-app .topbar-title {
    min-width: 0; margin: 0; font-size: 1.05rem; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
  }
  body.tt-app .topbar .shell-meta,
  body.tt-app .topbar .action-row { width: auto; justify-items: end; }
  body.tt-app .sidebar {
    display: block; position: fixed !important; inset: 0 auto 0 0 !important;
    width: min(88vw,340px); height: 100dvh; max-height: 100dvh; border-radius: 0 24px 24px 0;
    transform: translateX(-105%); z-index: 1002; transition: transform .24s ease;
  }
  body.tt-app .sidebar.is-open { transform: translateX(0); }
  body.tt-app .sidebar-shell { height: max-content; min-height: 100%; padding: 18px 18px 32px; }
  .sidebar-mobile-head {
    display: flex; align-items: center; justify-content: space-between; color: rgba(255,255,255,.86);
    font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  }
  .sidebar-close {
    display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid rgba(255,255,255,.16);
    border-radius: 12px; background: rgba(255,255,255,.08); color: #fff; font-size: 1.55rem; cursor: pointer;
  }
  .sidebar-backdrop {
    position: fixed; inset: 0; z-index: 1001; width: 100%; height: 100%; border: 0;
    background: rgba(4,10,24,.58); opacity: 0; pointer-events: none; transition: opacity .2s ease;
  }
  .sidebar-backdrop.is-visible { display: block; opacity: 1; pointer-events: auto; }
  body.tt-app .page-stack { gap: 14px; margin-top: 14px; }
  body.tt-app :is(.content-grid,.two-column,.dashboard-hero-grid,.service-hero-grid,.form-grid.two-up,.inline-form-grid) {
    grid-template-columns: minmax(0,1fr) !important;
  }
  .reseller-live-preview { grid-template-columns: 1fr; }
  .reseller-live-preview__brand { display: none; }
}

@media (max-width: 640px) {
  html, body { max-width: 100%; overflow-x: hidden; }
  body.tt-app .page-grid { padding: 8px; }
  body.tt-app .topbar { padding: 10px 12px; border-radius: 14px; }
  body.tt-app :is(.panel,.sub-panel,.hero-card,.service-family-card,.launch-card,.spotlight-card,.service-nav-card,.stat-card) {
    padding: 16px; border-radius: 16px;
  }
  body.tt-app :is(.action-row,.pill-row,.button-row) { align-items: stretch; }
  body.tt-app :is(.action-row,.button-row) > * { flex: 1 1 100%; }
  body.tt-app :is(.form-grid,.inline-form-grid,form) { min-width: 0; }
  body.tt-app :is(.content-grid,.two-column,.dashboard-hero-grid,.service-hero-grid,.form-grid,.action-row,.panel-header,.shell-heading) { width: 100%; max-width: 100%; }
  body.tt-app :is(.panel-header,.action-row,.pill-row,.button-row) { flex-wrap: wrap; }
  body.tt-app :is(input,select,textarea) { width: 100%; min-height: 46px; font-size: 16px; }
  body.tt-app .table-wrap { margin: 0; width: 100%; overflow: visible; border: 0; background: transparent; }
  body.tt-app .responsive-table { display: block; min-width: 0; }
  body.tt-app .responsive-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  body.tt-app .responsive-table tbody { display: grid; gap: 12px; }
  body.tt-app .responsive-table tr { display: grid; gap: 0; padding: 6px 14px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: var(--shadow-sm); }
  body.tt-app .responsive-table tr[hidden] { display: none; }
  body.tt-app .responsive-table td { display: grid; grid-template-columns: minmax(90px,.7fr) minmax(0,1.3fr); gap: 12px; align-items: start; width: 100%; padding: 9px 0; border: 0; border-bottom: 1px solid var(--line); text-align: right; overflow-wrap: anywhere; }
  body.tt-app .responsive-table td:last-child { border-bottom: 0; }
  body.tt-app .responsive-table td::before { content: attr(data-label); color: var(--ink-muted); font-size: .72rem; font-weight: 800; letter-spacing: .03em; text-align: left; text-transform: uppercase; }
  body.tt-app .responsive-table td.table-empty { display: block; text-align: center; }
  body.tt-app .responsive-table td.table-empty::before { display: none; }
  body.tt-app .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
  body.tt-app .stat-value { font-size: clamp(1.1rem,7vw,1.65rem); overflow-wrap: anywhere; }
  body.tt-app .tt-dash-hero-cta { display: grid; grid-template-columns: 1fr; }
  body.tt-app .tt-dash-balance-row { display: grid; grid-template-columns: 1fr 1fr; }
  body.tt-app .tt-svc-form-card-head, body.tt-app .panel-header, body.tt-app .tt-card-head { align-items: flex-start; gap: 10px; }
}

@media (max-width: 390px) {
  body.tt-app .stats-grid { grid-template-columns: 1fr !important; }
  body.tt-app .responsive-table td { grid-template-columns: 82px minmax(0,1fr); }
  body.tt-app .tt-bottom-nav-item span { font-size: .63rem; }
}

@media (prefers-reduced-motion: reduce) {
  body.tt-app .sidebar, body.tt-app .sidebar-backdrop { transition: none; }
}
