/* Mobile only: desktop sidebar retains its existing layout. */
@media screen and (max-width:760px) {
  .sidebar {
    inset:auto 12px calc(12px + env(safe-area-inset-bottom,0px));
    width:auto; max-width:540px; height:auto; margin:0 auto; padding:6px;
    border:1px solid rgba(255,255,255,.85); border-radius:38px;
    background:rgba(250,251,250,.7);
    -webkit-backdrop-filter:blur(24px) saturate(180%);
    backdrop-filter:blur(24px) saturate(180%);
    box-shadow:0 8px 32px #19233220,0 1px 4px #1923320d,inset 0 1px 0 #fffffff2;
  }
  .sidebar .nav {
    display:flex; flex-direction:row; justify-content:flex-start; align-items:stretch;
    gap:2px; overflow-x:auto; scrollbar-width:none; overscroll-behavior-x:contain; border-radius:30px;
  }
  .sidebar .nav::-webkit-scrollbar { display:none; }
  .sidebar .nav button,.sidebar .nav #ask-blackcats-nav {
    flex:1 0 62px; min-width:62px; min-height:56px; margin:0;
    display:flex; flex-direction:column; align-items:center; justify-content:center;
    gap:5px; padding:6px 5px; border:0; border-radius:29px;
    background:transparent; color:#525c56; font-size:10px; line-height:1.15;
    text-align:center; text-decoration:none; white-space:normal;
  }
  .sidebar .nav button.active { background:rgba(82,112,92,.14); color:#182e21; box-shadow:inset 0 1px 1px #ffffffb3; }
  .sidebar .nav svg { flex-shrink:0; width:22px; height:22px; }
  .main { padding-bottom:calc(108px + env(safe-area-inset-bottom,0px)); }
  .order-page .order-save-bar { bottom:calc(90px + env(safe-area-inset-bottom,0px)); }
  #toast { bottom:calc(96px + env(safe-area-inset-bottom,0px)); }
}
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))) {
  @media screen and (max-width:760px) { .sidebar { background:rgba(250,251,250,.97); } }
}
@media screen and (max-width:760px) {
  .sidebar .nav { height:62px; }
  .sidebar .nav #ask-blackcats-nav {
    display:flex!important; margin:0!important; padding:6px 5px!important;
    border-radius:29px!important; font-size:10px!important; line-height:1.15!important;
  }
}

.mobile-account-settings { display:none; }
@media screen and (max-width:760px) {
  .main > .topbar { display:none; }
  .mobile-account-settings { display:block; }
  .main > .content > .heading { position:relative; }
  .main > .content > .heading::after {
    content:""; position:absolute; right:0; top:0; width:64px; height:46px;
    background:url("assets/logo.png") center / contain no-repeat; pointer-events:none;
  }
  .main > .content > .heading > div:first-child { padding-right:76px; }
  .main > .content > .heading > .actions { padding-right:0; }
}
/* Weekly performance becomes a compact agent summary on phones. */
@media screen and (max-width:760px) {
  .weekly-panel { min-width:0; }
  .weekly-panel .table-wrap { overflow:visible; padding:12px 17px 17px; }
  .weekly-panel table,.weekly-panel tbody { display:block; width:100%; min-width:0; white-space:normal; }
  .weekly-panel thead { display:none; }
  .weekly-panel tbody tr { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:12px; padding:16px 0; border-bottom:1px solid #e6e9e5; }
  .weekly-panel tbody tr:last-child { border-bottom:0; padding-bottom:0; }
  .weekly-panel tbody td { display:block; min-width:0; padding:0; border:0; white-space:normal; overflow-wrap:anywhere; font-size:14px; }
  .weekly-panel tbody td:first-child { grid-column:1/-1; font-weight:700; font-size:15px; }
  .weekly-panel tbody td:nth-child(2)::before { content:'Sales this week'; }
  .weekly-panel tbody td:nth-child(3)::before { content:'Weekly target'; }
  .weekly-panel tbody td:nth-child(2)::before,.weekly-panel tbody td:nth-child(3)::before { display:block; margin-bottom:5px; color:#727c75; font-size:11px; font-weight:400; }
  .weekly-panel tbody td:last-child { grid-column:1/-1; font-size:12px; }
  .weekly-panel .pending-amount { display:inline-block; max-width:100%; white-space:normal; }
}
@media screen and (max-width:760px) {
  .weekly-panel .card-head { padding:16px 16px 0; }
  .weekly-panel .card-head p { font-size:10px; line-height:1.4; margin:5px 0 0; }
  .weekly-panel .table-wrap { padding:4px 16px 12px; }
  .weekly-panel tbody tr { grid-template-columns:minmax(0,1fr) auto; gap:6px 10px; padding:11px 0; }
  .weekly-panel tbody td:first-child { grid-column:1; grid-row:1; font-size:13px; align-self:center; }
  .weekly-panel tbody td:last-child { grid-column:2; grid-row:1; font-size:10px; text-align:right; align-self:center; }
  .weekly-panel tbody td:nth-child(2),.weekly-panel tbody td:nth-child(3) { grid-row:2; font-size:12px; }
  .weekly-panel tbody td:nth-child(3) { text-align:right; }
  .weekly-panel tbody td:nth-child(2)::before,.weekly-panel tbody td:nth-child(3)::before { display:inline; margin-right:5px; font-size:10px; }
  .weekly-panel tbody td:nth-child(2)::before { content:'Sales'; }
  .weekly-panel tbody td:nth-child(3)::before { content:'Target'; }
  .weekly-panel .pending-amount { padding:3px 6px; font-size:10px; line-height:1.3; }
}
