/* Panel admina na komputerze (features/admindesk.js) — tylko szeroki ekran, telefon bez zmian */
.adesk-side{display:none;}

@media (min-width:1100px){
  body.adesk .app{max-width:none;}
  body.adesk #viewbar{display:none !important;}
  body.adesk #view-admin{padding-left:272px;}
  body.adesk #view-admin > .bottomnav{display:none;}
  body.adesk #view-admin > .screen{max-width:1280px; margin:0 auto; padding:26px 48px 80px; box-sizing:border-box;}
  body.adesk #view-admin .topbar{padding:6px 0 18px;}
  body.adesk #view-admin .topbar h1{font-size:30px;}
  body.adesk #view-admin .topbar .sub{font-size:14px; max-width:760px;}
  /* Menu boczne zastępuje przycisk „← Admin HQ” na ekranach działów */
  body.adesk #view-admin .topbar > .backrow[data-admin-go="home"]{display:none;}

  /* ---------- menu boczne ---------- */
  body.adesk .adesk-side{
    display:flex; flex-direction:column; position:fixed; z-index:50; left:0; top:0; bottom:0; width:272px;
    background:rgba(18,20,55,.86); backdrop-filter:blur(18px); -webkit-backdrop-filter:blur(18px);
    border-right:1px solid var(--stroke); box-sizing:border-box;
  }
  .adesk-brand{display:flex; align-items:center; gap:12px; padding:22px 20px 16px;}
  .adesk-brand img{width:42px; height:42px; object-fit:contain;}
  .adesk-brand b{display:block; font:700 16px Poppins,sans-serif; color:#fff;}
  .adesk-brand small{font-size:12px; color:var(--ink-400);}
  .adesk-search{padding:0 16px 10px;}
  .adesk-search input{
    width:100%; box-sizing:border-box; padding:9px 12px; border-radius:12px; font:inherit; font-size:13px;
    background:var(--surface-2); border:1px solid var(--stroke); color:var(--ink-100);
  }
  .adesk-search input:focus{outline:none; border-color:rgba(166,139,255,.5);}
  /* Wyniki wyszukiwania klientów pod polem (klik = Karta klienta) */
  .adesk-hits{margin-top:8px; padding:8px 4px 6px; border-radius:12px; background:var(--surface-solid); border:1px solid var(--stroke); max-height:46vh; overflow-y:auto;}
  .adesk-hits[hidden]{display:none;}
  .adesk-hit{display:flex; align-items:center; gap:10px; width:100%; padding:7px 8px; border:0; border-radius:9px; background:none; color:var(--ink-100); text-align:left; cursor:pointer; font:inherit;}
  .adesk-hit:hover,.adesk-hit:focus-visible{background:rgba(255,255,255,.06); outline:none;}
  .adesk-hit .av{width:30px; height:30px; flex:none; border-radius:50%; background:var(--grad-soft); display:flex; align-items:center; justify-content:center; font:700 11px Poppins,sans-serif; color:#fff;}
  .adesk-hit .ht{min-width:0; display:flex; flex-direction:column;}
  .adesk-hit b{font-size:13px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .adesk-hit small{font-size:11px; color:var(--ink-400); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .adesk-none{font-size:12px; color:var(--ink-400); padding:4px 10px 6px; margin:0;}
  .adesk-nav{flex:1; overflow-y:auto; padding:4px 10px 12px; scrollbar-width:thin; scrollbar-color:rgba(255,255,255,.12) transparent;}
  .adesk-group{margin-top:14px;}
  .adesk-gt{font-size:10.5px; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:var(--ink-600); padding:0 10px 6px;}
  .adesk-item{
    display:flex; align-items:center; gap:10px; width:100%; padding:7px 10px; border:0; border-radius:10px;
    background:none; color:var(--ink-300); font:500 13.5px Inter,sans-serif; text-align:left; cursor:pointer; text-decoration:none;
  }
  .adesk-item[hidden]{display:none;}
  .adesk-item:hover{background:rgba(255,255,255,.05); color:#fff;}
  .adesk-item.active{background:var(--grad-soft); color:#fff; box-shadow:inset 0 0 0 1px rgba(166,139,255,.25);}
  .adesk-item .ai{width:22px; height:22px; flex:none; display:flex; align-items:center; justify-content:center; color:var(--violet-300);}
  .adesk-item .ai svg{width:18px; height:18px;}
  .adesk-item .at{flex:1; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .adesk-foot{padding:10px; border-top:1px solid var(--stroke);}

  /* ---------- Pulpit (Admin HQ) ---------- */
  body.adesk [data-ascreen="home"] .apphead{padding-top:4px;}
  body.adesk [data-ascreen="home"] .apphead h1{font-size:30px;}
  body.adesk [data-ascreen="home"] .apphead .headactions{display:none;}
  body.adesk [data-ascreen="home"] .kpigrid{grid-template-columns:repeat(4,minmax(0,1fr)); gap:18px;}
  body.adesk [data-ascreen="home"] .kpigrid .num{font-size:30px;}
  body.adesk [data-ascreen="home"] .kpihero{padding:26px 30px;}
  body.adesk [data-ascreen="home"] .linklist{
    display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px;
    background:none; border:0; box-shadow:none; border-radius:0; overflow:visible;
  }
  body.adesk [data-ascreen="home"] .linklist .linkrow{border:1px solid var(--stroke); border-radius:16px; background:var(--surface);}
  body.adesk [data-ascreen="home"] .linklist .linkrow:hover{background:var(--surface-2);}

  /* ---------- szeroka treść działów ---------- */
  body.adesk #view-admin .screen:not([data-ascreen="home"]) .linklist{
    display:grid; grid-template-columns:repeat(auto-fill,minmax(380px,1fr));
  }
  body.adesk #view-admin .screen:not([data-ascreen="home"]) .linklist .linkrow{border-bottom:1px solid var(--stroke); border-right:1px solid var(--stroke);}
  body.adesk #view-admin .formcard{max-width:860px;}
  body.adesk #view-admin .formcard .formrow textarea{min-height:110px;}
  body.adesk #view-admin table{width:100%;}
  body.adesk #view-admin .statrow{grid-template-columns:repeat(auto-fit,minmax(180px,1fr));}

  /* Arkusze otwierają się jako okno na środku ekranu, a nie od dołu */
  body.adesk .overlay{align-items:center; padding:24px; box-sizing:border-box;}
  body.adesk .sheet{max-width:620px; border-radius:22px; max-height:calc(100vh - 48px); overflow-y:auto; border:1px solid rgba(255,255,255,.08);}
  body.adesk .sheet .handle{display:none;}
  body.adesk .toast{left:calc(50% + 136px);}
}
