/* Tenant navigation adapts without reserving sidebar width on compact screens. */
.mobile-nav-toggle,.mobile-nav-backdrop,.mobile-nav{display:none}
.shell{min-width:0}
.sidebar{flex:0 0 250px;min-width:0}
.content,.main{min-width:0}

@media (max-width: 900px){
  .shell{display:block;min-height:100vh}
  .sidebar{position:fixed;z-index:1200;inset:0 auto 0 0;width:min(300px,86vw);height:100dvh;overflow-y:auto;transform:translateX(-105%);transition:transform .2s ease;padding:18px 14px;box-shadow:0 12px 40px rgba(10,25,45,.25)}
  body.mobile-nav-open{overflow:hidden}
  body.mobile-nav-open .sidebar{transform:translateX(0)}
  .sidebar .brand{padding:4px 8px 20px}
  .sidebar .brand-text,.sidebar .nav button span:not(.icon),.sidebar .sidebar-foot{display:block}
  .sidebar .brand-logo{margin:0}
  .sidebar .desktop-nav{display:none}
  .sidebar .mobile-nav{display:grid;gap:5px}
  .sidebar .mobile-nav button{justify-content:flex-start;min-height:46px;padding:10px 12px}
  .sidebar .mobile-nav .icon{flex:0 0 22px}
  .mobile-nav-toggle{display:inline-grid;place-items:center;flex:0 0 40px;width:40px;height:40px;border:1px solid var(--line);border-radius:9px;background:#fff;color:var(--ink);font-size:20px;line-height:1}
  .mobile-nav-backdrop:not([hidden]){display:block;position:fixed;z-index:1190;inset:0;background:rgba(12,25,44,.38);border:0}
  .topbar{height:auto;min-height:60px;gap:10px;padding:9px 14px}
  .crumb{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .top-actions{gap:8px;min-width:0}
  .top-actions .business{max-width:18vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .top-actions .avatar{flex:0 0 32px;width:32px;height:32px}
  .top-actions #logout{padding:7px 9px;white-space:nowrap}
  .main{width:100%;max-width:none;padding:20px 18px 36px}
}

@media (max-width: 700px){
  .topbar{display:grid;grid-template-columns:40px minmax(0,1fr) auto;min-height:56px;padding:7px 10px;gap:8px}
  .top-actions{gap:6px}
  .top-actions .business,.top-actions #company-switcher{display:none}
  .top-actions .avatar{display:none}
  .top-actions #logout{font-size:11px;padding:7px 8px}
  .main{padding:15px 12px 28px}
  .headline{gap:10px;margin-bottom:16px}
  .headline h1{font-size:21px;line-height:1.25}
  .headline p{font-size:13px;line-height:1.4}
  .cards{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin-bottom:15px}
  .card{min-width:0;padding:12px;min-height:96px}
  .metric{margin-top:12px}
  .section-grid{grid-template-columns:minmax(0,1fr);gap:12px;margin-bottom:12px}
  .panel{min-width:0}
  .panel-head{padding:14px;gap:8px}
  .crm-detail-grid{grid-template-columns:minmax(0,1fr)!important;gap:12px!important}
  .crm-detail-stack,.crm-detail-grid>*{min-width:0;width:100%}
  .crm-operations-grid{grid-template-columns:minmax(0,1fr)!important}
  .crm-form-panel{min-width:0;width:100%;padding:13px}
  .crm-fields{grid-template-columns:minmax(0,1fr)!important}
  .crm-fields label,.crm-fields input,.crm-fields select,.crm-fields textarea,.crm-action{min-width:0;width:100%;max-width:100%}
  .crm-lifecycle-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .crm-lifecycle-actions .crm-action{min-height:46px}
  .crm-followup-fields{grid-template-columns:minmax(0,1fr)!important}
  .crm-timeline{position:static!important;height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important;padding:13px}
  .crm-timeline ol{max-height:52vh;overflow-y:auto}
  .crm-event,.crm-event *{min-width:0;overflow-wrap:anywhere}
  html,body,#app,.shell,.content,.main{max-width:100%;overflow-x:clip}
}

@media (max-width: 380px){
  .top-actions #logout{font-size:10px;padding:6px}
  .crm-lifecycle-actions{grid-template-columns:minmax(0,1fr)}
}

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